1 .TH LDAP_MODIFY 3 "22 September 1998" "OpenLDAP LDVERSION"
3 ldap_modify, ldap_modify_s \- Perform an LDAP modify operation
12 int ldap_modify(ld, dn, mods)
20 int ldap_modify_s(ld, dn, mods)
28 void ldap_mods_free( mods, freemods )
35 is used to perform an LDAP modify operation.
36 \fIdn\fP is the DN of the entry to modify, and \fImods\fP is a
37 null-terminated array of modifications to make to the entry. Each element
38 of the \fImods\fP array is a pointer to an LDAPMod structure, which is
43 typedef struct ldapmod {
48 struct berval **modv_bvals;
50 struct ldapmod *mod_next;
52 #define mod_values mod_vals.modv_strvals
53 #define mod_bvalues mod_vals.modv_bvals
57 The \fImod_op\fP field is used to specify the type of modification to
58 perform and should be one of LDAP_MOD_ADD, LDAP_MOD_DELETE, or
59 LDAP_MOD_REPLACE. The \fImod_type\fP and \fImod_values\fP fields
60 specify the attribute type to modify and a null-terminated array of
61 values to add, delete, or replace respectively. The \fImod_next\fP
62 field is used only by the LDAP server and may be ignored by the
65 If you need to specify a non-string value (e.g., to add a
66 photo or audio attribute value), you should set \fImod_op\fP to the
67 logical OR of the operation as above (e.g., LDAP_MOD_REPLACE)
68 and the constant LDAP_MOD_BVALUES. In this case, \fImod_bvalues\fP
69 should be used instead of \fImod_values\fP, and it should point to
70 a null-terminated array of struct bervals, as defined in <lber.h>.
72 For LDAP_MOD_ADD modifications, the given values are added to the
73 entry, creating the attribute if necessary. For LDAP_MOD_DELETE
74 modifications, the given values are deleted from the entry, removing
75 the attribute if no values remain. If the entire attribute is to be deleted,
76 the \fImod_values\fP field should be set to NULL. For LDAP_MOD_REPLACE
77 modifications, the attribute will have the listed values after the
78 modification, having been created if necessary. All modifications are
79 performed in the order in which they are listed.
83 returns the LDAP error code resulting from the
84 modify operation. This code can be interpreted by
90 operation works the same way as
92 except that it is asynchronous, returning the message id of the
93 request it initiates, or -1 on error. The result of the operation
94 can be obtained by calling
98 can be used to free each element of a NULL-terminated
99 array of mod structures. If \fIfreemods\fP is non-zero, the
100 \fImods\fP pointer itself is freed as well.
103 returns an ldap error code, either LDAP_SUCCESS or
104 an error if there was trouble.
107 of trouble, setting the
116 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
118 is derived from University of Michigan LDAP 3.3 Release.