EC_NULL_LOG(acl = acl_get_file(path, ACL_TYPE_ACCESS));
- /* itereate through all ACEs, get the mask */
+ /* itereate through all ACEs to get the mask */
while (acl_get_entry(acl, entry_id, &e) == 1) {
entry_id = ACL_NEXT_ENTRY;
switch (tag) {
case ACL_USER_OBJ:
EC_NULL_LOG(uid = (uid_t *)acl_get_qualifier(e));
if (*uid == pwd->pw_uid)
- rights |= (posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode)) & maskrights);
+ rights |= posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode));
acl_free(uid);
uid = NULL;
break;
case ACL_GROUP:
case ACL_GROUP_OBJ:
EC_NULL_LOG(gid = (gid_t *)acl_get_qualifier(e));
- if (*gid == pwd->pw_gid || gmem(*gid))
+ if (gmem(*gid))
rights |= (posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode)) & maskrights);
acl_free(gid);
gid = NULL;
}
} /* while */
+ *result |= rights;
+
EC_CLEANUP:
if (acl) acl_free(acl);
if (uid) acl_free(uid);