Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 85728 - ldapsearch segfaults with -ZZ (tls option) pam auth ldap fails with TLS on
Summary: ldapsearch segfaults with -ZZ (tls option) pam auth ldap fails with TLS on
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: openldap
Version: 9
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact: Jay Turner
: 107145 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2003-03-06 16:57 UTC by Need Real Name
Modified: 2015-01-08 00:04 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-01-02 18:34:56 UTC

Attachments (Terms of Use)
debug file for redhat-ldapsearch (deleted)
2003-03-06 17:15 UTC, Need Real Name
no flags Details
debug output from source compile - no segfault (deleted)
2003-03-06 17:17 UTC, Need Real Name
no flags Details
ldd output for the two different versions of ldapsearch (deleted)
2003-03-06 17:17 UTC, Need Real Name
no flags Details
backport of 2.1.22 ldap_pvt_check_hostname (deleted)
2003-08-22 08:33 UTC, Neil Dunbar
no flags Details | Diff
strace of login process which segfaults (deleted)
2004-03-10 02:50 UTC, Steven Seed
no flags Details

Description Need Real Name 2003-03-06 16:57:40 UTC
Description of problem:
On a clean Phoebe install any TLS or SSL enabled communication with an LDAP
server (multiple platforms/versions) fails. a straightforward ldapsearch, ie:

  ldapsearch -LLL -x -h ldaphost "(sn=smith)" cn 

succeeds and returns whereas a TLS connection

  ldapsearch -LLL -x -ZZ -h ldaphost "(sn=smith)" cn

segfaults. Authentication using TLS always fails. An ldapsearch from a rebuild
of the srpm always segfaults but a build of the source tarball (openldap-2.1.14)
succeeds - although you have to simlink several kerberos header files from
/usr/kerberos/include into /usr/include/openssl or edit /usr/include/openssl/ssl.h

Version-Release number of selected component (if applicable):

How reproducible:
ldap search with -ZZ option or enable TLS in /etc/ldap.conf 

Steps to Reproduce:
1. ldapsearch -LLL -x -ZZ -h ldaphost "(sn=smith)" cn
2.  thats it
Actual results:
Segmentation fault (trace follows)

Expected results:
dn: cn=jackal,ou=people,dc=dcs,dc=qmul,dc=ac,dc=uk
cn: Alexander Smith
sn: Smith
telephoneNumber:: IA==
dn: cn=rts1,ou=people,dc=dcs,dc=qmul,dc=ac,dc=uk
cn: Richard Smith
sn: Smith
telephoneNumber:: IA==

Additional info:
This is using openssl-(devel)-0.9.7-6

Comment 1 Need Real Name 2003-03-06 17:15:48 UTC
Created attachment 90493 [details]
debug file for redhat-ldapsearch

command line =	ldapsearch -d -1 -LLL -x -ZZ -h vicar \"\(sn=nesmith\)\" cn sn

Comment 2 Need Real Name 2003-03-06 17:17:13 UTC
Created attachment 90494 [details]
debug output from source compile - no segfault

/usr/local/openldap-2.1.14/bin/ldapsearch -d -1 -LLL -x -ZZ -h vicar
\"\(sn=nesmith\)\" cn sn telephoneNumber

Comment 3 Need Real Name 2003-03-06 17:17:52 UTC
Created attachment 90495 [details]
ldd output for the two different versions of ldapsearch

Comment 4 Timo Kokkonen 2003-06-19 14:34:36 UTC
I have observed similar segmentation faults when running ldapsearch against
Novell's LDAP server (using TLS). I am also using RH9 and


It should be noted that ldapsearch works fine in RH7.2 that has same 
version of the openldap package:


Comment 5 John Koyle 2003-07-09 18:45:35 UTC
I'm having the same problem.  ldapsearches from redhat 7.x and 8.0 work fine. 
Only redhat 9 is having trouble.

I've double checked that the cert running on the ldap server matches the host
listed in /etc/ldap.conf.

If I run getent passwd it segfaults when it attempts to contact the ldap server
as well.  

Comment 6 Josh Lothian 2003-07-10 16:24:46 UTC
I have the same problem as well.

It only occurs if in my openssl.cnf, I define:


under the [usr_cert] section before creating my certs.  Without this setting,
all works fine.  However, this is needed to have the certificate validate for
multiple hostnames.

Setting LD_LIBRARY_PATH to point at openldap libraries that I compiled myself
(2.1.21) works fine for programs like ldapsearch.  However, this still doesn't
fix programs like finger that go through the pam_ldap and nss_ldap modules.  The
box is fully up2date'd.

Comment 7 Neil Dunbar 2003-08-22 08:33:25 UTC
Created attachment 93850 [details]
backport of 2.1.22 ldap_pvt_check_hostname

This is a patch that I applied by taking the OL 2.1.22 codebase and backporting
to 2.0.27. It seems to fix the segfaulting when presented with a cert with a

Comment 8 Neil Dunbar 2003-08-22 08:38:47 UTC
I think that the problem stems from changes in the extension handling API within
OpenSSL - so OL probably works if you don't have a DNS subjectAltName extension
in your server cert. Bad news for me - all of HP's directory server certs have
subjectAltNames [and it was my decision to put them there - ack!]. The core
dumps I got were always within ldap_pvt_check_hostname, so I fiddled with the
2.1.22 routine of the same name until it compiled within 2.0.27.

Seems to work OK for me. By the way, I had to recompile nss_ldap after doing
this - for some reason it stopped working until I did a recompile (no changes,
just recompiled from the SRPM).


Comment 9 Ronny Bremer 2003-09-23 13:36:32 UTC
verified with Novell eDirectory 8.7 SP1

if the certificate (created by default btw during server installation) contains
an alternateName, ldapsearch will segfault with -ZZ (RedHat 9, up2date'd fully)

manually recreating the certificate without the alternateName works fine.

-> waiting on RH update :)

Comment 10 Erik Forsberg 2003-10-16 11:58:29 UTC
*** Bug 107145 has been marked as a duplicate of this bug. ***

Comment 11 Jason Heiss 2003-12-15 21:10:20 UTC
This is still broken in RHEL 3.  It has caused us to turn off SSL for
LDAP on all of our boxes, which I really would prefer not to do.  It
also causes Samba to fail when pointed at our LDAP servers unless I
turn off SSL in Samba as well.  Our LDAP servers have subject
alternative name fields in their SSL certificates because they are
behind a load balancer.

Comment 12 Mike Austin 2003-12-18 23:56:43 UTC
Yes, this is a problem for us in RedHat 9 and ReHat EL 3.

We rebuild openldap with the 2.1 patch listed above, and it all works
fine now.

When will this be an official RedHat fix?

Comment 13 Need Real Name 2004-01-07 04:11:22 UTC
Here is brief overview of how I got my system fixed:

Download openldap-2.0.27.tgz from
Save patch file (Additional Comment #7 From Neil Dunbar on 2003-08-22
04:33) to the same directory.

tar zxvf openldap-2.0.27.tgz
patch -p0 < file.patch

cd openldap-2.0.27
export CPPFLAGS="-I/usr/kerberos/include"
./configure --with-tls
make depend

At this point you can test your ldap binaries (including

make install

I also needed to fix LDAP TLS in PHP, so I did the following:

Download the SRPM for your current PHP RPM from a RedHat mirror (I
used php-4.2.2-17.2.src.rpm).

rpmbuild --rebuild php-4.2.2-17.2.src.rpm

A lot will happen here, be patient.

cd /usr/src/redhat/RPMS/<yourarch>

You should see all new PHP RPMS, you really only need to remove the
old ldap one and install the new one instead.

rpm -e php-ldap-4.2.2-17.2
rpm -ivh php-ldap-4.2.2-17.2.<yourarch>.rpm

You can follow a similar process for any other programs that have
SRPMS and available and need openldap fixed.

Comment 14 Need Real Name 2004-01-07 05:43:35 UTC
I created some RPMs for OpenLDAP that have the patch applied to them
on my website ( for
anyone interested.

Comment 15 Bert de Bruijn 2004-02-23 14:51:30 UTC
The rpms from fix the 
ldapsearch segfault for me, but other utilities using nss still 
segfault (finger, chown, id, ...).

System is a fully up2date Red Hat Linux 9.
# chown bob /tmp/aa
Segmentation fault
# finger bob
Segmentation fault
# id bob
Segmentation fault

This works perfectly if /etc/ldap.conf says "ssl no" instead of "ssl 

# chown bob /tmp/aa
# finger bob
Login: bob                          Name: Bert
Directory: /home/bob                Shell: /bin/ksh
Never logged in.
No mail.
No Plan.
# id bob
uid=2011(bob) gid=2011 groups=2011

Comment 16 Steven Seed 2004-03-10 02:50:17 UTC
Created attachment 98416 [details]
strace of login process which segfaults

Comment 17 Steven Seed 2004-03-10 02:52:02 UTC
I also experience the Segmentation fault in login when using ldap with
pam and ssl is enabled. Partial strace of login attached (id=98416)

Comment 18 Levente Farkas 2004-05-11 16:20:42 UTC
After I rebuild openldap-2.1.29-1 from fc2t3 (with db-4.1.25, since
rh9 and rhel3 contains this version) and it doesn't help I rebuild
nss_ldap-217-1 (but with the lastest pam_ldap 169 from and
with db-4.1.25 since openldap was compiled with this version of db)
everything works with start_tls and tls_checkpeer (this second
parameter was the real reason of the crash). the rpms at:

Comment 19 Bill Nottingham 2006-08-05 03:38:16 UTC
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.

Comment 21 Bill Nottingham 2007-01-02 18:34:56 UTC
Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
f you are currently still running Red Hat Linux 7.3 or 9, you are strongly
advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux
or comparable. Some information on which option may be right for you is
available at

Closing as CANTFIX.

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