From: Howard Chu Date: Wed, 8 Dec 1999 23:50:59 +0000 (+0000) Subject: Backout fix in r1.38 X-Git-Tag: UCDATA_2_4~121 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6a26e68a027d84b5867a6ead879735f30515210b;p=openldap Backout fix in r1.38 --- diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 2ea5259072..badd2468a6 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -568,7 +568,7 @@ ldap_free_request( LDAP *ld, LDAPRequest *lr ) int ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) { - int rc, count, len, newdn = 0; + int rc, count, len, newdn; #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_DNS int ldapref; #endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_DNS */ @@ -653,16 +653,17 @@ ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) continue; } + /* NOTE! This code treats "ldap://host/" differently + * from "ldap://host". The behavior is wrong, but is + * left here intentionally to maintain compatibility + * with OpenLDAP 1.x and UMich 3.3 clients. + */ *hadrefp = 1; if (( refdn = strchr( tmpref, '/' )) != NULL ) { *refdn++ = '\0'; - if ( *refdn != '\0' ) - { - newdn = 1; - } else - { - refdn = NULL; - } + newdn = 1; + } else { + newdn = 0; } if (( ber = re_encode_request( ld, origreq->lr_ber,