From: Pierangelo Masarati Date: Wed, 21 Jan 2009 08:55:48 +0000 (+0000) Subject: fix alias deref in case of retry (ITS#5889) X-Git-Tag: ACLCHECK_0~978 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=549455c6c6f30b09229e7839e578c723ad15bc8c;p=openldap fix alias deref in case of retry (ITS#5889) --- diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index da9fa387ec..c90e0e13fc 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -583,13 +583,6 @@ meta_back_search_start( goto done; } - /* should we check return values? */ - if ( op->ors_deref != -1 ) { - assert( msc->msc_ld != NULL ); - (void)ldap_set_option( msc->msc_ld, LDAP_OPT_DEREF, - ( void * )&op->ors_deref ); - } - if ( op->ors_tlimit != SLAP_NO_LIMIT ) { tv.tv_sec = op->ors_tlimit > 0 ? op->ors_tlimit : 1; tv.tv_usec = 0; @@ -597,6 +590,13 @@ meta_back_search_start( } retry:; + /* should we check return values? */ + if ( op->ors_deref != -1 ) { + assert( msc->msc_ld != NULL ); + (void)ldap_set_option( msc->msc_ld, LDAP_OPT_DEREF, + ( void * )&op->ors_deref ); + } + ctrls = op->o_ctrls; if ( meta_back_controls_add( op, rs, *mcp, candidate, &ctrls ) != LDAP_SUCCESS )