ldapmod(4ldap)


ldapmod -- describes changes to an attribute

Synopsis

cc [options] file -lldap 

#include <aio.h>

Description

The LDAPMod structure specifies changes to be made to an attribute. It is defined in ldap.h and contains the following members:
   typedef struct ldapmod { 
       int mod_op; 
       char *mod_type; 
       union { 
           char **modv_strvals; 
           struct berval **modv_bvals; 
       } mod_vals; 
   } LDAPMod; 
   

#define mod_values mod_vals.modv_strvals #define mod_bvalues mod_vals.modv_bvals

The fields in the structure have the following meanings:

mod_op
Specifies the type of modification to perform:

LDAP_MOD_ADD
The given values are added to the entry, creating the attribute if necessary.

LDAP_MOD_DELETE
The given values are deleted from the entry, removing the attribute if no values remain. If the entire attribute is to be deleted, the mod_values field should be set to NULL.

LDAP_MOD_REPLACE
The attribute will have the listed values after the modification, having been created if necessary.

If the new attributes are not string attributes (for example, a photo) then you should OR the specifier with the special value LDAP_MOD_BVALUES. For example, an addition of a binary attribute is specified by (LDAP_MOD_ADD | LDAP_MOD_BVALUES). If LDAP_MOD_BVALUES is set then the new value for the attribute is taken from mod_bvalues, otherwise from mod_values.

mod_type
The attribute type to modify.

mod_values
A pointer to a null-terminated array of string values for the attribute.

mod_bvalues
A pointer to a null-terminated array of berval structures for the attribute.
All modifications are performed in the order in which they are listed.

References

ldap_add(3ldap), ldap_modify(3ldap)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.