]> git.sur5r.net Git - openldap/commitdiff
Code cleanup (no functional changes)
authorKurt Zeilenga <kurt@openldap.org>
Tue, 1 Oct 2002 04:07:55 +0000 (04:07 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 1 Oct 2002 04:07:55 +0000 (04:07 +0000)
servers/slapd/acl.c
servers/slapd/back-bdb/group.c

index 3db4fd14e7a8ef160146691494275374ffdffc9e..281d96e66a588e538f91fa1b8dc81bcf5af149c0 100644 (file)
@@ -919,7 +919,6 @@ dn_match_cleanup:;
                }
 
                if ( b->a_group_pat.bv_len ) {
-                       char buf[ACL_BUF_SIZE];
                        struct berval bv;
                        struct berval ndn = { 0, NULL };
                        int rc;
@@ -928,29 +927,33 @@ dn_match_cleanup:;
                                continue;
                        }
 
-                       bv.bv_len = sizeof(buf) - 1;
-                       bv.bv_val = buf; 
-
                        /* b->a_group is an unexpanded entry name, expanded it should be an 
                         * entry with objectclass group* and we test to see if odn is one of
                         * the values in the attribute group
                         */
                        /* see if asker is listed in dnattr */
                        if ( b->a_group_style == ACL_STYLE_REGEX ) {
-                               string_expand(&bv, &b->a_group_pat, e->e_ndn, matches);
-                               if ( dnNormalize2(NULL, &bv, &ndn) != LDAP_SUCCESS ) {
+                               char buf[ACL_BUF_SIZE];
+                               bv.bv_len = sizeof(buf) - 1;
+                               bv.bv_val = buf; 
+
+                               string_expand( &bv, &b->a_group_pat, e->e_ndn, matches );
+                               if ( dnNormalize2( NULL, &bv, &ndn ) != LDAP_SUCCESS ) {
                                        /* did not expand to a valid dn */
                                        continue;
                                }
+
                                bv = ndn;
+
                        } else {
                                bv = b->a_group_pat;
                        }
 
-                       rc = backend_group(be, conn, op, e, &bv, &op->o_ndn,
-                               b->a_group_oc, b->a_group_at);
-                       if ( ndn.bv_val )
-                               free( ndn.bv_val );
+                       rc = backend_group( be, conn, op, e, &bv, &op->o_ndn,
+                               b->a_group_oc, b->a_group_at );
+
+                       if ( ndn.bv_val ) free( ndn.bv_val );
+
                        if ( rc != 0 ) {
                                continue;
                        }
@@ -1674,7 +1677,8 @@ aci_group_member (
                bv.bv_val = (char *)&buf;
                string_expand(&bv, &subjdn, e->e_ndn, matches);
                if ( dnNormalize2(NULL, &bv, &ndn) == LDAP_SUCCESS ) {
-                       rc = (backend_group(be, conn, op, e, &ndn, &op->o_ndn, grp_oc, grp_ad) == 0);
+                       rc = (backend_group(be, conn, op, e, &ndn, &op->o_ndn,
+                               grp_oc, grp_ad) == 0);
                        free( ndn.bv_val );
                }
        }
index 20b768bbdb8c366af44cc8b773bcb89c4d071b1b..ad9b979b5b6e84498f5377514c29fb6d31a9e137 100644 (file)
@@ -30,8 +30,7 @@ bdb_group(
        struct berval   *gr_ndn,
        struct berval   *op_ndn,
        ObjectClass *group_oc,
-       AttributeDescription *group_at
-)
+       AttributeDescription *group_at )
 {
        struct bdb_info *bdb = (struct bdb_info *) be->be_private;
        struct bdb_op_info *boi = NULL;
@@ -58,18 +57,19 @@ bdb_group(
                op_ndn->bv_val, gr_ndn->bv_val, group_oc_name );
 #else
        Debug( LDAP_DEBUG_ARGS,
-               "=> bdb_group: gr dn: \"%s\"\n",
+               "=> bdb_group: group ndn: \"%s\"\n",
                gr_ndn->bv_val, 0, 0 ); 
 
        Debug( LDAP_DEBUG_ARGS,
-               "=> bdb_group: op dn: \"%s\"\n",
+               "=> bdb_group: op ndn: \"%s\"\n",
                op_ndn->bv_val, 0, 0 ); 
+
        Debug( LDAP_DEBUG_ARGS,
                "=> bdb_group: oc: \"%s\" at: \"%s\"\n", 
                group_oc_name, group_at_name, 0 ); 
 
        Debug( LDAP_DEBUG_ARGS,
-               "=> bdb_group: tr dn: \"%s\"\n",
+               "=> bdb_group: tr ndn: \"%s\"\n",
                target->e_ndn, 0, 0 ); 
 #endif