From: Howard Chu Date: Wed, 8 Dec 1999 21:37:55 +0000 (+0000) Subject: Fix ldap_chase_referrals to treat "ldap://host/" referrals the same as X-Git-Tag: UCDATA_2_4~123 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3c5848a71eae0e01fdf4e8e3ec2b37831315ce02;p=openldap Fix ldap_chase_referrals to treat "ldap://host/" referrals the same as "ldap://host". --- diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index c017a57eef..2ea5259072 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; + int rc, count, len, newdn = 0; #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_DNS int ldapref; #endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_DNS */ @@ -656,9 +656,13 @@ ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) *hadrefp = 1; if (( refdn = strchr( tmpref, '/' )) != NULL ) { *refdn++ = '\0'; - newdn = 1; - } else { - newdn = 0; + if ( *refdn != '\0' ) + { + newdn = 1; + } else + { + refdn = NULL; + } } if (( ber = re_encode_request( ld, origreq->lr_ber,