Name
ldif — LDAP Data Interchange Format
DESCRIPTION
The LDAP Data Interchange Format (LDIF) is used to
represent LDAP entries and change records in text form. LDAP
tools, such as ldapadd(1)and.BRldapsearch(1),readandwriteLDIFentry records. ldapmodify(1)
reads LDIF change records.
This manual page provides a basic description of LDIF. A
formal specification of LDIF is published in RFC 2849.
ENTRY RECORDS
LDIF entry records are used to represent directory
entries. The basic form of an entry record is:
The value may be specified as UTF-8 text or as base64
encoded data, or a URI may be provided to the location of the
attribute value.
A line may be continued by starting the next line with a
single space or tab, e.g.,
Lines beginning with a sharp sign ('#') are ignored.
Multiple attribute values are specified on separate lines,
e.g.,
If an value contains a non-printing character, or begins
with a space or a colon ':', the <attrtype> is followed
by a double colon and the value is encoded in base 64
notation. e.g., the value " begins with a space" would be
encoded like this:
If the attribute value is located in a file, the
<attrtype> is followed by a ':<' and a file: URI.
e.g., the value contained in the file /tmp/value would be
listed like this:
Other URI schemes (ftp,http) may be supported as well.
Multiple entries within the same LDIF file are separated
by blank lines.
ENTRY RECORD EXAMPLE
Here is an example of an LDIF file containing three
entries.
Note that the description in Barbara Jensen's entry is
read from file:///tmp/babs and the jpegPhoto in Jennifer
Jensen's entry is encoded using base 64.
CHANGE RECORDS
LDIF change records are used to represent directory change
requests. Each change record starts with line indicating the
distinguished name of the entry being changed:
Finally, the change information itself is given, the
format of which depends on what kind of change was specified
above. For a changetype of modify, the format is one or
more of the following:
Or, for a replace modification:
If no attributetype lines are given
to replace, the entire attribute is to be deleted (if
present).
Or, for a delete modification:
If no attributetype lines are given
to delete, the entire attribute is to be deleted.
For a changetype
of add, the format
is:
For a changetype
of modrdn or
moddn, the format
is:
where a value of 1 for deleteoldrdn means to delete the
values forming the old rdn from the entry, and a value of 0
means to leave the values as non-distinguished attributes in
the entry. The newsuperior line is optional and, if present,
specifies the new superior to move the entry to.
For a changetype
of delete, no
additional information is needed in the record.
Note that attribute values may be presented using base64
or in files as described for entry records. Lines in change
records may be continued in the manner described for entry
records as well.
CHANGE RECORD EXAMPLE
The following sample LDIF file contains a change record of
each type of change.
ACKNOWLEDGEMENTS
OpenLDAP is
developed and maintained by The OpenLDAP Project
(http://www.openldap.org/). OpenLDAP is derived from
University of Michigan LDAP 3.3 Release.