From: Kurt Zeilenga Date: Sun, 16 Mar 2003 18:10:16 +0000 (+0000) Subject: SLAP_NVALUES changes X-Git-Tag: NO_SLAP_OP_BLOCKS~103 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=88730061051a3e2cc98935eaa788973d9c58e8f9;p=openldap SLAP_NVALUES changes and misc cleanup --- diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 02bf54eeae..3d0c1e0566 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -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; } diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index bca36de6fa..21aeb3e899 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -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 diff --git a/servers/slapd/mods.c b/servers/slapd/mods.c index 73aac72e39..cedc658c20 100644 --- a/servers/slapd/mods.c +++ b/servers/slapd/mods.c @@ -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; diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index 9159a8ed70..578590e2cf 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -119,7 +119,7 @@ int is_entry_objectclass( struct oindexrec { - struct berval oir_name; + struct berval oir_name; ObjectClass *oir_oc; }; diff --git a/servers/slapd/operational.c b/servers/slapd/operational.c index a32a32fd9a..3517fbe868 100644 --- a/servers/slapd/operational.c +++ b/servers/slapd/operational.c @@ -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; diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 518db4ec92..5fee9f72f4 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -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;