+ /* Otherwise, we have to have matching UIDs or GIDs. */
+ if (entry_tag == ACL_USER) {
+ qualifiers_match = ( *((uid_t*)existing_qualifier)
+ ==
+ *((uid_t*)entry_qualifier) );
+ }
+ else if (entry_tag == ACL_GROUP) {
+ qualifiers_match = ( *((gid_t*)existing_qualifier)
+ ==
+ *((gid_t*)entry_qualifier) );
+ }
+
+ /* Be sure to free this inside the loop, where memory is allocated. */
+ acl_free(existing_qualifier);
+
+ if (qualifiers_match) {
+ /* If we update something, we're done and return ACL_SUCCESS */
+ if (acl_set_permset(existing_entry, entry_permset) == ACL_ERROR) {
+ perror("acl_update_entry (acl_set_permset)");
+ result = ACL_ERROR;
+ goto cleanup;
+ }
+
+ result = ACL_SUCCESS;
+ goto cleanup;
+ }