mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-18 04:44:17 -05:00
More for prev commit
This commit is contained in:
parent
a55123477a
commit
bff19c4ac4
2 changed files with 73 additions and 18 deletions
|
|
@ -585,6 +585,7 @@ backend_db_init(
|
|||
}
|
||||
|
||||
be->bd_info = bi;
|
||||
be->bd_orig = be;
|
||||
|
||||
be->be_def_limit = frontendDB->be_def_limit;
|
||||
be->be_dfltaccess = frontendDB->be_dfltaccess;
|
||||
|
|
@ -1354,8 +1355,17 @@ fe_acl_group(
|
|||
int rc;
|
||||
GroupAssertion *g;
|
||||
Backend *be = op->o_bd;
|
||||
fe_extra *fex;
|
||||
|
||||
op->o_bd = select_backend( gr_ndn, 0 );
|
||||
for ( fex = (fe_extra *)op->o_extra; fex; fex = (fe_extra *)fex->fe_oe.oe_next ) {
|
||||
if ( fex->fe_oe.oe_key == (void *)backend_group )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( fex && fex->fe_be )
|
||||
op->o_bd = fex->fe_be;
|
||||
else
|
||||
op->o_bd = select_backend( gr_ndn, 0 );
|
||||
|
||||
for ( g = op->o_groups; g; g = g->ga_next ) {
|
||||
if ( g->ga_be != op->o_bd || g->ga_oc != group_oc ||
|
||||
|
|
@ -1561,17 +1571,27 @@ backend_group(
|
|||
AttributeDescription *group_at )
|
||||
{
|
||||
int rc;
|
||||
BackendDB *be_orig;
|
||||
BackendDB *be_orig;
|
||||
fe_extra fex;
|
||||
|
||||
if ( op->o_abandon ) {
|
||||
return SLAPD_ABANDON;
|
||||
}
|
||||
|
||||
if ( op->o_bd && SLAP_ISOVERLAY( op->o_bd ))
|
||||
fex.fe_be = op->o_bd->bd_orig;
|
||||
else
|
||||
fex.fe_be = op->o_bd;
|
||||
fex.fe_oe.oe_key = (void *)backend_group;
|
||||
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_group( op, target, gr_ndn,
|
||||
op_ndn, group_oc, group_at );
|
||||
op->o_bd = be_orig;
|
||||
slap_op_popextra( op, (OpExtra *)&fex );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1594,7 +1614,7 @@ fe_acl_attribute(
|
|||
fe_extra *fex;
|
||||
|
||||
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 )
|
||||
if ( fex->fe_oe.oe_key == (void *)backend_attribute )
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1720,17 +1740,22 @@ 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;
|
||||
if ( op->o_bd && SLAP_ISOVERLAY( op->o_bd ))
|
||||
fex.fe_be = op->o_bd->bd_orig;
|
||||
else
|
||||
fex.fe_be = op->o_bd;
|
||||
fex.fe_oe.oe_key = (void *)backend_attribute;
|
||||
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 = fex.fe_be;
|
||||
op->o_bd = be_orig;
|
||||
slap_op_popextra( op, (OpExtra *)&fex );
|
||||
|
||||
return rc;
|
||||
|
|
@ -1757,7 +1782,12 @@ backend_access(
|
|||
assert( edn != NULL );
|
||||
assert( access > ACL_NONE );
|
||||
|
||||
op->o_bd = select_backend( edn, 0 );
|
||||
if ( op->o_bd ) {
|
||||
if ( SLAP_ISOVERLAY( op->o_bd ))
|
||||
op->o_bd = op->o_bd->bd_orig;
|
||||
} else {
|
||||
op->o_bd = select_backend( edn, 0 );
|
||||
}
|
||||
|
||||
if ( target && dn_match( &target->e_nname, edn ) ) {
|
||||
e = target;
|
||||
|
|
@ -1850,6 +1880,13 @@ fe_aux_operational(
|
|||
{
|
||||
Attribute **ap;
|
||||
int rc = LDAP_SUCCESS;
|
||||
BackendDB *be_orig = op->o_bd;
|
||||
fe_extra *fex;
|
||||
|
||||
for ( fex = (fe_extra *)op->o_extra; fex; fex = (fe_extra *)fex->fe_oe.oe_next ) {
|
||||
if ( fex->fe_oe.oe_key == (void *)backend_operational )
|
||||
break;
|
||||
}
|
||||
|
||||
for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
|
||||
/* just count them */ ;
|
||||
|
|
@ -1875,19 +1912,19 @@ fe_aux_operational(
|
|||
ap = &(*ap)->a_next;
|
||||
}
|
||||
|
||||
if ( op->o_bd != NULL ) {
|
||||
BackendDB *be_orig = op->o_bd;
|
||||
|
||||
/* Let the overlays have a chance at this */
|
||||
/* Let the overlays have a chance at this */
|
||||
if ( fex && fex->fe_be ) {
|
||||
op->o_bd = fex->fe_be;
|
||||
} else {
|
||||
op->o_bd = select_backend( &op->o_req_ndn, 0 );
|
||||
if ( op->o_bd != NULL && !be_match( op->o_bd, frontendDB ) &&
|
||||
( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
|
||||
op->o_bd->be_operational != NULL )
|
||||
{
|
||||
rc = op->o_bd->be_operational( op, rs );
|
||||
}
|
||||
op->o_bd = be_orig;
|
||||
}
|
||||
if ( op->o_bd != NULL && !be_match( op->o_bd, frontendDB ) &&
|
||||
( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
|
||||
op->o_bd->be_operational != NULL )
|
||||
{
|
||||
rc = op->o_bd->be_operational( op, rs );
|
||||
}
|
||||
op->o_bd = be_orig;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1896,6 +1933,15 @@ int backend_operational( Operation *op, SlapReply *rs )
|
|||
{
|
||||
int rc;
|
||||
BackendDB *be_orig;
|
||||
fe_extra fex;
|
||||
|
||||
if ( op->o_bd && SLAP_ISOVERLAY( op->o_bd ))
|
||||
fex.fe_be = op->o_bd->bd_orig;
|
||||
else
|
||||
fex.fe_be = op->o_bd;
|
||||
fex.fe_oe.oe_key = (void *)backend_operational;
|
||||
fex.fe_oe.oe_next = op->o_extra;
|
||||
op->o_extra = (OpExtra *)&fex;
|
||||
|
||||
/* Moved this into the frontend so global overlays are called */
|
||||
|
||||
|
|
@ -1903,6 +1949,7 @@ int backend_operational( Operation *op, SlapReply *rs )
|
|||
op->o_bd = frontendDB;
|
||||
rc = frontendDB->be_operational( op, rs );
|
||||
op->o_bd = be_orig;
|
||||
slap_op_popextra( op, (OpExtra *)&fex );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1707,6 +1707,7 @@ struct ConfigOCs; /* config.h */
|
|||
|
||||
struct BackendDB {
|
||||
BackendInfo *bd_info; /* pointer to shared backend info */
|
||||
BackendDB *bd_orig; /* pointer to original backend, for overlays */
|
||||
|
||||
/* fields in this structure (and routines acting on this structure)
|
||||
should be renamed from be_ to bd_ */
|
||||
|
|
@ -2466,6 +2467,11 @@ typedef union OpRequest {
|
|||
req_pwdexop_s oq_pwdexop;
|
||||
} OpRequest;
|
||||
|
||||
typedef struct OpExtra {
|
||||
struct OpExtra *oe_next;
|
||||
void *oe_key;
|
||||
} OpExtra;
|
||||
|
||||
struct Operation {
|
||||
Opheader *o_hdr;
|
||||
|
||||
|
|
@ -2657,7 +2663,9 @@ struct Operation {
|
|||
LDAPControl **o_ctrls; /* controls */
|
||||
struct berval o_csn;
|
||||
|
||||
/* DEPRECATE o_private - use o_extra instead */
|
||||
void *o_private; /* anything the backend needs */
|
||||
OpExtra *o_extra; /* anything the backend needs */
|
||||
|
||||
LDAP_STAILQ_ENTRY(Operation) o_next; /* next operation in list */
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue