]> git.sur5r.net Git - openldap/blob - doc/man/man5/ldif.5
Happy new year!
[openldap] / doc / man / man5 / ldif.5
1 .TH LDIF 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2006 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldif \- LDAP Data Interchange Format
7 .SH DESCRIPTION
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.
12 .LP
13 This manual page provides a basic description of LDIF.  A
14 formal specification of LDIF is published in RFC 2849.
15 .SH ENTRY RECORDS
16 .LP
17 LDIF entry records are used to represent directory entries.  The basic
18 form of an entry record is:
19 .LP
20 .nf
21 .ft tt
22         dn: <distinguished name>
23         <attrdesc>: <attrvalue>
24         <attrdesc>: <attrvalue>
25         <attrdesc>:: <base64-encoded-value>
26         <attrdesc>:< <URL>
27         ...
28 .ft
29 .fi
30 .LP
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.
33 .LP
34 A line may be continued by starting the next line with a single space
35 or tab, e.g.,
36 .LP
37 .nf
38 .ft tt
39         dn: cn=Barbara J Jensen,dc=exam
40          ple,dc=com
41 .ft
42 .fi
43 .LP
44 Lines beginning with a sharp sign ('#') are ignored.
45 .LP
46 Multiple attribute values are specified on separate lines, e.g.,
47 .LP
48 .nf
49 .ft tt
50         cn: Barbara J Jensen
51         cn: Babs Jensen
52 .ft
53 .fi
54 .LP
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:
59 .LP
60 .nf
61 .ft tt
62         cn:: IGJlZ2lucyB3aXRoIGEgc3BhY2U=
63 .ft
64 .fi
65 .LP
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:
69 .LP
70 .nf
71 .ft tt
72         cn:< file:///tmp/value
73 .ft
74 .fi
75 Other URI schemes (ftp,http) may be supported as well.
76 .LP
77 Multiple entries within the same LDIF file are separated by blank
78 lines.
79 .SH ENTRY RECORD EXAMPLE
80 Here is an example of an LDIF file containing three entries.
81 .LP
82 .nf
83 .ft tt
84         dn: cn=Barbara J Jensen,dc=example,dc=com
85         cn: Barbara J Jensen
86         cn: Babs Jensen
87         objectclass: person
88         description:< file:///tmp/babs
89         sn: Jensen
90
91         dn: cn=Bjorn J Jensen,dc=example,dc=com
92         cn: Bjorn J Jensen
93         cn: Bjorn Jensen
94         objectclass: person
95         sn: Jensen
96
97         dn: cn=Jennifer J Jensen,dc=example,dc=com
98         cn: Jennifer J Jensen
99         cn: Jennifer Jensen
100         objectclass: person
101         sn: Jensen
102         jpegPhoto:: /9j/4AAQSkZJRgABAAAAAQABAAD/2wBDABALD
103          A4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQ
104          ERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVG
105         ...
106 .ft
107 .fi
108 .LP
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.
112 .SH CHANGE RECORDS
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:
116 .LP
117 .nf
118         dn: <distinguishedname>
119 .fi
120 .LP
121 .nf
122         changetype: <[modify|add|delete|modrdn]>
123 .fi
124 .LP
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:
128 .LP
129 .nf
130         add: <attributetype>
131         <attrdesc>: <value1>
132         <attrdesc>: <value2>
133         ...
134         -
135 .fi
136 .LP
137 Or, for a replace modification:
138 .LP
139 .nf
140         replace: <attributetype>
141         <attrdesc>: <value1>
142         <attrdesc>: <value2>
143         ...
144         -
145 .fi
146 .LP
147 If no \fIattributetype\fP lines are given to replace,
148 the entire attribute is to be deleted (if present).
149 .LP
150 Or, for a delete modification:
151 .LP
152 .nf
153         delete: <attributetype>
154         <attrdesc>: <value1>
155         <attrdesc>: <value2>
156         ...
157         -
158 .fi
159 .LP
160 If no \fIattributetype\fP lines are given to delete,
161 the entire attribute is to be deleted.
162 .LP
163 For a \fIchangetype\fP of \fIadd\fP, the format is:
164 .LP
165 .nf
166         <attrdesc1>: <value1>
167         <attrdesc1>: <value2>
168         ...
169         <attrdescN>: <value1>
170         <attrdescN>: <value2>
171 .fi
172 .LP
173 For a \fIchangetype\fP of \fImodrdn\fP or \fImoddn\fP,
174 the format is:
175 .LP
176 .nf
177         newrdn: <newrdn>
178         deleteoldrdn: 0 | 1
179         newsuperior: <DN>
180 .fi
181 .LP
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.
187 .LP
188 For a \fIchangetype\fP of \fIdelete\fP, no additional information
189 is needed in the record.
190 .LP
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
194 well. 
195 .SH CHANGE RECORD EXAMPLE
196 The following sample LDIF file contains a change record
197 of each type of change.
198 .LP
199 .nf
200         dn: cn=Babs Jensen,dc=example,dc=com
201         changetype: add
202         objectclass: person
203         objectclass: extensibleObject
204         cn: babs
205         cn: babs jensen
206         sn: jensen
207
208         dn: cn=Babs Jensen,dc=example,dc=com
209         changetype: modify
210         add: givenName
211         givenName: Barbara
212         givenName: babs
213         -
214         replace: description
215         description: the fabulous babs
216         -
217         delete: sn
218         sn: jensen
219         -
220
221         dn: cn=Babs Jensen,dc=example,dc=com
222         changetype: modrdn
223         newrdn: cn=Barbara J Jensen
224         deleteoldrdn: 0
225         newsuperior: ou=People,dc=example,dc=com
226
227         dn: cn=Barbara J Jensen,ou=People,dc=example,dc=com
228         changetype: delete
229 .fi
230
231 .SH SEE ALSO
232 .BR ldap (3),
233 .BR ldapsearch (1),
234 .BR ldapadd (1),
235 .BR ldapmodify (1),
236 .BR slapd.replog (5).
237 .LP
238 "LDAP Data Interchange Format," Good, G., RFC 2849.
239 .SH ACKNOWLEDGEMENTS
240 .B OpenLDAP
241 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
242 .B OpenLDAP
243 is derived from University of Michigan LDAP 3.3 Release.