From 5c20eb3bbf870edadd22d06babb5d38dad222533 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Tue, 5 Jul 2011 03:41:51 +0000 Subject: access-control: Save group permissions returned from backend The backend permissions returned in stat for group is already masked value. Use the xattr value Signed-off-by: shishir gowda Signed-off-by: Vijay Bellur BUG: 3102 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3102 --- xlators/system/posix-acl/src/posix-acl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'xlators/system/posix-acl/src/posix-acl.c') diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index 3cd8c4812c3..1c7ef573319 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -155,6 +155,7 @@ acl_permits (call_frame_t *frame, inode_t *inode, int want) int i = 0; int perm = 0; int found = 0; + int acl_present = 0; conf = frame->this->private; @@ -173,6 +174,9 @@ acl_permits (call_frame_t *frame, inode_t *inode, int want) ace = acl->entries; + if (acl->count > 3) + acl_present = 1; + for (i = 0; i < acl->count; i++) { switch (ace->tag) { case POSIX_ACL_USER_OBJ: @@ -186,7 +190,10 @@ acl_permits (call_frame_t *frame, inode_t *inode, int want) goto mask_check; break; case POSIX_ACL_GROUP_OBJ: - perm = ((ctx->perm & S_IRWXG) >> 3); + if (acl_present) + perm = ace->perm; + else + perm = ((ctx->perm & S_IRWXG) >> 3); if (frame_in_group (frame, ctx->gid)) { found = 1; if ((perm & want) == want) -- cgit