mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-13 14:27:59 +08:00
SLAP_NVALUES changes
and misc cleanup
This commit is contained in:
parent
d18e0989d9
commit
8873006105
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -119,7 +119,7 @@ int is_entry_objectclass(
|
||||
|
||||
|
||||
struct oindexrec {
|
||||
struct berval oir_name;
|
||||
struct berval oir_name;
|
||||
ObjectClass *oir_oc;
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user