]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backglue.c
ITS#6437, move structs slab_object and slab_heap from slap.h to sl_malloc.c
[openldap] / servers / slapd / backglue.c
index bd85aae44a256119daf15a6a6815fe31fa7e9c47..31afe2fff471ccf3320df8ef012a0e3d2e52e916 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2001-2010 The OpenLDAP Foundation.
+ * Copyright 2001-2011 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -419,9 +419,10 @@ glue_op_search ( Operation *op, SlapReply *rs )
                if ( op->o_bd == b0 )
                        return SLAP_CB_CONTINUE;
 
-               rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
                if (op->o_bd && op->o_bd->be_search) {
                        rs->sr_err = op->o_bd->be_search( op, rs );
+               } else {
+                       rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
                }
                return rs->sr_err;
 
@@ -1472,6 +1473,29 @@ glue_sub_add( BackendDB *be, int advert, int online )
        return rc;
 }
 
+static int
+glue_access_allowed(
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp )
+{
+       BackendDB *b0, *be = glue_back_select( op->o_bd, &e->e_nname );
+       int rc;
+
+       if ( be == NULL || be == op->o_bd || be->bd_info->bi_access_allowed == NULL )
+               return SLAP_CB_CONTINUE;
+
+       b0 = op->o_bd;
+       op->o_bd = be;
+       rc = be->bd_info->bi_access_allowed ( op, e, desc, val, access, state, maskp );
+       op->o_bd = b0;
+       return rc;
+}
+
 int
 glue_sub_init()
 {
@@ -1492,6 +1516,7 @@ glue_sub_init()
        glue.on_bi.bi_chk_controls = glue_chk_controls;
        glue.on_bi.bi_entry_get_rw = glue_entry_get_rw;
        glue.on_bi.bi_entry_release_rw = glue_entry_release_rw;
+       glue.on_bi.bi_access_allowed = glue_access_allowed;
 
        glue.on_response = glue_response;