LDAPMod

Contains the modifications to make to one attribute of an entry.

Structure

  typedef union mod_vals_u {
     char           **modv_strvals;
     struct berval   *mod_bvals;
  } mod_vals_u_t;
  
  typedef struct ldapmod {
     int               mod_op;
     char             *mod_type;
     mod_vals_u_t      mod_vals;
  #define mod_values   mod_vals.modv_strvals
  #define mod_bvalues  mod_vals.modv_bvals
  } LDAPMod;
  

Fields

mod_op

Specifies the type of modification operation.

  • LDAP_MOD_ADD (0x0000)—adds the value, adding the attribute if no values currently exist.

  • LDAP_MOD_DELETE (0x0001)—deletes the specified values, removing the attribute if no values remain.

  • LDAP_MOD_REPLACE (0x0002)— replaces the current values with the specified values, adding the attribute if no values currently exist and removing the attribute if the specified value's field is NULL.

  • LDAP_MOD_BVALUES (0x0080)—specifies binary values. If the mod_vals structure contains binary values, this flag should be ORed to one of the other flags to specify a binary modification. If this flag is not ORed, the default is to assume string value modifications.

mod_type

Points to the name of attribute to modify.

modv_strvals

Points to a NULL-terminated array of string values for the attribute. This field cannot contain values if the modv_bvals field contains values.

modv_bvals

Points to a NULL-terminated array of berval structures which are used to modify an attribute's binary values. This field cannot contain values if the modv_strvals field contains values.

Remarks

If mod_op is set to an operation flag with LDAP_MOD_BVALUES ORed to it, the modv_strvals should be empty. If LDAP_MOD_BVALUES is not ORed to the operation flag, the modv_strvals should contain the values for the modification operation.

Either the attribute contains string or binary values. Select the one that matches the attribute's syntax.