]> git.sur5r.net Git - openldap/commitdiff
ITS#5809
authorQuanah Gibson-Mount <quanah@openldap.org>
Sat, 15 Nov 2008 00:08:17 +0000 (00:08 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Sat, 15 Nov 2008 00:08:17 +0000 (00:08 +0000)
CHANGES
servers/slapd/syncrepl.c

diff --git a/CHANGES b/CHANGES
index 4bb5f22edbf0fdf1958843d96c38b68d87dd4b1c..dc1187379c9bf58d7d62dd538b0666222f1dc8b8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -28,6 +28,7 @@ OpenLDAP 2.4.13 Engineering
        Added slapd support for certificateListExactMatch (ITS#5700)
        Fixed slapd syncrepl event loss (ITS#5710)
        Fixed slapd syncrepl MOD of attrs with no EQ rule (ITS#5781)
+       Fixed slapd syncrepl rename handling (ITS#5809)
        Fixed slapd syncrepl schema checking (ITS#5798)
        Fixed slapd undef promote (ITS#5783,ITS#5795)
        Added slapd What failed? control (ITS#5784)
index 476cdae5536f2fc4dc37466610a62c47f6765a29..7109d11013ef8700cd50b08ca3c7cdf3c734a3ca 100644 (file)
@@ -2273,7 +2273,7 @@ retry_add:;
                                        "syncrepl_entry: %s be_modrdn (%d)\n", 
                                        si->si_ridtxt, rc, 0 );
                        op->o_bd = be;
-                       goto done;
+                       /* Renamed entries may still have other mods so just fallthru */
                }
                if ( dni.mods ) {
                        op->o_tag = LDAP_REQ_MODIFY;
@@ -3018,15 +3018,25 @@ dn_callback(
                        if ( dni->new_entry ) {
                                Modifications **modtail, **ml;
                                Attribute *old, *new;
+                               struct berval old_rdn, new_rdn;
+                               struct berval old_p, new_p;
                                int is_ctx;
 
                                is_ctx = dn_match( &rs->sr_entry->e_nname,
                                        &op->o_bd->be_nsuffix[0] );
 
                                /* Did the DN change?
+                                * case changes in the parent are ignored,
+                                * we only want to know if the RDN was
+                                * actually changed.
                                 */
-                               if ( !dn_match( &rs->sr_entry->e_name,
-                                               &dni->new_entry->e_name ) )
+                               dnRdn( &rs->sr_entry->e_name, &old_rdn );
+                               dnRdn( &dni->new_entry->e_name, &new_rdn );
+                               dnParent( &rs->sr_entry->e_nname, &old_p );
+                               dnParent( &dni->new_entry->e_nname, &new_p );
+
+                               if ( !dn_match( &old_rdn, &new_rdn ) ||
+                                       ber_bvstrcasecmp( &old_p, &new_p ))
                                {
                                        struct berval oldRDN, oldVal;
                                        AttributeDescription *ad = NULL;
@@ -3049,8 +3059,10 @@ dn_callback(
                                        {
                                                dni->delOldRDN = 1;
                                        }
-                                       /* OK, this was just a modDN, we're done */
-                                       return LDAP_SUCCESS;
+                                       /* A ModDN has happened, but other changes may have
+                                        * occurred before we picked it up. So fallthru to
+                                        * regular Modify processing.
+                                        */
                                }
 
                                modtail = &dni->mods;