From 0ec27a58466e3b107249c2e9e37df1d651e4a5dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Thu, 21 Jan 2021 16:04:53 +0000 Subject: [PATCH] ITS#7766 Include all relevant attributes in diff --- servers/slapd/syncrepl.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 0e64a0f5f0..bdb589612b 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -4479,6 +4479,32 @@ void syncrepl_diff_entry( Operation *op, Attribute *old, Attribute *new, new = new->a_next; old = old->a_next; } + + /* These are all missing from provider */ + while ( old ) { + Modifications *mod = ch_malloc( sizeof( Modifications ) ); + + mod->sml_op = LDAP_MOD_DELETE; + mod->sml_flags = 0; + mod->sml_desc = old->a_desc; + mod->sml_type = mod->sml_desc->ad_cname; + mod->sml_numvals = 0; + mod->sml_values = NULL; + mod->sml_nvalues = NULL; + + *modtail = mod; + modtail = &mod->sml_next; + + old = old->a_next; + } + + /* Newly added attributes */ + while ( new ) { + attr_cmp( op, NULL, new, &modtail, &ml ); + + new = new->a_next; + } + *modtail = *ml; *ml = NULL; } -- 2.47.2