diff options
author | shishir gowda <shishirng@gluster.com> | 2011-07-13 03:31:47 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-13 03:00:17 -0700 |
commit | 843ffc77e0f1ba6cc1b2332f0a57e2fa339c9f4c (patch) | |
tree | 7174c9b62c0b801be838c01c899bbeec861f3b45 /xlators/system | |
parent | e89725cd62430addf09d9c1afbfb07d8c86b9ef0 (diff) |
access-control: Return mode part of NFS access control request
Signed-off-by: shishir gowda <shishirng@gluster.com>
Signed-off-by: Vijay Bellur <vijay@gluster.com>
BUG: 3057 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3057
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
Diffstat (limited to 'xlators/system')
-rw-r--r-- | xlators/system/posix-acl/src/posix-acl.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index f05ed3f95..3cd8c4812 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -221,19 +221,26 @@ mask_check: for (i = 0; i < acl->count; i++, ace++) { if (ace->tag != POSIX_ACL_MASK) continue; - if ((ace->perm & perm & want) == want) + if ((ace->perm & perm & want) == want) { + verdict = ace->perm & perm; goto green; + } goto red; } perm_check: - if ((perm & want) == want) + if ((perm & want) == want) { + verdict = perm & want; goto green; - else + } else { goto red; + } green: - verdict = 1; + if (!want) + verdict = 1; + if (!verdict) + verdict = want; goto out; red: verdict = 0; @@ -759,7 +766,7 @@ posix_acl_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int mask) int op_ret = 0; int op_errno = 0; int perm = 0; - + int mode = 0; if (mask & R_OK) perm |= POSIX_ACL_READ; @@ -773,7 +780,8 @@ posix_acl_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int mask) goto unwind; } - if (acl_permits (frame, loc->inode, perm)) { + mode = acl_permits (frame, loc->inode, perm); + if (mode) { op_ret = 0; op_errno = 0; } else { @@ -782,8 +790,10 @@ posix_acl_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int mask) } unwind: - STACK_UNWIND_STRICT (access, frame, op_ret, op_errno); - + if (__is_fuse_call (frame)) + STACK_UNWIND_STRICT (access, frame, op_ret, op_errno); + else + STACK_UNWIND_STRICT (access, frame, 0, mode); return 0; } |