]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backover.c
Tweak online_index task interval
[openldap] / servers / slapd / backover.c
index 1994ba7ff8891d573d9f8948ae614d5e9d76d9e8..ddcc0233c14cb2c247507e973d82bef1a21269e9 100644 (file)
@@ -261,6 +261,7 @@ over_access_allowed(
 {
        slap_overinfo *oi;
        slap_overinst *on;
+       BackendInfo *bi = op->o_bd->bd_info;
        BackendDB *be = op->o_bd, db;
        int rc = SLAP_CB_CONTINUE;
 
@@ -287,20 +288,22 @@ over_access_allowed(
                }
        }
 
-       if ( rc == SLAP_CB_CONTINUE && oi->oi_orig->bi_access_allowed ) {
-               /* NOTE: do not copy the structure until requiredy */
-               /* NOTE: by default, oi->oi_orig->bi_access_allowed == NULL;
-                * only backends that implement a specific hook
-                * should store it there; by default, slap_access_allowed()
-                * is invoked if oi->oi_orig->bi_access_allowed == NULL */
-               if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
-                       db = *op->o_bd;
-                       db.be_flags |= SLAP_DBFLAG_OVERLAY;
-                       op->o_bd = &db;
+       if ( rc == SLAP_CB_CONTINUE ) {
+               BI_access_allowed       *bi_access_allowed;
+
+               /* if the database structure was changed, o_bd points to a
+                * copy of the structure; put the original bd_info in place */
+               if ( SLAP_ISOVERLAY( op->o_bd ) ) {
+                       op->o_bd->bd_info = oi->oi_orig;
                }
 
-               op->o_bd->bd_info = oi->oi_orig;
-               rc = oi->oi_orig->bi_access_allowed( op, e,
+               if ( oi->oi_orig->bi_access_allowed ) {
+                       bi_access_allowed = oi->oi_orig->bi_access_allowed;
+               } else {
+                       bi_access_allowed = slap_access_allowed;
+               }
+
+               rc = bi_access_allowed( op, e,
                        desc, val, access, state, maskp );
        }
        /* should not fall thru this far without anything happening... */
@@ -310,6 +313,8 @@ over_access_allowed(
        }
 
        op->o_bd = be;
+       op->o_bd->bd_info = bi;
+
        return rc;
 }
 #endif /* SLAP_OVERLAY_ACCESS */