mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 00:59:45 -05:00
ITS#5419 introduce OpExtra / op->o_extra to supersede op->o_private
This commit is contained in:
parent
0cb9cb04ea
commit
a55123477a
3 changed files with 37 additions and 7 deletions
|
|
@ -1334,6 +1334,11 @@ be_entry_get_rw(
|
|||
return LDAP_UNWILLING_TO_PERFORM;
|
||||
}
|
||||
|
||||
typedef struct fe_extra {
|
||||
OpExtra fe_oe;
|
||||
BackendDB *fe_be;
|
||||
} fe_extra;
|
||||
|
||||
int
|
||||
fe_acl_group(
|
||||
Operation *op,
|
||||
|
|
@ -1586,8 +1591,17 @@ fe_acl_attribute(
|
|||
int freeattr = 0, i, j, rc = LDAP_SUCCESS;
|
||||
AccessControlState acl_state = ACL_STATE_INIT;
|
||||
Backend *be = op->o_bd;
|
||||
fe_extra *fex;
|
||||
|
||||
op->o_bd = select_backend( edn, 0 );
|
||||
for ( fex = (fe_extra *)op->o_extra; fex; fex = (fe_extra *)fex->fe_oe.oe_next ) {
|
||||
if ( fex->fe_oe.oe_key == (void *)frontend_init )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( fex && fex->fe_be )
|
||||
op->o_bd = fex->fe_be;
|
||||
else
|
||||
op->o_bd = select_backend( edn, 0 );
|
||||
|
||||
if ( target && dn_match( &target->e_nname, edn ) ) {
|
||||
e = target;
|
||||
|
|
@ -1706,13 +1720,18 @@ backend_attribute(
|
|||
slap_access_t access )
|
||||
{
|
||||
int rc;
|
||||
BackendDB *be_orig;
|
||||
fe_extra fex;
|
||||
|
||||
fex.fe_be = op->o_bd;
|
||||
fex.fe_oe.oe_key = (void *)frontend_init;
|
||||
fex.fe_oe.oe_next = op->o_extra;
|
||||
op->o_extra = (OpExtra *)&fex;
|
||||
|
||||
be_orig = op->o_bd;
|
||||
op->o_bd = frontendDB;
|
||||
rc = frontendDB->be_attribute( op, target, edn,
|
||||
entry_at, vals, access );
|
||||
op->o_bd = be_orig;
|
||||
op->o_bd = fex.fe_be;
|
||||
slap_op_popextra( op, (OpExtra *)&fex );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,6 +184,19 @@ slap_op_alloc(
|
|||
return( op );
|
||||
}
|
||||
|
||||
void
|
||||
slap_op_popextra( Operation *op, OpExtra *oe )
|
||||
{
|
||||
OpExtra **prev;
|
||||
|
||||
for ( prev = &op->o_extra; *prev; prev = &(*prev)->oe_next ) {
|
||||
if ( *prev == oe ) {
|
||||
*prev = oe->oe_next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
slap_op_t
|
||||
slap_req2op( ber_tag_t tag )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1394,10 +1394,8 @@ LDAP_SLAPD_F (Operation *) slap_op_alloc LDAP_P((
|
|||
BerElement *ber, ber_int_t msgid,
|
||||
ber_tag_t tag, ber_int_t id, void *ctx ));
|
||||
|
||||
LDAP_SLAPD_F (int) slap_op_add LDAP_P(( Operation **olist, Operation *op ));
|
||||
LDAP_SLAPD_F (int) slap_op_remove LDAP_P(( Operation **olist, Operation *op ));
|
||||
LDAP_SLAPD_F (Operation *) slap_op_pop LDAP_P(( Operation **olist ));
|
||||
LDAP_SLAPD_F (slap_op_t) slap_req2op LDAP_P(( ber_tag_t tag ));
|
||||
LDAP_SLAPD_F (void) slap_op_popextra LDAP_P(( Operation *op, OpExtra *oe ));
|
||||
|
||||
/*
|
||||
* operational.c
|
||||
|
|
|
|||
Loading…
Reference in a new issue