
Chapter 2. Creating Directory Entries
30
The
modrdn
change type only changes teh RDN; it cannot change other parts of a DN. For
example, the entry
cn=Sue Jacobs,ou=People,dc=example,dc=com
can be changed to
cn=Susan Jacobs,ou=People,dc=example,dc=coma
, but it cannot be modified to be
cn=Sue
Jacobs,ou=old employees,dc=example,dc=com
.
The following command renames Sue Jacobs to Susan Jacobs:
dn: cn=Sue Jacobs,ou=Marketing,dc=example,dc=com
changetype: modrdn
newrdn: cn=Susan Jacobs
deleteoldrdn: 0
Because
deleteoldrdn
is
0
, this example retains the existing RDN as a value in the new entry. The
resulting entry would therefore have a common name (
cn
) attribute set to both Sue Jacobs and Susan
Jacobs, in addition to all the other attributes included in the original entry. However, using the following
command causes the server to delete
cn=Sue Jacobs
, so that only
cn=Susan Jacobs
remains in
the entry:
dn: cn=Sue Jacobs,ou=Marketing,dc=example,dc=com
changetype: modrdn
newrdn: cn=Susan Jacobs
deleteoldrdn: 1
2.4.2.1. A Note on Renaming Entries
The
modrdn
change type cannot move an entry to a completely different subtree. To move an entry
to a completely different branch, you must create a new entry in the alternative subtree using the old
entry's attributes, and then delete the old entry.
Also, for the same reasons that you cannot delete an entry if it is a branch point, you cannot rename
an entry if it has any children. Doing so would orphan the children in the tree, which is not allowed
by the LDAP protocol. For example, of the following three entries, only the last two entries can be
renamed:
ou=People,dc=example,dc=com
cn=Paula Simon,ou=People,dc=example,dc=com
cn=Jerry O'Connor,ou=People,dc=example,dc=com
The entry that identifies the
People
subtree can be renamed only if no other entries exist below it.
2.4.3. Modifying an Entry Using LDIF
changetype: modify
can add, replace, or remove attributes or attribute values in an entry. When
you specify
changetype: modify
, you must also provide a change operation to indicate how the
entry is to be modified. Change operations can be as follows:
•
add:
attribute
Adds the specified attribute or attribute value. If the attribute type does not currently exist for
the entry, then the attribute and its corresponding value are created. If the attribute type already
exists for the entry, then the specified attribute value is added to the existing value. If the particular
attribute value already exists for the entry, then the operation fails, and the server returns an error.
•
replace:
attribute
Содержание DIRECTORY SERVER 8.0
Страница 18: ...xviii ...
Страница 29: ...Configuring the Directory Manager 11 6 Enter the new password and confirm it 7 Click Save ...
Страница 30: ...12 ...
Страница 112: ...94 ...
Страница 128: ...110 ...
Страница 190: ...Chapter 6 Managing Access Control 172 4 Click New to open the Access Control Editor ...
Страница 224: ...206 ...
Страница 324: ...306 ...
Страница 334: ...316 ...
Страница 358: ...340 ...
Страница 410: ...392 ...
Страница 420: ...402 ...
Страница 444: ...426 ...
Страница 454: ...436 ...
Страница 464: ...446 ...
Страница 484: ...466 ...
Страница 512: ...494 ...
Страница 522: ...504 ...