*/
/* Now we potentially need to mask the execute permissions in the
- ACL on fd. First obtain the current one... */
+ ACL on fd; or maybe now. */
+ if (allow_exec) {
+ goto cleanup;
+ }
+
+ /* OK, we need to mask some execute permissions. First obtain the
+ current ACL... */
new_acl = acl_get_fd(fd);
if (new_acl == (acl_t)NULL) {
perror("apply_default_acl_ex (acl_get_fd)");
tag == ACL_GROUP_OBJ ||
tag == ACL_OTHER) {
- if (!allow_exec) {
- /* The mask doesn't affect acl_user_obj, acl_group_obj (in
- minimal ACLs) or acl_other entries, so if execute should be
- masked, we have to do it manually. */
- if (acl_delete_perm(permset, ACL_EXECUTE) == ACL_ERROR) {
- perror("apply_default_acl_ex (acl_delete_perm)");
- result = ACL_ERROR;
- goto cleanup;
- }
-
- if (acl_set_permset(entry, permset) == ACL_ERROR) {
- perror("apply_default_acl_ex (acl_set_permset)");
- result = ACL_ERROR;
- goto cleanup;
- }
+ /* The mask doesn't affect acl_user_obj, acl_group_obj (in
+ minimal ACLs) or acl_other entries, so if execute should be
+ masked, we have to do it manually. */
+ if (acl_delete_perm(permset, ACL_EXECUTE) == ACL_ERROR) {
+ perror("apply_default_acl_ex (acl_delete_perm)");
+ result = ACL_ERROR;
+ goto cleanup;
+ }
+
+ if (acl_set_permset(entry, permset) == ACL_ERROR) {
+ perror("apply_default_acl_ex (acl_set_permset)");
+ result = ACL_ERROR;
+ goto cleanup;
}
}