From 20024d5ba8b6bc5aec602075877e9e99a7cf2c5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Wed, 30 Sep 2020 19:25:56 +0100 Subject: [PATCH] ITS#9359 Do not create an empty add --- servers/slapd/syncrepl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 2920d46d80..ab5251adda 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2438,7 +2438,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; -- 2.47.3