From: Rein Tollevik Date: Tue, 8 Jul 2008 13:55:09 +0000 (+0000) Subject: ITS#5600 Replace objectClass, delete/add can fail if superior is added. X-Git-Tag: LOCKER_IDS~60 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a42c7f96f5e024c2ffa51c69c8f050e6f9d5ade9;p=openldap ITS#5600 Replace objectClass, delete/add can fail if superior is added. --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index a3164aeb36..7c08cb07df 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -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 ) {