...
This request is used to move entries or to rename entries or to move and rename entries. Its counterpart in a ldif file is a 'changetype: moddn' or a 'changetype: modrdn' operation (moddn or modrdn are synonymous).
There are four five cases :
- we change the RDN, we don't change the superior and we don't delete the old RDN
- we change the RDN, we don't change the superior and we delete the old RDN
- we change the RDN, we change the superior and we don't delete the old RDN
- we change the RDN, we change the superior and we delete the old RDN
- we don't change the RDN, we change the superior (this is a Move operation)
The following table gives an example for each of those cases applied on the initial entry :
...
case | deleteoldrdn | new superior | modifying ldif | resulting entry | reverse ldif |
1 | no | none | dn: cn=test, dc=example, dc=com | dn: cn=joe, dc=example, dc=com | dn: cn=joe, dc=example, dc=com |
2 | yes | none | dn: cn=test, dc=example, dc=com | dn: cn=joe, dc=example, dc=com | dn: cn=joe, dc=example, dc=com |
3 | no | ou=system | dn: cn=test, dc=example, dc=org | dn: cn=joe, ou=system | dn: cn=joe, ou=system |
4 | yes | ou=system | dn: cn=test, dc=example, dc=org | dn: cn=joe, ou=system | dn: cn=joe, ou=system |
5 | no | ou=system | dn: cn=test, dc=example, dc=org | dn: cn=test, ou=system | dn: cn=test, ou=system |
Computing the reverse LDIF for a ModifyDN request follows the algorithm :
if the newRdn is different from the existing EDN
then reverseLdif.deleteOldRdn = true
else reverseLdif.deleteOldRdn = false
if modifyDn.newSuperior not empty
then reverseLdif.newSuperior = modifyDn.dn minus the modifyDN.dn.getRDN
reverseLdif.newRdn = modifyDn.dn.getRDN