*/
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;
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;
}
#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
/* 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,
} 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;
struct oindexrec {
- struct berval oir_name;
+ struct berval oir_name;
ObjectClass *oir_oc;
};
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;
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;
}
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;