1 .TH LDAP_MODIFY 3 "22 September 1998" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-1999 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_modify, ldap_modify_s \- Perform an LDAP modify operation
14 int ldap_modify(ld, dn, mods)
22 int ldap_modify_s(ld, dn, mods)
30 void ldap_mods_free( mods, freemods )
37 is used to perform an LDAP modify operation.
38 \fIdn\fP is the DN of the entry to modify, and \fImods\fP is a
39 null-terminated array of modifications to make to the entry. Each element
40 of the \fImods\fP array is a pointer to an LDAPMod structure, which is
45 typedef struct ldapmod {
50 struct berval **modv_bvals;
52 struct ldapmod *mod_next;
54 #define mod_values mod_vals.modv_strvals
55 #define mod_bvalues mod_vals.modv_bvals
59 The \fImod_op\fP field is used to specify the type of modification to
60 perform and should be one of LDAP_MOD_ADD, LDAP_MOD_DELETE, or
61 LDAP_MOD_REPLACE. The \fImod_type\fP and \fImod_values\fP fields
62 specify the attribute type to modify and a null-terminated array of
63 values to add, delete, or replace respectively. The \fImod_next\fP
64 field is used only by the LDAP server and may be ignored by the
67 If you need to specify a non-string value (e.g., to add a
68 photo or audio attribute value), you should set \fImod_op\fP to the
69 logical OR of the operation as above (e.g., LDAP_MOD_REPLACE)
70 and the constant LDAP_MOD_BVALUES. In this case, \fImod_bvalues\fP
71 should be used instead of \fImod_values\fP, and it should point to
72 a null-terminated array of struct bervals, as defined in <lber.h>.
74 For LDAP_MOD_ADD modifications, the given values are added to the
75 entry, creating the attribute if necessary. For LDAP_MOD_DELETE
76 modifications, the given values are deleted from the entry, removing
77 the attribute if no values remain. If the entire attribute is to be deleted,
78 the \fImod_values\fP field should be set to NULL. For LDAP_MOD_REPLACE
79 modifications, the attribute will have the listed values after the
80 modification, having been created if necessary. All modifications are
81 performed in the order in which they are listed.
85 returns the LDAP error code resulting from the
86 modify operation. This code can be interpreted by
92 operation works the same way as
94 except that it is asynchronous, returning the message id of the
95 request it initiates, or -1 on error. The result of the operation
96 can be obtained by calling
100 can be used to free each element of a NULL-terminated
101 array of mod structures. If \fIfreemods\fP is non-zero, the
102 \fImods\fP pointer itself is freed as well.
105 returns an ldap error code, either LDAP_SUCCESS or
106 an error if there was trouble.
109 of trouble, setting the
118 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
120 is derived from University of Michigan LDAP 3.3 Release.