[Date Prev][Date Next] [Chronological] [Thread] [Top]

ldap_rename (aka _modrdn) moves nodes having children and leaves children orphaned (ITS#1053)



Full_Name: Enrik Berkhan
Version: 2.0.7 and curren CVS
OS: Linux
URL: 
Submission from: (NULL) (212.227.19.14)


Assume the following minimal database:

---snip---
dn: o=test
objectClass: organization
o: test
description: Testserver

# foo, test
dn: cn=foo,o=test
objectClass: extensibleObject
cn: foo

# Enrik Berkhan, foo, test
dn: cn=Enrik Berkhan,cn=foo,o=test
objectclass: extensibleObject
cn: Enrik Berkhan
---snap---
After ldap_rename(ld, "cn=foo,o=test", "cn=bar", "", TRUE), the database looks
like:

---snip---
dn: o=test
objectClass: organization
o: test
description: Testserver

# bar, test
dn: cn=bar,o=test
objectClass: extensibleObject
cn: bar

# Enrik Berkhan, foo, test
dn: cn=Enrik Berkhan,cn=foo,o=test
objectclass: extensibleObject
cn: Enrik Berkhan
---snap---

The last entry is now orphaned?!?

ldap_rename should not allow to rename non-leaf entries or update the children
recursively (which can be somewhat expensive with indexes and deep trees).

Further, at least the ldbm-backend modrdn does not handle multi-valued RDNs
like "cn=Enrik Berkhan + mail=enrik@planb.de" correctly. The source code even
doesn't know anything of them.