From fcc51c04976b5bc5551a350ada7f3f435e3dacd4 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 24 Dec 2006 00:54:14 +0000 Subject: [PATCH] Fix modrdn, must also rename the directory if it exists. --- servers/slapd/back-ldif/ldif.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 79a4b636f3..9f0469071f 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -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 { -- 2.39.5