From 49207930cfb0776899bdce04cb235824fcaaf46e Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 11 Aug 1999 19:05:40 +0000 Subject: [PATCH] Modify replace_values not to merge in new values when no value is was provided. --- servers/slapd/back-bdb2/modify.c | 4 +++- servers/slapd/back-ldbm/modify.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb2/modify.c b/servers/slapd/back-bdb2/modify.c index 8da3a396ae..ef263e7ed6 100644 --- a/servers/slapd/back-bdb2/modify.c +++ b/servers/slapd/back-bdb2/modify.c @@ -314,7 +314,9 @@ bdb2i_replace_values( { (void) attr_delete( &e->e_attrs, mod->mod_type ); - if ( attr_merge( e, mod->mod_type, mod->mod_bvalues ) != 0 ) { + if ( mod->bvalues != NULL && + attr_merge( e, mod->mod_type, mod->mod_bvalues ) != 0 ) + { return( LDAP_CONSTRAINT_VIOLATION ); } diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 41197e0513..6f58b94767 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -346,7 +346,9 @@ replace_values( { (void) attr_delete( &e->e_attrs, mod->mod_type ); - if ( attr_merge( e, mod->mod_type, mod->mod_bvalues ) != 0 ) { + if ( mod->mod_bvalues != NULL && + attr_merge( e, mod->mod_type, mod->mod_bvalues ) != 0 ) + { return( LDAP_CONSTRAINT_VIOLATION ); } -- 2.39.5