]> git.sur5r.net Git - openldap/commitdiff
SLAP_NVALUES changes
authorKurt Zeilenga <kurt@openldap.org>
Sun, 16 Mar 2003 18:10:16 +0000 (18:10 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 16 Mar 2003 18:10:16 +0000 (18:10 +0000)
and misc cleanup

servers/slapd/acl.c
servers/slapd/compare.c
servers/slapd/mods.c
servers/slapd/oc.c
servers/slapd/operational.c
servers/slapd/sasl.c

index 02bf54eeae1db4da9bc8e5a18f4d67c42c627b81..3d0c1e05663d6f09b3f91a3f32ecd9278d86f44b 100644 (file)
@@ -1123,7 +1123,12 @@ dn_match_cleanup:;
                         */
                        for ( i = 0; at->a_vals[i].bv_val != NULL; i++ ) {
                                if (aci_mask( be, conn, op,
-                                       e, desc, val, &at->a_vals[i],
+                                       e, desc, val,
+#ifdef SLAP_NVALUES
+                                       at->a_vals ? &at->a_nvals[i] : &at->a_vals[i],
+#else
+                                       &at->a_vals[i],
+#endif
                                        matches, &grant, &deny ) != 0)
                                {
                                        tgrant |= grant;
@@ -1849,7 +1854,17 @@ aci_mask(
                        at != NULL;
                        at = attrs_find( at->a_next, ad ) )
                {
-                       if (value_find_ex( ad, SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH, at->a_vals, &bv) == 0 ) {
+                       if (value_find_ex( ad,
+#ifdef SLAP_NVALUES
+                               SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
+                                       SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
+                               at->a_nvals ? at->a_nvals : at->a_vals,
+#else
+                               SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
+                               at->a_vals,
+#endif
+                               &bv) == 0 )
+                       {
                                rc = 1;
                                break;
                        }
index bca36de6faacf06c6e609b333fecd34aa80020b9..21aeb3e899802e4eb439b4df232a81440ae0dd7d 100644 (file)
@@ -356,7 +356,8 @@ static int compare_entry(
 
 #ifdef SLAP_NVALUES
                if ( value_find_ex( ava->aa_desc,
-                       SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
+                       SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
+                               SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
                        a->a_nvals ? a->a_nvals : a->a_vals,
                        &ava->aa_value ) == 0 )
 #else
index 73aac72e39a97d8280c08299878b2ff76f8c0149..cedc658c2023eed54db9d92ef30660ca45cda6f3 100644 (file)
@@ -360,9 +360,7 @@ modify_add_values(
 
                        /* test asserted values against themselves */
                        for( j = 0; j < i; j++ ) {
-                               if ( bvmatch( &mod->sm_bvalues[i],
-                                       &mod->sm_bvalues[j] ) ) {
-
+                               if ( bvmatch( &mod->sm_bvalues[i], &mod->sm_bvalues[j] ) ) {
                                        /* value exists already */
                                        *text = textbuf;
                                        snprintf( textbuf, textlen,
@@ -484,8 +482,7 @@ modify_add_values(
                } else {
                        rc = modify_check_duplicates( mod->sm_desc, mr,
                                        a ? a->a_vals : NULL, mod->sm_bvalues,
-                                       permissive,
-                                       text, textbuf, textlen );
+                                       permissive, text, textbuf, textlen );
 
                        if ( permissive && rc == LDAP_TYPE_OR_VALUE_EXISTS ) {
                                return LDAP_SUCCESS;
index 9159a8ed705a6b4b614dbeacb7f1317f9364e286..578590e2cf3544ceac3482173612421a0d6b32b7 100644 (file)
@@ -119,7 +119,7 @@ int is_entry_objectclass(
 
 
 struct oindexrec {
-       struct berval   oir_name;
+       struct berval oir_name;
        ObjectClass     *oir_oc;
 };
 
index a32a32fd9a764656ef8bf2744c9f0fe436cbdba0..3517fbe86826cc0299443da57c3a918e3ece570e 100644 (file)
@@ -18,8 +18,7 @@ slap_operational_subschemaSubentry( Backend *be )
        Attribute       *a;
 
        /* The backend wants to take care of it */
-       if ( be && be->be_schemadn.bv_val )
-               return NULL;
+       if ( be && be->be_schemadn.bv_val ) return NULL;
 
        a = ch_malloc( sizeof( Attribute ) );
        a->a_desc = slap_schema.si_ad_subschemaSubentry;
@@ -30,7 +29,10 @@ slap_operational_subschemaSubentry( Backend *be )
        a->a_vals[1].bv_val = NULL;
 
 #ifdef SLAP_NVALUES
-       a->a_nvals = NULL;
+       a->a_nvals = ch_malloc( 2 * sizeof( struct berval ) );
+       ber_dupbv( a->a_nvals, &global_schemandn );
+       a->a_nvals[1].bv_len = 0;
+       a->a_nvals[1].bv_val = NULL;
 #endif
 
        a->a_next = NULL;
index 518db4ec92b08b6362daedab1ade8d101d323956..5fee9f72f447aaefaebbf4de0f78c755169f0ea3 100644 (file)
@@ -349,13 +349,16 @@ sasl_ap_lookup(
                }
                a = attr_find( e->e_attrs, ad );
                if ( !a ) continue;
-               if ( ! access_allowed( be, conn, op, e, ad, NULL, ACL_AUTH, NULL ) )
+               if ( ! access_allowed( be, conn, op, e, ad, NULL, ACL_AUTH, NULL ) ) {
                        continue;
-               if ( sl->list[i].values && ( sl->flags & SASL_AUXPROP_OVERRIDE ) )
-                       sl->sparams->utils->prop_erase( sl->sparams->propctx, sl->list[i].name );
+               }
+               if ( sl->list[i].values && ( sl->flags & SASL_AUXPROP_OVERRIDE ) ) {
+                       sl->sparams->utils->prop_erase( sl->sparams->propctx,
+                       sl->list[i].name );
+               }
                for ( bv = a->a_vals; bv->bv_val; bv++ ) {
-                       sl->sparams->utils->prop_set( sl->sparams->propctx, sl->list[i].name,
-                               bv->bv_val, bv->bv_len );
+                       sl->sparams->utils->prop_set( sl->sparams->propctx,
+                               sl->list[i].name, bv->bv_val, bv->bv_len );
                }
        }
        return LDAP_SUCCESS;