diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-07-26 17:16:00 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-08-09 09:38:37 -0700 |
commit | a1d071374365a10ebef508c38c39f61da0a0f855 (patch) | |
tree | 11ef50220d985acfb2dcc12a76b4346ee02d3dc2 /xlators | |
parent | 475efecfba7194c598a94879852bcd37ac2deb5d (diff) |
acl: enable handling of FMODE_EXEC flag
on linux systems, with open(), we can get below flag as per
'linux/fs.h'.
/* File is opened for execution with sys_execve / sys_uselib */
'#define FMODE_EXEC ((fmode_t)0x20)'
Instead of adding '#include <linux/fs.h>, its better to copy this
absolute number into other variable because then we have to deal
with declaring fmode_t etc etc..
With the fix, we can handle the file with '0711' permissions in
the same way as backend linux filesystems.
Change-Id: Ib1097fc0d2502af89c92d561eb4123cba15713f5
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 843960
Reviewed-on: http://review.gluster.com/3746
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/system/posix-acl/src/posix-acl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index f2fe7d9c4c5..11653c9230f 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -919,6 +919,13 @@ posix_acl_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, switch (flags & O_ACCMODE) { case O_RDONLY: perm = POSIX_ACL_READ; + + /* If O_FMODE_EXEC is present, its good enough + to have '--x' perm, and its not covered in + O_ACCMODE bits */ + if (flags & O_FMODE_EXEC) + perm = POSIX_ACL_EXECUTE; + break; case O_WRONLY: case O_APPEND: |