LDIF Update Statements
Chapter 2
Creating Directory Entries
69
The following example adds a
jpeg
photograph to the directory. The
jpeg
photo
can be displayed by Directory Server Gateway. In order to add this attribute to the
directory, you must use the
ldapmodify -b
parameter, which indicates that
ldapmodify
should read the referenced file for binary values if the attribute value
begins with a slash:
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
add: jpegphoto
jpegphoto: /path/to/photo
You can also add a
jpeg
photograph to the directory using the following standard
LDIF notation:
jpegphoto: < file:/path/to/photo
If you use this standard notation, you do not need to specify the
ldapmodify -b
parameter. However, you must add the following line to the beginning of your
LDIF file or your LDIF update statements:
version:1
For example, you could use the following
ldapmodify
command:
prompt> ldapmodify -D
userDN
-w
user_password
>version: 1
>dn: cn=Barney Fife,ou=People,dc=example,dc=com
>changetype: modify
>add: userCertificate
>userCertificate;binary:< file: BarneysCert
Changing an Attribute Value Using LDIF
Use
changetype:modify
with the replace operation to change all values of an
attribute in an entry.
For example, the following LDIF update statement changes Barney’s manager from
Sally Nixon to Wally Hensford:
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
replace: manager
manager: cn=Wally Hensford, ou=People, dc=example,dc=com
NOTE
You can use the standard LDIF notation only with the
ldapmodify
command, not with other command-line utilities.
Summary of Contents for DIRECTORY SERVER 7.1
Page 1: ...Administrator s Guide Red Hat Directory Server Version7 1 May 2005 Updated February 2009 ...
Page 20: ...20 Red Hat Directory Server Administrator s Guide May 2005 Glossary 619 Index 635 ...
Page 22: ...22 Red Hat Directory Server Administrator s Guide May 2005 ...
Page 26: ...26 Red Hat Directory Server Administrator s Guide May 2005 ...
Page 78: ...Maintaining Referential Integrity 78 Red Hat Directory Server Administrator s Guide May 2005 ...
Page 200: ...Assigning Class of Service 200 Red Hat Directory Server Administrator s Guide May 2005 ...
Page 488: ...488 Red Hat Directory Server Administrator s Guide May 2005 ...
Page 528: ...PTA Plug in Syntax Examples 528 Red Hat Directory Server Administrator s Guide May 2005 ...
Page 572: ...572 Red Hat Directory Server Administrator s Guide May 2005 ...
Page 612: ...Examples of LDAP URLs 612 Red Hat Directory Server Administrator s Guide May 2005 ...
Page 634: ...634 Red Hat Directory Server Administrator s Guide May 2005 ...