]> git.sur5r.net Git - openldap/commitdiff
ITS#5600 Replace objectClass, delete/add can fail if superior is added.
authorRein Tollevik <rein@openldap.org>
Tue, 8 Jul 2008 13:55:09 +0000 (13:55 +0000)
committerRein Tollevik <rein@openldap.org>
Tue, 8 Jul 2008 13:55:09 +0000 (13:55 +0000)
servers/slapd/syncrepl.c

index a3164aeb36ba6886876d6c0c1f2d97e270f7f694..7c08cb07dfbd3d190aff975031fe988c25c18ed2 100644 (file)
@@ -2883,6 +2883,14 @@ attr_cmp( Operation *op, Attribute *old, Attribute *new,
                        }
                }
 
+               /* Don't delete/add an objectClass, always use the replace op.
+                * Modify would fail if provider has replaced entry with a new,
+                * and the new explicitly includes a superior of a class that was
+                * only included implicitly in the old entry.  Ref ITS#5517.
+                */
+               if ( nn && no < o && old->a_desc == slap_schema.si_ad_objectClass )
+                       no = o;
+
                i = j;
                /* all old values were deleted, just use the replace op */
                if ( no == o ) {