}
+
/**
* @brief Determine whether @c path is executable (by anyone) or a
* directory.
int ge_result = acl_get_entry(acl, ACL_FIRST_ENTRY, &entry);
while (ge_result == ACL_SUCCESS) {
+ /* The first thing we do is check to see if this is a mask
+ entry. If it is, we skip it entirely. */
+ acl_tag_t tag = ACL_UNDEFINED_TAG;
+ int tag_result = acl_get_tag_type(entry, &tag);
+
+ if (tag_result == ACL_ERROR) {
+ perror("any_can_execute_or_dir (acl_get_tag_type)");
+ result = ACL_ERROR;
+ goto cleanup;
+ }
+
+ if (tag == ACL_MASK) {
+ ge_result = acl_get_entry(acl, ACL_NEXT_ENTRY, &entry);
+ continue;
+ }
+
+ /* Ok, so it's not a mask entry. Check the execute perms. */
acl_permset_t permset;
int ps_result = acl_get_permset(entry, &permset);
}
if (gp_result == ACL_SUCCESS) {
- /* Only return one if this execute bit is not masked. */
+ /* Only return ACL_SUCCESS if this execute bit is not masked. */
if (acl_execute_masked(path) != ACL_SUCCESS) {
result = ACL_SUCCESS;
goto cleanup;