Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Depending on the modified values, each basic operation may have some different semantic. The following table present all the possible actions :

modification

initial entry

imported Ldif

resulting entry

Comments

Reverse LDIF

add

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache
ou: acme corp

dn: cn=test, ou=system
changetype: modify
add: ou
ou: BigCompany inc.
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache
ou: acme corp
ou: BigCompany inc.

In this case, the ou value is simply added

dn: cn=test, ou=system
changetype: modify
delete: ou
ou: BigCompany inc.
-

add

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA

dn: cn=test, ou=system
changetype: modify
add: ou
ou: BigCompany inc.
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: BigCompany inc.

The ou attribute and its value has been created

dn: cn=test, ou=system
changetype: modify
delete: ou
ou: BigCompany inc.
-

add

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA

dn: cn=test, ou=system
changetype: modify
add: cn
cn: test
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA

Nothing is done.

no reverse, void operation

delete

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache
ou: acme corp

dn: cn=test, ou=system
changetype: modify
delete: ou
ou: acme corp
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache

The ou=acme corp value has been deleted

dn: cn=test, ou=system
changetype: modify
add: ou
ou: acme corp
-

delete

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache
ou: acme corp

dn: cn=test, ou=system
changetype: modify
delete: ou
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA

The ou attribute has been removed

dn: cn=test, ou=system
changetype: modify
add: ou
ou: apache
ou: acme corp
-

delete

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache
ou: acme corp

dn: cn=test, ou=system
changetype: modify
delete: ou
ou: apache
ou: acme corp
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA

As all the ou values have been removed,
the attribute itself is deleted

dn: cn=test, ou=system
changetype: modify
add: ou
ou: apache
ou: acme corp
-

replace

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache
ou: acme corp

dn: cn=test, ou=system
changetype: modify
replace: ou
ou: directory
ou: BigCompany inc.
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: directory
ou: BigCompany inc.

The ou attributes' values are replaced
by the new values.

dn: cn=test, ou=system
changetype: modify
replace: ou
ou: apache
ou: acme corp
-

replace

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA

dn: cn=test, ou=system
changetype: modify
replace: ou
ou: apache
ou: acme corp
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache
ou: acme corp

Create the ou attribute

dn: cn=test, ou=system
changetype: modify
replace: ou
-

replace

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA
ou: apache
ou: acme corp

dn: cn=test, ou=system
changetype: modify
replace: ou
-

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: joe doe
l: USA

Delete the ou attribute

dn: cn=test, ou=system
changetype: modify
replace: ou
ou: apache
ou: acme corp
-

...

  1. The initial RDN is simple, the target RDN is simple, we don't delete the oldRDN : We just have to remove the newly added AVA if it's not present into the original entry
  2. The initial RDN is simple, the target RDN is simple, we delete the oldRDN : We have to add the old AVA and to remove the newly added AVA if it's not present into the original entry
  3. The initial RDN is composite, the target is simple, they don't overlap, we don't delete the oldRDN : We just have to remove the newly added AVA if it's not present into the original entry
  4. The initial RDN is composite, the target is simple, they don't overlap, we delete the oldRDN : We have to add the original AVAs, and to remove the newly added AVAs if it's not present into the original entry
  5. The initial RDN is composite, the target is simple, they overlap, we don't delete the oldRDN : Nothing special to do
  6. The initial RDN is composite, the target is simple, they overlap, we delete the oldRDN : We have to add the removed AVAs except the one which is in the new RDN
  7. The initial RDN is simple, the target RDN is composite, they don't overlap, we don't delete the oldRDN : We have to remove all the new AVAs
  8. The initial RDN is simple, the target RDN is composite, they don't overlap, we delete the oldRDN : We have to remove all the new AVAs and to add the old AVA
  9. The initial RDN is simple, the target RDN is composite, they overlap, we don't delete the oldRDN : We have to remove all the new AVAs except the one whgich is in the old RDN
  10. The initial RDN is simple, the target RDN is composite, they overlap, we delete the oldRDN : We have to remove all the new AVAs except the one which is in the old RDN
  11. The initial RDN is composite, the target RDN is composite, they don't overlap, we don't delete the oldRDN : We have to remove all the new AVAs which are not present in the original entry
  12. The initial RDN is composite, the target RDN is composite, they don't overlap, we delete the oldRDN : We have to remove all the new AVAs which are not present in the original entry and add all the removed AVAs from the original entry
  13. The initial RDN is composite, the target RDN is composite, they overlap, we don't delete the oldRDN : We have to remove all the new AVAs which are not present in the original entry.
  14. The initial RDN is composite, the target RDN is composite, they overlap, we delete the oldRDN : We have to remove all the new AVAs which are not present in the original entry and add all the removed AVAs from the original entry
    Case 11 and 13 are equivalent, so are case 12 and 14. They need two operations to be applied.

The following table gives an example for each of those cases applied on the two original initial entries :

No Format

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: This is a test  dn: cn=small+cn=test, ou=system
objectclass: top
objectclass: person
cn: testcn: small
sn: This is a test

We also have sub cases, depending in the presence (or not) of the new RDN AVAs into the initial entry. Rge following table expose all the different cases (28), assuming that the two subcases are :

  1. The  initial entry does not contain any of the RDN AVA
  2. The  initial entry contains at least one of the RDN AVA which is not part of the original RDN

case
entry

orginal entry

target RDN

deleteoldrdn

forward ldif

resulting entry

reverse ldif

1.1

dn: cn=test,ou=system
objectclass: top
objectclass: person
cn: test
sn: This is a test

cn=joe

no

dn: cn=test, ou=system
changetype: moddn
newrdn: cn=joe
deleteoldrdn: 0

dn: cn=joe, ou=system
objectclass: top
objectclass: person
cn: test
cn: joe
sn: This is a test

dn: cn=joe, ou=system
changetype: moddn
newrdn: cn=test
deleteoldrdn: 1

1.2

dn: cn=test,ou=system
objectclass: top
objectclass: person
cn: test
cn:small
sn: This is a test

cn=small

no

dn: cn=test, ou=system
changetype: moddn
newrdn: cn=small
deleteoldrdn: 0

dn: cn=small, ou=system
objectclass: top
objectclass: person
cn: test
cn: small sn: This is a test  

dn: cn=small, ou=system
changetype: moddn
newrdn: cn=test
deleteoldrdn: 0

2.1

dn: cn=test,ou=system
objectclass: top
objectclass: person
cn: test
sn: This is a test

cn=joe

yes

dn: cn=test, ou=system
changetype: moddn
newrdn: cn=joe
deleteoldrdn: 1

dn: cn=joe, ou=system
objectclass: top
objectclass: person
cn: joe
sn: This is a test

dn: cn=joe, ou=system
changetype: moddn
newrdn: cn=test
deleteoldrdn: 1

2.2

dn: cn=test,ou=system
objectclass: top
objectclass: person
cn: test
cn:small
sn: This is a test

cn=joe

yes

dn: cn=test, ou=system
changetype: moddn
newrdn: cn=joe
deleteoldrdn: 1

dn: cn=joe, ou=system
objectclass: top
objectclass: person
cn: joe
cn: small
sn: This is a test

dn: cn=joe, ou=system
changetype: moddn
newrdn: cn=test
deleteoldrdn: 1 

3

cn=small+cn=test

cn=joe

no

dn: cn=small+cn=test, ou=system
changetype: moddn
newrdn: cn=joe
deleteoldrdn: 0

dn: cn=joe, ou=system
objectclass: top
objectclass: person
cn: test
cn: small
cn: joe
sn: This is a test

dn: cn=joe, ou=system
changetype: moddn
deleteoldrdn: 1
newrdn: cn=small+cn=test

 

 

 

 

 

 

 

4

cn=small+cn=test

cn=joe

yes

dn: cn=small+cn=test, ou=system
changetype: moddn
newrdn: cn=joe
deleteoldrdn: 1

dn: cn=joe, ou=system
objectclass: top
objectclass: person
cn: joe
sn: This is a test

dn: cn=joe, ou=system
changetype: moddn
deleteoldrdn: 1
newrdn: cn=small+cn=test

 

 

 

 

 

 

 

5

cn=small+cn=test

cn=test

no

dn: cn=small+cn=test, ou=system
changetype: moddn
newrdn: cn=test
deleteoldrdn: 0

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
cn: small
sn: This is a test

dn: cn=test, ou=system
changetype: moddn
deleteoldrdn: 0
newrdn: cn=small+cn=test

 

 

 

 

 

 

 

6

cn=small+cn=test

cn=test

yes

dn: cn=small+cn=test, ou=system
changetype: moddn
newrdn: cn=test
deleteoldrdn: 1

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
sn: This is a test

dn: cn=test, ou=system
changetype: moddn
deleteoldrdn: 0
newrdn: cn=small+cn=test

 

 

 

 

 

 

 

7

cn=test

cn=joe+cn=plumber

no

dn: cn=test, ou=system
changetype: moddn
newrdn: cn=joe+cn=plumber
deleteoldrdn: 0

dn: cn=joe+cn=plumber, ou=system
objectclass: top
objectclass: person
cn: test
cn: joe

cn: plumber

sn: This is a test

dn: cn=joe+cn=plumber, ou=system
changetype:  moddn
deleteoldrdn: 1
newrdn: cn=test

 

 

 

 

 

 

 

8

case

orginal RDN

target RDN

deleteoldrdn

forward ldif

resulting entry

reverse ldif

1

cn=test

cn=joe+cn=plumber

no yes

dn: cn=test, ou=system
changetype: moddn
newrdn: cn=joe+cn=plumber
deleteoldrdn: 1

dn: cn=joe+cn=plumber, ou=system
objectclass: top
objectclass: person
cn: test joe

cn: joeplumber

sn: This is a test

dn: cn=joe+cn=plumber, ou=system
changetype:  moddn
newrdn deleteoldrdn: 1newrdn: cn=test 
deleteoldrdn: 1

 

 

 

 

 

 

 

9 2

cn=test

cn=joe
small+cn=test

no yes

dn: cn=test, ou=system
changetype: moddn
newrdn: cn=joe small+cn=test
deleteoldrdn: 0

dn: cn=small+cn=joetest, ou=system
objectclass: top
objectclass: person
cn: small

cn: joetest

sn: This is a test  test  

dn: cn=joesmall+cn=test, ou=system
changetype: moddn newrdn: cn=test 
deleteoldrdn: 1 

deleteoldrdn: 1
newrdn: test

 

 

 

 

 

 

 

10

cn=test 3

cn=small+cn=test cn=joe

yes

no

dn: cn=small+ cn=test, ou=system
changetype: moddn
newrdn: cn=joe deleteoldrdn: 0  dn: small+cn=joe, ou=system
objectclass: top
objectclass: person
cn: test
cn: small
cn: joe
sn: This is a test

dn: cn=joe, ou=system
changetype: moddn
deleteoldrdn: 1
newrdn: cn=small+cn=test 

test
deleteoldrdn: 1

 

 

 

 

 

 

 

 

 

11 4

cn=small+cn=test

cn=joe+cn=plumber

yes no

dn: cn=small+cn=test, ou=system
changetype: moddn
newrdn: cn=joe deleteoldrdn: 1

dn: cn=joe, ou=system
objectclass: top
objectclass: personcn: joe
sn: This is a test

+cn=plumber
deleteoldrdn: 0

 

 

 

 

 

 

 

 

 

12

cn=small+cn=test

cn=joe+cn=plumber

yes

dn: cn=small+cn=test dn: cn=joe, ou=system
changetype: moddn
deleteoldrdn: 1
newrdn: cn=smalljoe+cn=test  plumber
deleteoldrdn: 1

 

 

 

 

 

 

 

 

 

13 5

cn=small+cn=test

cn=big+cn=test

no

dn: cn=small+cn=test, ou=system
changetype: moddn
newrdn: cn=big+cn=test
deleteoldrdn: 0

dn: cn=test, ou=system
objectclass: top
objectclass: person
cn: test
cn: smallsn: This is a test

dn: cn=test, ou=system
changetyp: moddn
deleteoldrdn: 0
newrdn: cn=small+cn=test

 

 

 

 

 

 

 

 

 

14 6

cn=small+cn=test

cn=big+cn=test

yes

dn: cn=small+cn=test, ou=system
changetype: moddn
newrdn: cn=test deleteoldrdn: 1
dn: big+cn=test , ou=system
objectclass deleteoldrdn: top 1 objectclass: person
cn: test sn: This is a test dn: cn=test, ou=system
changetyp: moddn
deleteoldrdn: 0
newrdn: cn=small+cn=test

 

 

 

 

 

 

 

 

 

Computing the reverse LDIF for a ModifyDN request follows the algorithm :

...