From: Kurt Zeilenga Date: Tue, 6 Jun 2000 02:11:27 +0000 (+0000) Subject: Complete group ACL impl. under new schema code X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2745 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bf3c642e68267d63d83c8d48889b530dce45b41a;p=openldap Complete group ACL impl. under new schema code --- diff --git a/servers/slapd/back-ldbm/group.c b/servers/slapd/back-ldbm/group.c index c929987191..a6e0523a75 100644 --- a/servers/slapd/back-ldbm/group.c +++ b/servers/slapd/back-ldbm/group.c @@ -40,6 +40,7 @@ ldbm_back_group( Entry *e; int rc = 1; Attribute *attr; + struct berval bv; #ifdef SLAPD_SCHEMA_NOT_COMPAT AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass; @@ -52,7 +53,6 @@ ldbm_back_group( group_oc_name = group_oc->soc_oid; } #else - struct berval bv; const char *ad_objectClass = "objectclass"; const char *group_oc_name = group_oc; const char *group_at_name = group_at; @@ -100,15 +100,54 @@ ldbm_back_group( rc = 1; + +#ifdef SLAPD_SCHEMA_NOT_COMPAT + if( is_entry_alias( e ) ) { + Debug( LDAP_DEBUG_ACL, + "<= ldbm_back_group: group is an alias\n", 0, 0, 0 ); + goto return_results; + } + + if( is_entry_referral( e ) ) { + Debug( LDAP_DEBUG_ACL, + "<= ldbm_back_group: group is an referral\n", 0, 0, 0 ); + goto return_results; + } + + if( is_entry_objectclass( e, group_oc ) ) { + Debug( LDAP_DEBUG_ACL, + "<= ldbm_back_group: failed to find %s in objectClass\n", + group_oc_name, 0, 0 ); + goto return_results; + } + + if ((attr = attr_find(e->e_attrs, group_at)) == NULL) { + Debug( LDAP_DEBUG_ACL, + "<= ldbm_back_group: failed to find %s\n", + group_at_name, 0, 0 ); + goto return_results; + } + + Debug( LDAP_DEBUG_ACL, + "<= ldbm_back_group: found objectClass %s and %s\n", + group_oc_name, group_at_name, 0 ); + + bv.bv_val = (char *) op_ndn; + bv.bv_len = strlen( op_ndn ); + + if( value_find( group_at, attr->a_vals, &bv ) == 0 ) { + Debug( LDAP_DEBUG_ACL, + "<= ldbm_back_group: \"%s\" not in \"%s\": %s\n", + op_ndn, gr_ndn, group_at_name ); + goto return_results; + } + +#else if ((attr = attr_find(e->e_attrs, ad_objectClass)) == NULL) { Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: failed to find objectClass\n", 0, 0, 0 ); goto return_results; } - -#ifdef SLAPD_SCHEMA_NOT_COMPAT - /* not yet implemented */ -#else bv.bv_val = "ALIAS"; bv.bv_len = sizeof("ALIAS")-1; @@ -162,6 +201,7 @@ ldbm_back_group( } #endif + Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: \"%s\" is in \"%s\": %s\n", op_ndn, gr_ndn, group_at_name );