[Date Prev][Date Next] [Chronological] [Thread] [Top]

hostless ldap URL's broken in ldap_url_search (ITS#1697)



Full_Name: LaMont Jones
Version: 2.0.23
OS: Debian GNU/Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (216.17.176.67)


hostless LDAP URL's (ldap:///...) are searched incorrectly, resulting in
connection
attempts to 127.0.0.1 instead of the current connection.  This is because
ldap_url_search now passes in the parsed LDAPURLDesc, which has lud_host ==
NULL,
rather than passing in a NULL LDAPURLDesc pointer.  The most likely patch to
correct
the problem is in ldap_send_server_request (the patch definitely fixes the
problem,
and I think it's the right place to put it).  Also being tracked (with no more
or les
detail) at http://bugs.debian.org/140387.  Appears to have been introduced
somewhere
between 2.0.14 and 2.0.21, probably fixing hostful LDAP URL's.

diff -ur t/openldap2-2.0.23/libraries/libldap/request.c
openldap2-2.0.23/libraries/libldap/request.c
--- t/openldap2-2.0.23/libraries/libldap/request.c      Fri Jan  4 13:38:21
2002
+++ openldap2-2.0.23/libraries/libldap/request.c        Thu Mar 28 15:55:31
2002
@@ -135,7 +135,7 @@
        ld->ld_errno = LDAP_SUCCESS;    /* optimistic */
 
        if ( lc == NULL ) {
-               if ( srvlist == NULL ) {
+               if ( srvlist == NULL || srvlist->lud_host == NULL ) {
                        lc = ld->ld_defconn;
                } else {
                        if (( lc = find_connection( ld, srvlist, 1 )) ==