]> git.sur5r.net Git - openldap/commitdiff
Fix modrdn, must also rename the directory if it exists.
authorHoward Chu <hyc@openldap.org>
Sun, 24 Dec 2006 00:54:14 +0000 (00:54 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 24 Dec 2006 00:54:14 +0000 (00:54 +0000)
servers/slapd/back-ldif/ldif.c

index 79a4b636f3654411ea259508c3d4a14df5c009a8..9f0469071f22f6a2b7705242b76cb53106144b4b 100644 (file)
@@ -971,6 +971,9 @@ static int move_entry(Entry * entry, struct berval * ndn,
                        if(res != -1) {
                                /* if this fails we should log something bad */
                                res = unlink(path.bv_val);
+                               path.bv_val[path.bv_len - STRLENOF(".ldif")] = '\0';
+                               newpath.bv_val[newpath.bv_len - STRLENOF(".ldif")] = '\0';
+                               res = rename(path.bv_val, newpath.bv_val);
                                res = LDAP_SUCCESS;
                        }
                        else {