Bug 562714 - openldap init script does not handle listen uris properly
Summary: openldap init script does not handle listen uris properly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: openldap
Version: 5.5
Hardware: All
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: Jan Zeleny
QA Contact: Ondrej Moriš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-08 06:01 UTC by Ian Kent
Modified: 2012-10-15 08:52 UTC (History)
8 users (show)

Fixed In Version: openldap-2.3.43-10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:05:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Openldap init script patch to fix parameter passing to daemon() function (413 bytes, patch)
2010-02-08 06:01 UTC, Ian Kent
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2010:0198 0 normal SHIPPED_LIVE Moderate: openldap security and bug fix update 2010-03-29 13:22:42 UTC

Description Ian Kent 2010-02-08 06:01:57 UTC
Created attachment 389463 [details]
Openldap init script patch to fix parameter passing to daemon() function

Description of problem:

The RHEL-5.5 openldap init script does not handle multiple
listen uris correctly. If the openldap configuration requires
the salpd daemon to listen on more that one uri, such as
ldap:/// and ldaps:/// the deamon does not listen for connections
on the second uri.

Testing indicated this is a problem with the quoting of parameters
passed to the daemon() function.

Comment 5 Petr Sklenar 2010-02-09 08:22:53 UTC
*** Bug 562846 has been marked as a duplicate of this bug. ***

Comment 6 Ondrej Moriš 2010-02-24 23:22:45 UTC
Well, after some testing I'm pretty sure that this is not really a bug. I've tried openldap-2.3.43-3.el5 and everything works perfectly (-h "ldap:/// ldaps:///"). I see no problem in function daemon() in init script at all. slapd is invoked correctly with quotes around $harg variable. See the relevant part of the script:

harg="ldap:///"
if grep -q ^TLS /etc/openldap/slapd.conf || test x$SLAPD_LDAPS = xyes ; then
  harg="$harg ldaps:///"
fi
if test x$SLAPD_LDAPI = xyes ; then
  harg="$harg ldapi:///"
fi
...
cat >> $wrapper <<- EOF
exec ${slapd} -h "$harg" -u ${user} $OPTIONS $SLAPD_OPTIONS
EOF
...

So slapd is executed via wrapper in order to avoid some problems (including quotes):

# Build a wrapper script to exec slapd with the right arguments, to
# avoid being tripped out by changes or weirdness in how daemon()
# handles quoted arguments.

What version of openldap has been used?

Comment 7 Ian Kent 2010-02-25 02:55:11 UTC
The problem was originally seen when running RHTS autofs tests that
use ldaps://.. in the ldap.conf. I checked out a lab machine and saw
that openldap wasn't listening for ldaps requests and the manual
change in comment #1 above resolved it.

The version of openldap was 2.3.43-9.el5 (RHEL5.5-Server-20100201.0)
and the init script wasn't like what you have quoted above.

AFAICT 2.3.43-3.el5 is the openldap version from RHRL-5.4 which we
know works fine from the QA testing for RHEL-5.4. Why are you using
that version when this bug is logged against RHEL-5.5?

Comment 8 Jan Zeleny 2010-02-25 07:46:11 UTC
Ondrej, you tried an old openldap. This wrapper thing has been removed (see https://bugzilla.redhat.com/show_bug.cgi?id=483356), that's when this bug appeared.

Comment 9 Ondrej Moriš 2010-02-25 08:59:04 UTC
Well, that's interesting... so it's a regression. Okay I have a RHTS test prepared, so let's it run again :-). 

Thank you both for your help!

Comment 10 Ondrej Moriš 2010-02-25 11:31:27 UTC
RHTS test proposed. See QA Whiteboard.

Successfully reproduced and verified via RHTS.

* RHEL5.5-Server-20100202.0 (i386, x86_64, ppc, s390x, ia64)
* RHEL5.5-Client-20100202.0 (i386, x86_64)

Comment 11 Ondrej Moriš 2010-02-25 11:43:58 UTC
RHTS test proposed. See QA Whiteboard.

Successfully reproduced and verified via RHTS.

* RHEL5.5-Server-20100202.0 (i386, x86_64, ppc, s390x, ia64)
* RHEL5.5-Client-20100202.0 (i386, x86_64)

:: [   LOG    ] :: Installed:    : openldap-2.3.43-9.el5.x86_64
:: [   LOG    ] :: Installed:    : openldap-2.3.43-9.el5.i386
:: [   PASS   ] :: Running 'verify_openssl_client'
:: [   PASS   ] :: Running 'ldapsearch -H ldap://127.0.0.1 -x -D ... -w x -d1'
:: [   FAIL   ] :: Running 'ldapsearch -H ldaps://127.0.0.1 -x -D ... -w x -d1' 
:: [   FAIL   ] :: RESULT: Test

... and ...

:: [   LOG    ] :: Installed:    : openldap-2.3.43-12.el5.x86_64
:: [   LOG    ] :: Installed:    : openldap-2.3.43-12.el5.i386
:: [   PASS   ] :: Running 'verify_openssl_client'
:: [   PASS   ] :: Running 'ldapsearch -H ldap://127.0.0.1 -x -D ... -w x -d1'
:: [   PASS   ] :: Running 'ldapsearch -H ldaps://127.0.0.1 -x -D ... -w x -d1'
:: [   PASS   ] :: RESULT: Test

Comment 13 errata-xmlrpc 2010-03-30 08:05:53 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0198.html


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