From: Kurt Zeilenga Date: Thu, 8 Apr 2004 21:45:49 +0000 (+0000) Subject: Another bug. X-Git-Tag: OPENLDAP_REL_ENG_2_2_BP~70 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0ec962a08b4007b41c43ed4f77c6aa75049cf49b;p=openldap Another bug. --- diff --git a/servers/slapd/mods.c b/servers/slapd/mods.c index fc540aa7f8..f4c84b4a2e 100644 --- a/servers/slapd/mods.c +++ b/servers/slapd/mods.c @@ -74,7 +74,7 @@ modify_add_values( * server (whether from LDAP or from the underlying * database). */ - for ( i=0; mod->sm_values[i].bv_val != NULL; i++ ) { + for ( i=0; mod->sm_values[i].bv_val; i++ ) { for ( j=0; a->a_vals[j].bv_val; j++ ) { int match; if( mod->sm_nvalues ) { @@ -89,7 +89,8 @@ modify_add_values( &a->a_vals[j], &mod->sm_values[i], text ); } - if( rc != LDAP_SUCCESS ) { + if( rc == LDAP_SUCCESS && match == 0 ) { + /* value already exists */ *text = textbuf; snprintf( textbuf, textlen, "modify/%s: %s: value #%d already exists",