From: Pierangelo Masarati Date: Sat, 14 Jan 2006 16:57:14 +0000 (+0000) Subject: preserve original o_bd field (global overlays; part of fix to ITS#4336) X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~312 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=31578ca4310437364895dd040203191bda02cf79;p=openldap preserve original o_bd field (global overlays; part of fix to ITS#4336) --- diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 8604281df6..9478b19c3e 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -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; }