]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10250 Simplify attr_cmp calling convention
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 16 Dec 2025 12:06:49 +0000 (12:06 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 3 Feb 2026 16:49:45 +0000 (16:49 +0000)
We no longer need the kludge to touch up modifiersName/modifyTimestamp
(ITS#4820) since the mod is being passed to the backend with
orm_no_opattrs these days.

servers/slapd/syncrepl.c

index 0c065af89c7304a65eb73f1660e06c0e5e4c57ba..486f96e0e06ad3200244606d0d344b3eeff78a76 100644 (file)
@@ -5653,6 +5653,10 @@ attr_cmp( Operation *op, Attribute *old, Attribute *new,
 
        modtail = *mret;
 
+       if ( old && (old->a_flags & SLAP_ATTR_SORTED_VALS) ) {
+               return sorted_attr_cmp( op, old, new, mret, mcur );
+       }
+
        if ( old ) {
                int n, o, nn, no;
                struct berval **adds, **dels;
@@ -5856,18 +5860,7 @@ void syncrepl_diff_entry( Operation *op, Attribute *old, Attribute *new,
                        old = old->a_next;
                        continue;
                }
-               /* kludge - always update modifiersName so that it
-                * stays co-located with the other mod opattrs. But only
-                * if we know there are other valid mods.
-                */
-               if ( *mods && ( old->a_desc == slap_schema.si_ad_modifiersName ||
-                       old->a_desc == slap_schema.si_ad_modifyTimestamp )) {
-                       attr_cmp( op, NULL, new, &modtail, &ml );
-               } else if ( old->a_flags & SLAP_ATTR_SORTED_VALS ) {
-                       sorted_attr_cmp( op, old, new, &modtail, &ml );
-               } else {
-                       attr_cmp( op, old, new, &modtail, &ml );
-               }
+               attr_cmp( op, old, new, &modtail, &ml );
 
                new = new->a_next;
                old = old->a_next;