LDAP-UX Client Services B.04.15 Administrator's Guide
6.3.6.4 Warnings
Under common usage, ldapugmod uses the LDAP replace operation when changing values of
an attribute in an entry. This feature can impact attributes that have multiple values, by removing
all occurrences of an attribute value and replacing it with the one specified on the ldapugmod
command line. For example, if the -n argument is used to specify a new name for a posixGroup,
all occurances of the cn attribute are replaced by the value specified for the -n argument. This
mode of operation applies to all command argument specified values, including -u, -g, -s, -d,
-I and -c.
When you use the <attr>=<value> parameter to modify an existing attribute, the ldapugmod
command also uses the LDAP replace operation. The replace operation removes all occurrences
of the specified attribute for an entry and replaces it with the value specified. If there are multiple
values for a single attribute in an entry, the use of a single <attr>=<value> parameter will
replace all values with the single value specified on the command line. You can specify more
than one occurrence of the same attribute on the command line, if that attribute is multi-valued.
In that case, both values are created in the entry.
Use of -A or -R changes this behavior (for both the above-listed command arguments and the
<attr>=<value> parameter). Any attribute specified as an argument to the -A or -R causes
ldapugmod to perform an LDAP add operation instead of an LDAP replace operation.
NOTE: The ldapugmod tool does not allow you to use the same attribute and value pair more
than once, either as part of <attr>=<value>, -R or -A, or with other command line options.
The ldapugmod tool exits with error status before sending any conflict modification request to
the LDAP directory server.
Example 1
In this example, an entry in an LDAP directory is as follows:
dn: uid=mLee,ou=people,dc=example,dc=com
cn: Mark Lee cn: Michael Lee uid: mlee uidNumber: 2200 gidNumber:
212 homeDirectory: /home/mlee loginShell: /usr/bin/ksh gecos: Mark
Lee,New York,555-666-6000 description: test user entry description:
multi-valued attribute entry
Perform the following ldapugmod command for the user entry, mlee:
cd /opt/ldapux/bin ./ldapugmod
-t passwd mlee "cn=Mackey Lee"
The above commands replace all instances of cn with the single value, Mackey Lee. The resulting
mlee entry is as follows:
dn: uid=mLou,ou=people,dc=example,dc=com
cn: Mackey Lee uid: mlee uidNumber: 2200 gidNumber: 212 homeDirectory:
/home/mlee loginShell: /usr/bin/ksh gecos: Mark Lee,New York,555-666-6000
description: test user entry description: multi-valued attribute entry
Perform the following ldapugmod command for the user entry, mlee:
./ldapugmod -t passwd -c "Mackey user
entry" mlee
This command replaces all instances of description with the single comment, Mackey user
entry. The result of the mlee entry is as follows:
dn: uid=mLou,ou=people,dc=example,dc=com
cn: Mackey Lee uid: mlee uidNumber: 2200 gidNumber: 212 homeDirectory:
/home/mlee loginShell: /usr/bin/ksh gecos: Mark Lee,New York,555-666-6000
description: Mackey user entry
Example 2
In this example, the entry in an LDAP directory is as follows:
6.3 LDAP User and Group Management Tools 181