1 .TH LDIF 5 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2006 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldif \- LDAP Data Interchange Format
8 The LDAP Data Interchange Format (LDIF) is used to represent LDAP
9 entries and change records in text form. LDAP tools, such as
10 .BR ldapadd (1) and .BR ldapsearch (1), read and write LDIF entry
11 records. ldapmodify(1) reads LDIF change records.
13 This manual page provides a basic description of LDIF. A
14 formal specification of LDIF is published in RFC 2849.
17 LDIF entry records are used to represent directory entries. The basic
18 form of an entry record is:
22 dn: <distinguished name>
23 <attrdesc>: <attrvalue>
24 <attrdesc>: <attrvalue>
25 <attrdesc>:: <base64-encoded-value>
31 The value may be specified as UTF-8 text or as base64 encoded data,
32 or a URI may be provided to the location of the attribute value.
34 A line may be continued by starting the next line with a single space
39 dn: cn=Barbara J Jensen,dc=exam
44 Lines beginning with a sharp sign ('#') are ignored.
46 Multiple attribute values are specified on separate lines, e.g.,
55 If an value contains a non-printing character, or begins
56 with a space or a colon ':', the <attrtype> is followed by a
57 double colon and the value is encoded in base 64 notation. e.g.,
58 the value " begins with a space" would be encoded like this:
62 cn:: IGJlZ2lucyB3aXRoIGEgc3BhY2U=
66 If the attribute value is located in a file, the <attrtype> is
67 followed by a ':<' and a file: URI. e.g., the value contained
68 in the file /tmp/value would be listed like this:
72 cn:< file:///tmp/value
75 Other URI schemes (ftp,http) may be supported as well.
77 Multiple entries within the same LDIF file are separated by blank
79 .SH ENTRY RECORD EXAMPLE
80 Here is an example of an LDIF file containing three entries.
84 dn: cn=Barbara J Jensen,dc=example,dc=com
88 description:< file:///tmp/babs
91 dn: cn=Bjorn J Jensen,dc=example,dc=com
97 dn: cn=Jennifer J Jensen,dc=example,dc=com
102 jpegPhoto:: /9j/4AAQSkZJRgABAAAAAQABAAD/2wBDABALD
103 A4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQ
104 ERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVG
109 Note that the description in Barbara Jensen's entry is
110 read from file:///tmp/babs and the jpegPhoto in Jennifer
111 Jensen's entry is encoded using base 64.
113 LDIF change records are used to represent directory change requests.
114 Each change record starts with line indicating the distinguished
115 name of the entry being changed:
118 dn: <distinguishedname>
122 changetype: <[modify|add|delete|modrdn]>
125 Finally, the change information itself is given, the format of which
126 depends on what kind of change was specified above. For a \fIchangetype\fP
127 of \fImodify\fP, the format is one or more of the following:
137 Or, for a replace modification:
140 replace: <attributetype>
147 If no \fIattributetype\fP lines are given to replace,
148 the entire attribute is to be deleted (if present).
150 Or, for a delete modification:
153 delete: <attributetype>
160 If no \fIattributetype\fP lines are given to delete,
161 the entire attribute is to be deleted.
163 For a \fIchangetype\fP of \fIadd\fP, the format is:
166 <attrdesc1>: <value1>
167 <attrdesc1>: <value2>
169 <attrdescN>: <value1>
170 <attrdescN>: <value2>
173 For a \fIchangetype\fP of \fImodrdn\fP or \fImoddn\fP,
182 where a value of 1 for deleteoldrdn means to delete the values
183 forming the old rdn from the entry, and a value of 0 means to
184 leave the values as non-distinguished attributes in the entry.
185 The newsuperior line is optional and, if present, specifies the
186 new superior to move the entry to.
188 For a \fIchangetype\fP of \fIdelete\fP, no additional information
189 is needed in the record.
191 Note that attribute values may be presented using base64 or in
192 files as described for entry records. Lines in change records
193 may be continued in the manner described for entry records as
195 .SH CHANGE RECORD EXAMPLE
196 The following sample LDIF file contains a change record
197 of each type of change.
200 dn: cn=Babs Jensen,dc=example,dc=com
203 objectclass: extensibleObject
208 dn: cn=Babs Jensen,dc=example,dc=com
215 description: the fabulous babs
221 dn: cn=Babs Jensen,dc=example,dc=com
223 newrdn: cn=Barbara J Jensen
225 newsuperior: ou=People,dc=example,dc=com
227 dn: cn=Barbara J Jensen,ou=People,dc=example,dc=com
236 .BR slapd.replog (5).
238 "LDAP Data Interchange Format," Good, G., RFC 2849.
241 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
243 is derived from University of Michigan LDAP 3.3 Release.