From: Howard Chu Date: Sun, 24 Dec 2006 00:54:14 +0000 (+0000) Subject: Fix modrdn, must also rename the directory if it exists. X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~324 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fcc51c04976b5bc5551a350ada7f3f435e3dacd4;p=openldap Fix modrdn, must also rename the directory if it exists. --- 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 {