]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9295 Do not replace 'op'
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 30 Sep 2020 18:31:40 +0000 (19:31 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 30 Sep 2020 21:55:05 +0000 (21:55 +0000)
servers/slapd/syncrepl.c

index 7e8a172825a67bdf99ac91502fb02365bc009d55..9f2d57c9d5625a78c0fa4991c94a751b58ddbfbe 100644 (file)
@@ -1956,8 +1956,6 @@ syncrepl_accesslog_mods(
 
                if ( !mod || ad != mod->sml_desc || op != mod->sml_op ) {
                        mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
-                       if ( op == LDAP_MOD_ADD && is_at_single_value( ad->ad_type ))
-                               op = LDAP_MOD_REPLACE;
                        mod->sml_flags = 0;
                        mod->sml_op = op;
                        mod->sml_next = NULL;
@@ -1967,6 +1965,10 @@ syncrepl_accesslog_mods(
                        mod->sml_nvalues = NULL;
                        mod->sml_numvals = 0;
 
+                       /* Keep 'op' to reflect what we read out from accesslog */
+                       if ( op == LDAP_MOD_ADD && is_at_single_value( ad->ad_type ))
+                               mod->sml_op = LDAP_MOD_REPLACE;
+
                        *modtail = mod;
                        modtail = &mod->sml_next;
                }