Bug 1119842 - slapschema reports error but returns 0 and not 1 as it used to
Summary: slapschema reports error but returns 0 and not 1 as it used to
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openldap
Version: 6.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Matus Honek
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 1123273
TreeView+ depends on / blocked
 
Reported: 2014-07-15 15:53 UTC by Patrik Kis
Modified: 2015-10-14 15:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1123273 (view as bug list)
Environment:
Last Closed: 2015-10-14 15:43:57 UTC


Attachments (Terms of Use)
Reproducer (816 bytes, application/x-xz)
2014-07-21 12:16 UTC, Jan Synacek
no flags Details


Links
System ID Priority Status Summary Last Updated
OpenLDAP ITS 7901 None None None Never

Description Patrik Kis 2014-07-15 15:53:33 UTC
Description of problem:
see the reproducer

Version-Release number of selected component (if applicable):
openldap-2.4.39-8.el6

How reproducible:
always

Steps to Reproduce:

1. With the old openldap pckage the following scenario worked as expected:

# cat /etc/openldap/slapd.conf
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/nis.schema
allow bind_v2
pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

database        ldif
suffix          dc=example,dc=com
rootdn          "cn=Manager,dc=example,dc=com"
# password is 'x'
rootpw          {SSHA}tOSmeQCcYIm1S9ujgpg2Km5rpUnR9dRB

directory       /var/lib/ldap/
include         /etc/openldap/schema/dyngroup.schema

# rpm -q openldap
openldap-2.4.23-34.el6_5.1.x86_64
openldap-2.4.23-34.el6_5.1.i686
#
# slapschema; echo $?
0
# slapschema -n0; echo $?
# no data for entry id=00000000

1
# slapschema -n1; echo $?
0
#
# sed -i 's/^include.*dyngroup.schema//' /etc/openldap/slapd.conf
#
# slapschema; echo $?
str2entry: invalid value for attributeType objectClass #0 (syntax 1.3.6.1.4.1.1466.115.121.1.38)
# no data for entry id=00000000

1
# slapschema -n0; echo $?
# no data for entry id=00000000

1
# slapschema -n1; echo $?
str2entry: invalid value for attributeType objectClass #0 (syntax 1.3.6.1.4.1.1466.115.121.1.38)
# no data for entry id=00000000

1


2. But after rebase it returns 0 even if it reports error

# rpm -q openldap
openldap-2.4.39-8.el6.x86_64
openldap-2.4.39-8.el6.i686
# cat /etc/openldap/slapd.conf
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/nis.schema
allow bind_v2
pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

database        ldif
suffix          dc=example,dc=com
rootdn          "cn=Manager,dc=example,dc=com"
# password is 'x'
rootpw          {SSHA}tOSmeQCcYIm1S9ujgpg2Km5rpUnR9dRB

directory       /var/lib/ldap/
include         /etc/openldap/schema/dyngroup.schema

#
# slapschema; echo $?
0
# slapschema -n0; echo $?
0
# # ^^^ This can be considered as an improvement
#
# slapschema -n1; echo $?
0
#
# sed -i 's/^include.*dyngroup.schema//' /etc/openldap/slapd.conf
#
# slapschema; echo $?
53c54cdb str2entry: invalid value for attributeType objectClass #0 (syntax 1.3.6.1.4.1.1466.115.121.1.38)
0
# slapschema -n0; echo $?
0
# slapschema -n1; echo $?
53c54ce0 str2entry: invalid value for attributeType objectClass #0 (syntax 1.3.6.1.4.1.1466.115.121.1.38)
0
# # There should be 1 returned, but it returned 0

Comment 2 Jan Synacek 2014-07-21 06:07:47 UTC
Could you please rerun the test using -b instead of -n, and also enabling verbose mode?

Comment 3 Patrik Kis 2014-07-21 08:28:16 UTC
(In reply to Jan Synacek from comment #2)
> Could you please rerun the test using -b instead of -n, and also enabling
> verbose mode?

# cat /etc/openldap/slapd.conf
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/nis.schema
allow bind_v2
pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

database        ldif
suffix          dc=example,dc=com
rootdn          "cn=Manager,dc=example,dc=com"
# password is 'x'
rootpw          {SSHA}tOSmeQCcYIm1S9ujgpg2Km5rpUnR9dRB

directory       /var/lib/ldap/
include         /etc/openldap/schema/dyngroup.schema

# slapschema -v -b "dc=example,dc=com"; echo $?
# id=00000001
# id=00000002
# id=00000003
# id=00000004
# id=00000005
# id=00000006
0
# slapschema -v -n1; echo $?
# id=00000001
# id=00000002
# id=00000003
# id=00000004
# id=00000005
# id=00000006
0

# sed -i 's/^include.*dyngroup.schema//' /etc/openldap/slapd.conf
#
# slapschema -v -n1; echo $?
53ccce80 str2entry: invalid value for attributeType objectClass #0 (syntax 1.3.6.1.4.1.1466.115.121.1.38)
0
# slapschema -v -b "dc=example,dc=com"; echo $?
53ccce8c str2entry: invalid value for attributeType objectClass #0 (syntax 1.3.6.1.4.1.1466.115.121.1.38)
0
#

Comment 4 Jan Synacek 2014-07-21 12:16:25 UTC
Created attachment 919618 [details]
Reproducer

Comment 5 Jan Synacek 2014-07-21 12:24:52 UTC
Reported upstream: http://www.openldap.org/its/index.cgi?findid=7901.

Comment 6 Jan Synacek 2014-07-22 13:12:13 UTC
This is definitely not a blocker, I'm removing the flag.

Comment 9 Jan Synacek 2014-07-23 13:18:53 UTC
Not sure if this is even a bug. Removing Regression so it doesn't block the release.

Comment 10 Jan Synacek 2014-07-24 06:43:32 UTC
Quoting upstream response:

"It's not clear to me that this is a bug. slapschema sends output to stdout, 
not stderr. (And the manpage documents this fact.) Which implies that the 
output it produces is considered to be normal, not error messages. It also 
continues processing, independent of the -c continue option, which also 
implies that it does not consider these situations to be errors.

Leaving this alone for now."

So am I.

Comment 12 Matus Honek 2015-10-13 13:26:44 UTC
Hello Patrik,

as upstream is still mute and does not consider this a bug as for now, do you think it would be possible to change tests according to current behaviour?

Comment 13 Patrik Kis 2015-10-14 13:26:49 UTC
(In reply to Matus Honek from comment #12)
> Hello Patrik,
> 
> as upstream is still mute and does not consider this a bug as for now, do
> you think it would be possible to change tests according to current
> behaviour?

Yes, I think I should do so: it is still not considered as bug so probably it won't be in the future too. Feel free to close this a not a bug.

Comment 14 Matus Honek 2015-10-14 15:43:57 UTC
Thank you Patrik. Closing as NOTABUG. The tests shall be modified according to current behaviour.


Note You need to log in before you can comment on or make changes to this bug.