ldap_modify(3ldap)


ldap_modify, ldap_modify_s, ldap_mods_free -- perform an LDAP modify operation

Synopsis

#include <lber.h> 
#include <ldap.h> 

int ldap_modify(LDAP *ld, char *dn, LDAPMod *mods[]);

int ldap_modify_s(LDAP *ld, char *dn, LDAPMod *mods[]);

void ldap_mods_free(LDAPMod **mods, int freemods);

Description

The routine ldap_modify_s is used to perform an LDAP modify operation. dn is the DN of the entry to modify, and mods is a null-terminated array of modifications to make to the entry. Each element of the mods array is a pointer to an LDAPMod structure (see ldapmod(4ldap)).

ldap_modify_s returns the LDAP error code resulting from the modify operation. This code can be interpreted by the functions documented on the ldap_perror(3ldap) manual page.

The ldap_modify operation works the same way as ldap_modify_s, except that it is asynchronous, returning the message ID of the request it initiates, or else -1 on error. The result of the operation can be obtained by calling ldap_result(3ldap).

ldap_mods_free can be used to free each element of a NULL-terminated array of LDAPMod structures. If freemods is non-zero, the mods pointer itself is freed as well.

Return values

ldap_modify_s returns an LDAP error code, either LDAP_SUCCESS or an error. On error, ldap_modify returns -1, setting the ld_errno field of ld.

References

Intro(3ldap), ldap_add(3ldap), ldapmod(4ldap), ldap_perror(3ldap)


30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.