ITS#4218 streamline frontend/overlay access_allowed. Probably need to

do the same for acl_group and acl_attribute.
This commit is contained in:
Howard Chu 2005-11-26 07:53:07 +00:00
parent 48cb85865d
commit b831ebba7d
2 changed files with 11 additions and 8 deletions

View File

@ -310,8 +310,9 @@ fe_access_allowed(
*/
be_orig = op->o_bd;
op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
if ( op->o_bd == NULL ) {
op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
if ( op->o_bd == NULL )
op->o_bd = frontendDB;
}
rc = slap_access_allowed( op, e, desc, val, access, state, maskp );
@ -423,14 +424,10 @@ access_allowed_mask(
desc, val, access, state, &mask );
} else {
BackendDB *be_orig = op->o_bd;
/* use default (but pass through frontend
* for global ACL overlays) */
op->o_bd = frontendDB;
ret = frontendDB->bd_info->bi_access_allowed( op, e,
desc, val, access, state, &mask );
op->o_bd = be_orig;
}
if ( !ret ) {

View File

@ -252,7 +252,7 @@ over_access_allowed(
{
slap_overinfo *oi;
slap_overinst *on;
BackendInfo *bi = op->o_bd->bd_info;
BackendInfo *bi;
BackendDB *be = op->o_bd, db;
int rc = SLAP_CB_CONTINUE;
@ -260,7 +260,13 @@ over_access_allowed(
* when global overlays are used... */
assert( op->o_bd != NULL );
bi = op->o_bd->bd_info;
/* Were we invoked on the frontend? */
if ( !bi->bi_access_allowed ) {
oi = frontendDB->bd_info->bi_private;
} else {
oi = op->o_bd->bd_info->bi_private;
}
on = oi->oi_list;
for ( ; on; on = on->on_next ) {