From 6c6e187b98f459ff7819c92d656540b27103ba4c Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 27 Jul 2010 00:55:51 +0000 Subject: [PATCH] do not alter ld_nextref_proc (ITS#6602) --- libraries/libldap/request.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 287ce47109..183e0d76af 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -1044,6 +1044,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * LDAPConn *lc; int rc, count, i, j, id; LDAPreqinfo rinfo; + LDAP_NEXTREF_PROC *nextref_proc = ld->ld_nextref_proc ? ld->ld_nextref_proc : ldap_int_nextref; ld->ld_errno = LDAP_SUCCESS; /* optimistic */ *hadrefp = 0; @@ -1079,15 +1080,12 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * refarray = refs; refs = NULL; - if ( ld->ld_nextref_proc == NULL ) { - ld->ld_nextref_proc = ldap_int_nextref; - } - /* parse out & follow referrals */ + /* NOTE: if nextref_proc == ldap_int_nextref, params is ignored */ i = -1; - for ( ld->ld_nextref_proc( ld, &refarray, &i, ld->ld_nextref_params ); + for ( nextref_proc( ld, &refarray, &i, ld->ld_nextref_params ); i != -1; - ld->ld_nextref_proc( ld, &refarray, &i, ld->ld_nextref_params ) ) + nextref_proc( ld, &refarray, &i, ld->ld_nextref_params ) ) { /* Parse the referral URL */ -- 2.39.5