1 .TH LDAP_MODIFY 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2017 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_modify_ext, ldap_modify_ext_s \- Perform an LDAP modify operation
8 OpenLDAP LDAP (libldap, \-lldap)
20 LDAPMod *\fImods[]\fB,
21 LDAPControl **\fIsctrls\fB,
22 LDAPControl **\fIcctrls\fB,
28 int ldap_modify_ext_s(
33 LDAPMod *\fImods[]\fB,
34 LDAPControl **\fIsctrls\fB,
35 LDAPControl **\fIcctrls\fB );
48 .B ldap_modify_ext_s()
49 is used to perform an LDAP modify operation.
50 \fIdn\fP is the DN of the entry to modify, and \fImods\fP is a
51 null-terminated array of modifications to make to the entry. Each element
52 of the \fImods\fP array is a pointer to an LDAPMod structure, which is
56 typedef struct ldapmod {
61 struct berval **modv_bvals;
63 struct ldapmod *mod_next;
65 #define mod_values mod_vals.modv_strvals
66 #define mod_bvalues mod_vals.modv_bvals
70 The \fImod_op\fP field is used to specify the type of modification to
71 perform and should be one of LDAP_MOD_ADD, LDAP_MOD_DELETE, or
72 LDAP_MOD_REPLACE. The \fImod_type\fP and \fImod_values\fP fields
73 specify the attribute type to modify and a null-terminated array of
74 values to add, delete, or replace respectively. The \fImod_next\fP
75 field is used only by the LDAP server and may be ignored by the
78 If you need to specify a non-string value (e.g., to add a
79 photo or audio attribute value), you should set \fImod_op\fP to the
80 logical OR of the operation as above (e.g., LDAP_MOD_REPLACE)
81 and the constant LDAP_MOD_BVALUES. In this case, \fImod_bvalues\fP
82 should be used instead of \fImod_values\fP, and it should point to
83 a null-terminated array of struct bervals, as defined in <lber.h>.
85 For LDAP_MOD_ADD modifications, the given values are added to the
86 entry, creating the attribute if necessary. For LDAP_MOD_DELETE
87 modifications, the given values are deleted from the entry, removing
88 the attribute if no values remain. If the entire attribute is to be deleted,
89 the \fImod_values\fP field should be set to NULL. For LDAP_MOD_REPLACE
90 modifications, the attribute will have the listed values after the
91 modification, having been created if necessary. All modifications are
92 performed in the order in which they are listed.
95 can be used to free each element of a NULL-terminated
96 array of mod structures. If \fIfreemods\fP is non-zero, the
97 \fImods\fP pointer itself is freed as well.
99 .B ldap_modify_ext_s()
100 returns a code indicating success or, in the case of failure,
101 indicating the nature of the failure. See
107 operation works the same way as
108 .BR ldap_modify_ext_s() ,
109 except that it is asynchronous. The integer that \fImsgidp\fP points
110 to is set to the message id of the modify request. The result of
111 the operation can be obtained by calling
117 .B ldap_modify_ext_s()
118 allows server and client controls to be passed in
119 via the sctrls and cctrls parameters, respectively.
120 .SH DEPRECATED INTERFACES
125 routines are deprecated in favor of the
128 .B ldap_modify_ext_s()
129 routines, respectively.