
Troubleshooting LDIF Files 31
The following is an example of a modify change type that will add an additional telephone number
to the
cn=Peter
Michaels entry.
1 version: 1
2 dn: cn=Peter Michaels, ou=Artists, l=San Francisco, c=US
3 changetype: modify
4 # add the telephone number to cn=Peter Michaels
4 add: telephonenumber
5 telephonenumber: +1 415 555 0002
6
Just as you can combine a mixture of modifications in a single LDAP modify request, you can specify
multiple modifications in a single LDIF record. A line containing only the hyphen (-) character is
used to mark the end of the attribute value specifications for each modification specifier.
The following example LDIF file contains a mixture of modifications:
1 version: 1
2
3 # An empty line to demonstrate that one or more
4 # line separators between the version identifier
5 # and the first record is legal.
6
7 dn: cn=Peter Michaels, ou=Artists, l=San Francisco, c=US
8 changetype: modify
9 # Add an additional telephone number value.
10 add: telephonenumber
11 telephonenumber: +1 415 555 0002
12 -
13 # Delete the entire fascimiletelephonenumber attribute.
14 delete: facsimileTelephoneNumber
15 -
16 # Replace the existing description (if any exists)
17 # with two new values.
18 replace: description
Element Description
add: attribute type A keyword indicating that subsequent attribute value
specifiers for the attribute type should be added to the entry.
delete: attribute type A keyword indicating that values of the attribute type are to be
deleted. If attribute value specifiers follow the delete field, the
values given are deleted.
If no attribute value specifiers follow the delete field, then all
values are deleted. If the attribute has no values, this
operation will fail, but the desired effect will still be achieved
because the attribute had no values to be deleted.
replace: attribute type A keyword indicating that the values of the attribute type are
to be replaced. Any attribute value specifiers that follow the
replace field become the new values for the attribute type.
If no attribute value specifiers follow the replace field, the
current set of values is replaced with an empty set of values
(which causes the attribute to be removed). Unlike the delete
modification specifier, if the attribute has no values, the
replace will still succeed. The net effect in both cases is the
same.
Comentarios a estos manuales