From e27c4da87295a210e77ca13ff23a24078abc25c0 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Wed, 13 Jul 2011 03:33:47 +0000 Subject: access-control: Handle F_OK in perm check, and O_APPEND, O_TRUNC in open Signed-off-by: shishir gowda Signed-off-by: Anand Avati BUG: 3057 (acl permissions don't work on nfs mount) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3057 BUG: 3057 (acl permissions don't work on nfs mount) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3057 --- xlators/system/posix-acl/src/posix-acl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/system') 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: -- cgit