]> git.sur5r.net Git - openldap/commitdiff
preserve original o_bd field (global overlays; part of fix to ITS#4336)
authorPierangelo Masarati <ando@openldap.org>
Sat, 14 Jan 2006 16:57:14 +0000 (16:57 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 14 Jan 2006 16:57:14 +0000 (16:57 +0000)
servers/slapd/search.c

index 8604281df6c2a83a080d2775b8d064f07aaaf9ae..9478b19c3eea53e2c76b32ac9734f196cf57d929 100644 (file)
@@ -241,6 +241,7 @@ fe_op_search( Operation *op, SlapReply *rs )
 {
        int                     manageDSAit;
        int                     be_manageDSAit;
+       BackendDB               *bd = op->o_bd;
 
        manageDSAit = get_manageDSAit( op );
 
@@ -328,9 +329,8 @@ fe_op_search( Operation *op, SlapReply *rs )
 
                if (!rs->sr_ref) rs->sr_ref = default_referral;
                rs->sr_err = LDAP_REFERRAL;
-               op->o_bd = frontendDB;
+               op->o_bd = bd;
                send_ldap_result( op, rs );
-               op->o_bd = NULL;
 
                if (rs->sr_ref != default_referral)
                ber_bvarray_free( rs->sr_ref );
@@ -340,6 +340,7 @@ fe_op_search( Operation *op, SlapReply *rs )
 
        /* check restrictions */
        if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
+               op->o_bd = bd;
                send_ldap_result( op, rs );
                goto return_results;
        }
@@ -357,11 +358,13 @@ fe_op_search( Operation *op, SlapReply *rs )
                /* else limits_check() sends error */
 
        } else {
+               op->o_bd = bd;
                send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
                        "operation not supported within namingContext" );
        }
 
 return_results:;
+       op->o_bd = bd;
        return rs->sr_err;
 }