summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-07-08 02:37:05 +0000
committerAnand Avati <avati@gluster.com>2011-07-08 10:24:15 -0700
commit8236cf1775f5db918a951773628b35080fed1de1 (patch)
treef37c57a3ad23161b179451ce385ca86a77982370
parentbd2bb5b01ab1e582d5f400934a62397645dd9441 (diff)
access-control: Handle F_OK in perm check, and O_APPEND, O_TRUNC in open
Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3057 (acl permissions don't work on nfs mount) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3057
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index 96cdf0882..8e6a750b3 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -779,6 +779,9 @@ posix_acl_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int mask)
perm |= POSIX_ACL_WRITE;
if (mask & X_OK)
perm |= POSIX_ACL_EXECUTE;
+ if (!mask) {
+ goto unwind;
+ }
if (!perm) {
op_ret = -1;
op_errno = EINVAL;
@@ -871,6 +874,8 @@ posix_acl_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
perm = POSIX_ACL_READ;
break;
case O_WRONLY:
+ case O_APPEND:
+ case O_TRUNC:
perm = POSIX_ACL_WRITE;
break;
case O_RDWR: