From: Ondřej Kuzník Date: Wed, 30 Sep 2020 18:25:56 +0000 (+0100) Subject: ITS#9359 Do not create an empty add X-Git-Tag: OPENLDAP_REL_ENG_2_4_54~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78aef769c06fb3aa389991ee3cbb4903604aafb3;p=thirdparty%2Fopenldap.git ITS#9359 Do not create an empty add --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 88af1011aa..7e8a172825 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2011,7 +2011,10 @@ static Modifications *mods_dup( Operation *op, Modifications *modlist, int match modlist->sml_desc == slap_schema.si_ad_modifyTimestamp || modlist->sml_desc == slap_schema.si_ad_entryCSN ) continue; - if ( modlist->sml_op == LDAP_MOD_REPLACE ) { + if ( modlist->sml_values == NULL && modlist->sml_op == LDAP_MOD_REPLACE ) { + /* ITS#9359 This adds no values, just change to a delete op */ + modlist->sml_op = LDAP_MOD_DELETE; + } else if ( modlist->sml_op == LDAP_MOD_REPLACE ) { mod = op->o_tmpalloc( sizeof(Modifications), op->o_tmpmemctx ); mod->sml_desc = modlist->sml_desc; mod->sml_values = NULL;