int manageDSAit;
Modifications **modtail = &op->ora_modlist;
int rc = 0;
- BackendDB *op_be;
+ BackendDB *op_be, *bd = op->o_bd;
char textbuf[ SLAP_TEXT_BUFLEN ];
size_t textlen = sizeof( textbuf );
*/
op->o_bd = select_backend( &op->ora_e->e_nname, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
+ op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->ora_e->e_name, LDAP_SCOPE_DEFAULT );
if ( !rs->sr_ref ) rs->sr_ref = default_referral;
if ( rs->sr_ref ) {
rs->sr_err = LDAP_REFERRAL;
- op->o_bd = frontendDB;
send_ldap_result( op, rs );
- op->o_bd = NULL;
if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref );
}
} else {
- op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
- op->o_bd = NULL;
}
goto done;
}
#endif /* SLAPD_MULTIMASTER */
}
} else {
- Debug( LDAP_DEBUG_ARGS, " do_add: no backend support\n", 0, 0, 0 );
- send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
+ Debug( LDAP_DEBUG_ARGS, "do_add: no backend support\n", 0, 0, 0 );
+ send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"operation not supported within namingContext" );
}
done:;
+ op->o_bd = bd;
return rc;
}
fe_op_bind( Operation *op, SlapReply *rs )
{
struct berval mech = op->orb_tmp_mech;
+ BackendDB *bd = op->o_bd;
/* check for inappropriate controls */
if( get_manageDSAit( op ) == SLAP_CONTROL_CRITICAL ) {
/* don't return referral for bind requests */
/* noSuchObject is not allowed to be returned by bind */
rs->sr_err = LDAP_INVALID_CREDENTIALS;
- op->o_bd = frontendDB;
+ op->o_bd = bd;
send_ldap_result( op, rs );
- op->o_bd = NULL;
goto cleanup;
}
}
cleanup:;
+ op->o_bd = bd;
return rs->sr_err;
}
int
fe_op_compare( Operation *op, SlapReply *rs )
{
- Entry *entry = NULL;
- int manageDSAit;
- AttributeAssertion ava = *op->orc_ava;
+ Entry *entry = NULL;
+ int manageDSAit;
+ AttributeAssertion ava = *op->orc_ava;
+ BackendDB *bd = op->o_bd;
if( strcasecmp( op->o_req_ndn.bv_val, LDAP_ROOT_DSE ) == 0 ) {
Debug( LDAP_DEBUG_ARGS,
rs->sr_err = LDAP_REFERRAL;
if (!rs->sr_ref) rs->sr_ref = default_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 );
rs->sr_err = 0;
}
cleanup:;
+ op->o_bd = bd;
return rs->sr_err;
}
{
struct berval pdn = BER_BVNULL;
int manageDSAit;
- BackendDB *op_be;
+ BackendDB *op_be, *bd = op->o_bd;
manageDSAit = get_manageDSAit( op );
*/
op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
+ op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
if (!rs->sr_ref) rs->sr_ref = default_referral;
if ( rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL;
-
- op->o_bd = frontendDB;
send_ldap_result( op, rs );
- op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else {
- op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
- op->o_bd = NULL;
}
goto cleanup;
}
}
cleanup:;
+ op->o_bd = bd;
return rs->sr_err;
}
Modifications *tmp;
#endif
int manageDSAit;
- BackendDB *op_be;
+ BackendDB *op_be, *bd = op->o_bd;
char textbuf[ SLAP_TEXT_BUFLEN ];
size_t textlen = sizeof( textbuf );
*/
op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
+ op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
if ( !rs->sr_ref ) {
if ( rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL;
- op->o_bd = frontendDB;
send_ldap_result( op, rs );
- op->o_bd = NULL;
if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref );
}
} else {
- op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
- op->o_bd = NULL;
}
goto cleanup;
}
}
cleanup:;
+ op->o_bd = bd;
return rs->sr_err;
}
Backend *newSuperior_be = NULL;
int manageDSAit;
struct berval pdn = BER_BVNULL;
- BackendDB *op_be;
+ BackendDB *op_be, *bd = op->o_bd;
if( op->o_req_ndn.bv_len == 0 ) {
Debug( LDAP_DEBUG_ANY, "do_modrdn: root dse!\n", 0, 0, 0 );
*/
op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
+ op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
if (!rs->sr_ref) rs->sr_ref = default_referral;
if ( rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL;
- op->o_bd = frontendDB;
send_ldap_result( op, rs );
- op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else {
- op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
- op->o_bd = NULL;
}
goto cleanup;
}
}
cleanup:;
+ op->o_bd = bd;
return rs->sr_err;
}