320 lines
5.5 KiB
HTML
320 lines
5.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>More on the LDIF Format</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="LDAP Linux HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="Database Creation and Maintenance"
|
|
HREF="dbcreation.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Creating a Database offline"
|
|
HREF="createdboffline.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="The ldapsearch, ldapdelete and ldapmodify utilities"
|
|
HREF="utilities.html"></HEAD
|
|
><BODY
|
|
CLASS="section"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>LDAP Linux HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="createdboffline.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 5. Database Creation and Maintenance</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="utilities.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H1
|
|
CLASS="section"
|
|
><A
|
|
NAME="MoreonLDIF"
|
|
></A
|
|
>5.3. More on the LDIF Format</H1
|
|
><P
|
|
>The LDAP Data Interchange Format (LDIF) is used to represent LDAP entries in a
|
|
simple text format. The basic form of an entry is: </P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> #comment
|
|
dn: <distinguished name>
|
|
<attrdesc>: <attrvalue>
|
|
<attrdesc>: <attrvalue>
|
|
...</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>Lines starting with a '#' character are comments. An attribute description
|
|
(attrdesc) may be a simple attribute type like cn or objectClass or 1.2.3 (an
|
|
OID associated with an attribute type) or may include options such as
|
|
cn;lang_en_US or userCertificate;binary.</P
|
|
><P
|
|
>A line may be continued by starting the next line with a single space or tab
|
|
character. For example:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> dn: cn=Barbara J Jensen, dc=example, dc=
|
|
com
|
|
cn: Barbara J
|
|
Jensen
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>is equivalent to:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> dn: cn=Barbara J Jensen, dc=example, dc=com
|
|
cn: Barbara J Jensen
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>Multiple attribute values are specified on separate lines. e.g.,</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> cn: Barbara J Jensen
|
|
cn: Babs Jensen
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>If an <attrvalue> contains non-printing characters or begins with a space,
|
|
a double colon (':'), or a less than ('<'), the <attrdesc> is followed by a
|
|
double colon and the base64 encoding of the value. For example, the value "
|
|
begins with a space" would be encoded like this:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
>cn:: IGJlZ2lucyB3aXRoIGEgc3BhY2U=</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>You can also specify a URL containing the attribute value. For example, the
|
|
following specifies the jpegPhoto value should be obtained from the file
|
|
/path/to/file.jpeg.</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
>cn:< file://path/to/file.jpeg</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>Multiple entries within the same LDIF file are separated by blank lines. Here's
|
|
an example of an LDIF file containing three entries.</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> # Barbara's Entry
|
|
dn: cn=Barbara J Jensen, dc=example, dc=com
|
|
cn: Barbara J Jensen
|
|
cn: Babs Jensen
|
|
objectClass: person
|
|
sn: Jensen
|
|
|
|
# Bjorn's Entry
|
|
dn: cn=Bjorn J Jensen, dc=example, dc=com
|
|
cn: Bjorn J Jensen
|
|
cn: Bjorn Jensen
|
|
objectClass: person
|
|
sn: Jensen
|
|
# Base64 encoded JPEG photo
|
|
jpegPhoto:: /9j/4AAQSkZJRgABAAAAAQABAAD/2wBDABALD
|
|
A4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQ
|
|
ERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVG
|
|
|
|
# Jennifer's Entry
|
|
dn: cn=Jennifer J Jensen, dc=example, dc=com
|
|
cn: Jennifer J Jensen
|
|
cn: Jennifer Jensen
|
|
objectClass: person
|
|
sn: Jensen
|
|
# JPEG photo from file
|
|
jpegPhoto:< file://path/to/file.jpeg</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>Notice that the jpegPhoto in Bjorn's entry is base 64 encoded and the jpegPhoto
|
|
in Jennifer's entry is obtained from the location indicated by the URL.</P
|
|
><P
|
|
>Trailing spaces are not trimmed from values in an LDIF file. Nor are multiple
|
|
internal spaces compressed. If you don't want them in your data, don't put
|
|
them there.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="createdboffline.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="utilities.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Creating a Database offline</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="dbcreation.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>The ldapsearch, ldapdelete and ldapmodify utilities</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |