Issue 3250 - libldap/result.c changes for ITS #2982, not quite right
Summary: libldap/result.c changes for ITS #2982, not quite right
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-20 23:58 UTC by arlene.berry@css-security.com
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description arlene.berry@css-security.com 2004-07-20 23:58:39 UTC
Full_Name: Arlene Berry
Version: 2.2.13, 2.1.29, 2.1.30
OS: RedHat 9
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (64.221.115.99)


I'm trying to use PADL's nss_ldap on RedHat 9 and Windows 2003 Active Directory
with SFU 3.5 for the LDAP server.  The problem is that when chasing referrals,
which nss_ldap does, things hang for five minutes.  I reproduced the problem
with ldapsearch using the -C option.  I tracked the problem down to the the
changes made to libldap/result.c between versions 2.1.28 and 2.1.29 of OpenLDAP
(ITS #2982).  The problem is this code around line 305:

                   for ( lc = ld->ld_conns; lc != NULL; lc = nextlc ) {
                           nextlc = lc->lconn_next;
                           if ( ber_sockbuf_ctrl( lc->lconn_sb,
                                           LBER_SB_OPT_DATA_READY, NULL ) ) {
                                   rc = try_read1msg( ld, msgid, all,
lc->lconn_sb,
                                           &lc, result );
                               break;
                           }
                }

                if ( lc == NULL ) {
                       rc = ldap_int_select( ld, tvp );
                ...

When I turned on debugging I saw newer versions going into ldap_int_select()
which older versions do not.  The reason is that in the newer versions
try_read1msg() may set lc to NULL which it didn't prior to this change.  The
result is it now enters the if statement which it didn't previously.  I restored
the old behavior by doing the following:

                   int lc_found = 0;
                   ...
                   for ( lc = ld->ld_conns; lc != NULL; lc = nextlc ) {
                           nextlc = lc->lconn_next;
                           if ( ber_sockbuf_ctrl( lc->lconn_sb,
                                           LBER_SB_OPT_DATA_READY, NULL ) ) {
                                   rc = try_read1msg( ld, msgid, all,
lc->lconn_sb,
                                           &lc, result );
                               lc_found = 1;
                               break;
                           }
                }

                if ( !lc_found ) {
                       rc = ldap_int_select( ld, tvp );
                ...

This fixed the five minute hang.  

Comment 1 Howard Chu 2004-07-24 01:14:55 UTC
changed notes
moved from Incoming to Software Bugs
Comment 2 Howard Chu 2004-07-24 01:16:48 UTC
Thanks, I've patched this in CVS HEAD. Please test.
Comment 3 ando@openldap.org 2004-07-24 12:33:36 UTC
changed state Open to Test
Comment 4 arlene.berry@css-security.com 2004-07-26 18:44:05 UTC
 
Works for me.

Comment 5 Kurt Zeilenga 2004-09-03 20:09:37 UTC
changed notes
changed state Test to Release
Comment 6 Kurt Zeilenga 2004-09-09 21:05:00 UTC
changed state Release to Closed
Comment 7 Howard Chu 2004-10-06 23:05:21 UTC
changed notes
Comment 8 Howard Chu 2009-02-17 05:06:49 UTC
moved from Software Bugs to Archive.Software Bugs
Comment 9 OpenLDAP project 2014-08-01 21:06:32 UTC
fixed in HEAD/re22
same as #3192