mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
ITS#2533 remember which backend fetched the entry
This commit is contained in:
parent
ade6b8b750
commit
ca4892d5e7
@ -1126,13 +1126,10 @@ be_entry_get_rw(
|
||||
int rw,
|
||||
Entry **e )
|
||||
{
|
||||
Backend *be = op->o_bd;
|
||||
int rc;
|
||||
|
||||
*e = NULL;
|
||||
|
||||
op->o_bd = select_backend( ndn, 0, 0 );
|
||||
|
||||
if (op->o_bd == NULL) {
|
||||
rc = LDAP_NO_SUCH_OBJECT;
|
||||
} else if ( op->o_bd->be_fetch ) {
|
||||
@ -1141,7 +1138,6 @@ be_entry_get_rw(
|
||||
} else {
|
||||
rc = LDAP_UNWILLING_TO_PERFORM;
|
||||
}
|
||||
op->o_bd = be;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -1159,9 +1155,12 @@ backend_group(
|
||||
Attribute *a;
|
||||
int rc;
|
||||
GroupAssertion *g;
|
||||
Backend *be = op->o_bd;
|
||||
|
||||
if ( op->o_abandon ) return SLAPD_ABANDON;
|
||||
|
||||
op->o_bd = select_backend( gr_ndn, 0, 0 );
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
|
||||
|
||||
for (g = op->o_conn->c_groups; g; g=g->ga_next) {
|
||||
@ -1175,7 +1174,8 @@ backend_group(
|
||||
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
|
||||
|
||||
if (g) {
|
||||
return g->ga_res;
|
||||
rc = g->ga_res;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ( target && dn_match( &target->e_nname, gr_ndn ) ) {
|
||||
@ -1213,7 +1213,8 @@ backend_group(
|
||||
op->o_conn->c_groups = g;
|
||||
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
|
||||
}
|
||||
|
||||
done:
|
||||
op->o_bd = be;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -1230,12 +1231,14 @@ backend_attribute(
|
||||
Attribute *a;
|
||||
int i, j, rc = LDAP_SUCCESS;
|
||||
AccessControlState acl_state = ACL_STATE_INIT;
|
||||
Backend *be = op->o_bd;
|
||||
|
||||
op->o_bd = select_backend( edn, 0, 0 );
|
||||
|
||||
if ( target && dn_match( &target->e_nname, edn ) ) {
|
||||
e = target;
|
||||
} else {
|
||||
rc = be_entry_get_rw(op, edn, NULL, entry_at, 0, &e );
|
||||
if ( rc != LDAP_SUCCESS ) return rc;
|
||||
}
|
||||
|
||||
if ( e ) {
|
||||
@ -1280,6 +1283,7 @@ freeit: if (e != target ) {
|
||||
}
|
||||
}
|
||||
|
||||
op->o_bd = be;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user