1 .TH LDIF 5 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2014 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
13 read and write LDIF entry
16 reads LDIF change records.
18 This manual page provides a basic description of LDIF. A
19 formal specification of LDIF is published in RFC 2849.
22 LDIF entry records are used to represent directory entries. The basic
23 form of an entry record is:
27 dn: <distinguished name>
28 <attrdesc>: <attrvalue>
29 <attrdesc>: <attrvalue>
30 <attrdesc>:: <base64-encoded-value>
36 The value may be specified as UTF-8 text or as base64 encoded data,
37 or a URI may be provided to the location of the attribute value.
39 A line may be continued by starting the next line with a single space
44 dn: cn=Barbara J Jensen,dc=exam
49 Lines beginning with a sharp sign ('#') are ignored.
51 Multiple attribute values are specified on separate lines, e.g.,
60 If an value contains a non-printing character, or begins
61 with a space or a colon ':', the <attrtype> is followed by a
62 double colon and the value is encoded in base 64 notation. e.g.,
63 the value " begins with a space" would be encoded like this:
67 cn:: IGJlZ2lucyB3aXRoIGEgc3BhY2U=
71 If the attribute value is located in a file, the <attrtype> is
72 followed by a ':<' and a file: URI. e.g., the value contained
73 in the file /tmp/value would be listed like this:
77 cn:< file:///tmp/value
80 Other URI schemes (ftp,http) may be supported as well.
82 Multiple entries within the same LDIF file are separated by blank
84 .SH ENTRY RECORD EXAMPLE
85 Here is an example of an LDIF file containing three entries.
89 dn: cn=Barbara J Jensen,dc=example,dc=com
93 description:< file:///tmp/babs
96 dn: cn=Bjorn J Jensen,dc=example,dc=com
102 dn: cn=Jennifer J Jensen,dc=example,dc=com
103 cn: Jennifer J Jensen
107 jpegPhoto:: /9j/4AAQSkZJRgABAAAAAQABAAD/2wBDABALD
108 A4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQ
109 ERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVG
114 Note that the description in Barbara Jensen's entry is
115 read from file:///tmp/babs and the jpegPhoto in Jennifer
116 Jensen's entry is encoded using base 64.
118 LDIF change records are used to represent directory change requests.
119 Each change record starts with line indicating the distinguished
120 name of the entry being changed:
123 dn: <distinguishedname>
127 changetype: <[modify|add|delete|modrdn]>
130 Finally, the change information itself is given, the format of which
131 depends on what kind of change was specified above. For a \fIchangetype\fP
132 of \fImodify\fP, the format is one or more of the following:
142 Or, for a replace modification:
145 replace: <attributetype>
152 If no \fIattributetype\fP lines are given to replace,
153 the entire attribute is to be deleted (if present).
155 Or, for a delete modification:
158 delete: <attributetype>
165 If no \fIattributetype\fP lines are given to delete,
166 the entire attribute is to be deleted.
168 For a \fIchangetype\fP of \fIadd\fP, the format is:
171 <attrdesc1>: <value1>
172 <attrdesc1>: <value2>
174 <attrdescN>: <value1>
175 <attrdescN>: <value2>
178 For a \fIchangetype\fP of \fImodrdn\fP or \fImoddn\fP,
187 where a value of 1 for deleteoldrdn means to delete the values
188 forming the old rdn from the entry, and a value of 0 means to
189 leave the values as non-distinguished attributes in the entry.
190 The newsuperior line is optional and, if present, specifies the
191 new superior to move the entry to.
193 For a \fIchangetype\fP of \fIdelete\fP, no additional information
194 is needed in the record.
196 Note that attribute values may be presented using base64 or in
197 files as described for entry records. Lines in change records
198 may be continued in the manner described for entry records as
200 .SH CHANGE RECORD EXAMPLE
201 The following sample LDIF file contains a change record
202 of each type of change.
205 dn: cn=Babs Jensen,dc=example,dc=com
208 objectclass: extensibleObject
213 dn: cn=Babs Jensen,dc=example,dc=com
220 description: the fabulous babs
226 dn: cn=Babs Jensen,dc=example,dc=com
228 newrdn: cn=Barbara J Jensen
230 newsuperior: ou=People,dc=example,dc=com
232 dn: cn=Barbara J Jensen,ou=People,dc=example,dc=com
236 .SH INCLUDE STATEMENT
237 The LDIF parser has been extended to support an
239 statement for referencing other LDIF files. The
241 statement must be separated from other records by a blank line.
242 The referenced file is specified using a file: URI and all of its
243 contents are incorporated as if they were part of the original
244 LDIF file. As above, other URI schemes may be supported. For example:
247 dn: dc=example,dc=com
251 include: file:///tmp/example.com.ldif
253 dn: dc=example,dc=org
257 This feature is not part of the LDIF specification in RFC 2849 but
258 is expected to appear in a future revision of this spec. It is supported
275 "LDAP Data Interchange Format," Good, G., RFC 2849.