mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
No need to check attribute values when a is NULL
This commit is contained in:
parent
3fb7e5762b
commit
98baa45e6a
@ -73,29 +73,9 @@ modify_add_values(
|
||||
"modify/%s: %s: no equality matching rule",
|
||||
op, mod->sm_desc->ad_cname.bv_val );
|
||||
return LDAP_INAPPROPRIATE_MATCHING;
|
||||
}
|
||||
|
||||
for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
|
||||
/* test asserted values against existing values */
|
||||
for( matched = 0, j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
|
||||
if ( bvmatch( &mod->sm_values[i], &a->a_vals[j] ) ) {
|
||||
if ( permissive ) {
|
||||
matched++;
|
||||
continue;
|
||||
}
|
||||
/* value exists already */
|
||||
*text = textbuf;
|
||||
snprintf( textbuf, textlen,
|
||||
"modify/%s: %s: value #%i already exists",
|
||||
op, mod->sm_desc->ad_cname.bv_val, j );
|
||||
return LDAP_TYPE_OR_VALUE_EXISTS;
|
||||
}
|
||||
}
|
||||
|
||||
if ( permissive && matched == j ) {
|
||||
/* values already exist; do nothing */
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
} else {
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
} else if ( a != NULL ) {
|
||||
|
Loading…
Reference in New Issue
Block a user