The sec_rgy_attr_update( ) call creates new attribute instances and updates existing attribute instances attached to an object specified by name and registry domain. The instances to be created or updated are passed as an array of sec_attr_t data types.
Because the new values are passed in as an array, if the update of any attribute instance in the array fails, all fail. However, to help pinpoint the cause of the failure, the call identifies the first attribute whose update failed in a failure index by array element number.
For existing attribute instances attached to the object, the values passed in the array overwrite the existing values. In other words, if the UUID passed in the input array matches the UUID of an existing instance, the values passed in overwrite the existing values.
If the attribute instance does not exist, it is created. In other words, if the UUID passed in the array does not match any other attribute type UUID attached to the object, a new attribute instance is created.
For multivalued attributes, because every instance of the multivalued attribute is identified by the same UUID, every instance is overwritten with the supplied value. For example, suppose object delores has three attributes of the multivalued type security_role. If you pass in one value for security_role, the values of all three are changed to the one you enter.
To change only one of the security_role values, you must supply the values that should be unchanged as well as the new value. For example, suppose object delores has three security_role attributes with values of level1, level2, and level3. To change level1 to level1O. and retain level2 and level3, the input array must contain level1.5, level2, and level3.
To create instances of multivalued attributes, you must create individual sec_attr_t data types to define each multivalued attribute instance and then pass all of them in the sec_rgy_attr_update( ) input array.
If an input attribute is associated with an update attribute trigger, the attribute trigger is invoked (by the sec_attr_trig_update( ) call), and the values in the sec_rgy_attr_update( ) input array are used as input to the update attribute trigger. The output values from the update attribute trigger are stored in the registry database and returned in the sec_rgy_attr_update( ) output array.