]> git.sur5r.net Git - openldap/commitdiff
ITS#4218 streamline frontend/overlay access_allowed. Probably need to
authorHoward Chu <hyc@openldap.org>
Sat, 26 Nov 2005 07:53:07 +0000 (07:53 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 26 Nov 2005 07:53:07 +0000 (07:53 +0000)
do the same for acl_group and acl_attribute.

servers/slapd/acl.c
servers/slapd/backover.c

index 423f1c92cdedf04d273cc4ccb303a6ab796dc0d6..48d5eb7f142b1bcecf431d563c3e3bba54be496a 100644 (file)
@@ -310,9 +310,10 @@ 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 = frontendDB;
+               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 );
        op->o_bd = be_orig;
@@ -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 ) {
index 136fb95ff0344e666014cf4529faa477bfeae7f0..b87500ebc2fbb20c085409c11a6cdcc9bb3573e8 100644 (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 );
 
-       oi = op->o_bd->bd_info->bi_private;
+       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 ) {