6.8. ldif

6.8. ldif

ldif automatically formats LDIF files and creates base-64 encoded attribute values. Base-64 encoding makes it possible to represent binary data, such as a JPEG image, in LDIF. Base-64 encoded data is represented using a double colon (::) symbol. For example:

jpegPhoto:: encoded data

In addition to binary data, other values that must be base-64 encoded can identified with other symbols, including the following:

The ldif command-line utility will take any input and format it with the correct line continuation and appropriate attribute information. The ldif utility also senses whether the input requires base-64 encoding.

Syntax

The ldif command has the following format:

ldif [ -b ] [ attrtypes ] [ optional_options ]

Options

Option Description
-b

Specifies that the ldif utility should interpret the entire input as a single binary value. If -b is not present, each line is considered to be a separate input value.

As an alternative to the -b option, use the :< URL specifier notation. For example:

jpegphoto:< file:///tmp/myphoto.jpg

Although the official notation requires three ///, the use of one / is accepted.

NOTE

The :< URL specifier notation only works if LDIF statement is version 1 or later, meaning version: 1 is inserted in the lDIF file. Otherwise, the file URL is appended as the attribute value rather than the contents of the file.

Table 6.20. ldif Options


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.