]> git.sur5r.net Git - openldap/commitdiff
New backend routine: back_attribute
authorMark Valence <mrv@openldap.org>
Wed, 21 Jun 2000 17:23:24 +0000 (17:23 +0000)
committerMark Valence <mrv@openldap.org>
Wed, 21 Jun 2000 17:23:24 +0000 (17:23 +0000)
servers/slapd/back-ldbm/external.h
servers/slapd/back-ldbm/init.c
servers/slapd/backend.c
servers/slapd/proto-slap.h
servers/slapd/slap.h

index b8c2a8d5fb7cd08fe1f74a2b727a612ff18bb65e..9c2944fefab56ad93bf2e034cc9f4e41698182cb 100644 (file)
@@ -80,6 +80,13 @@ extern int   ldbm_back_group LDAP_P(( BackendDB *bd,
        ObjectClass* group_oc,
        AttributeDescription* group_at));
 
+extern int     ldbm_back_attribute LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op,
+       Entry *target,
+       const char* e_ndn,
+       AttributeDescription* entry_at,
+       const char ***vals));
+
 
 /* hooks for slap tools */
 extern int ldbm_tool_entry_open LDAP_P(( BackendDB *be, int mode ));
index 6fb070b8b5a78f95c0496c46fc8e3267beb5d604..aff7a076b154c1af21453bafaff5bdd540c41b62 100644 (file)
@@ -67,6 +67,7 @@ ldbm_back_initialize(
 
        bi->bi_entry_release_rw = ldbm_back_entry_release_rw;
        bi->bi_acl_group = ldbm_back_group;
+       bi->bi_acl_attribute = ldbm_back_attribute;
        bi->bi_chk_referrals = ldbm_back_referrals;
 
        /*
index e6f5f7606fe7a7057e62c2a0f4ab65037058c363..02bfac50ccf6fa7570367eca8a995125adf769e5 100644 (file)
@@ -667,6 +667,35 @@ backend_group(
        return LDAP_UNWILLING_TO_PERFORM;
 }
 
+int 
+backend_attribute(
+       Backend *be,
+       Connection *conn,
+       Operation *op,
+       Entry   *target,
+       const char      *e_ndn,
+       AttributeDescription *entry_at,
+       const char ***vals
+)
+{
+       if( target == NULL || strcmp( target->e_ndn, e_ndn ) != 0 ) {
+               /* we won't attempt to send it to a different backend */
+               
+               be = select_backend(e_ndn);
+
+               if (be == NULL) {
+                       return LDAP_NO_SUCH_OBJECT;
+               }
+       } 
+
+       if( be->be_attribute ) {
+               return be->be_attribute( be, conn, op, target, e_ndn,
+                       entry_at, vals );
+       }
+
+       return LDAP_UNWILLING_TO_PERFORM;
+}
+
 Attribute *backend_operational(
        Backend *be,
        Entry *e )
index 354afa6f2f817f9e709b726b4dbb2a8ad44d1ba0..8524add4b1ba006cbe0f0a44239c2b1b9a51d492 100644 (file)
@@ -173,6 +173,15 @@ LDAP_SLAPD_F (int) backend_group LDAP_P((Backend *be,
        AttributeDescription *group_at
 ));
 
+LDAP_SLAPD_F (int) backend_attribute LDAP_P((Backend *be,
+       Connection *conn,
+       Operation *op,
+       Entry *target,
+       const char *e_ndn,
+       AttributeDescription *entry_at,
+       const char ***vals
+));
+
 LDAP_SLAPD_F (Attribute *) backend_operational( Backend *, Entry * );
 
 
index 0b4171126f2097ec248b73939e6bdab811791eac..f70ee5c756a87f76f69a5c4280839fc2ff95c5ba 100644 (file)
@@ -757,6 +757,7 @@ struct slap_backend_db {
 #define                be_release      bd_info->bi_entry_release_rw
 #define                be_chk_referrals        bd_info->bi_chk_referrals
 #define                be_group        bd_info->bi_acl_group
+#define                be_attribute    bd_info->bi_acl_attribute
 
 #define                be_controls     bd_info->bi_controls
 
@@ -929,6 +930,11 @@ struct slap_backend_info {
                Entry *e, const char *bdn, const char *edn,
                ObjectClass *group_oc,
                AttributeDescription *group_at ));
+       int     (*bi_acl_attribute)  LDAP_P((Backend *bd,
+               struct slap_conn *c, struct slap_op *o,
+               Entry *e, const char *edn,
+               AttributeDescription *entry_at,
+               const char ***vals ));
 
        int     (*bi_connection_init) LDAP_P((BackendDB *bd,
                struct slap_conn *c));