]> git.sur5r.net Git - openldap/commitdiff
fix alias deref in case of retry (ITS#5889)
authorPierangelo Masarati <ando@openldap.org>
Wed, 21 Jan 2009 08:55:48 +0000 (08:55 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 21 Jan 2009 08:55:48 +0000 (08:55 +0000)
servers/slapd/back-meta/search.c

index da9fa387ec965150073752bcd8bb57ddfd7d62ea..c90e0e13fc9c7cbe11d00222dc12509d3a490748 100644 (file)
@@ -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 )