summaryrefslogtreecommitdiffstats
path: root/xlators/system/posix-acl/src
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2018-08-07 09:30:37 +0800
committerAmar Tumballi <amarts@redhat.com>2018-08-27 03:26:02 +0000
commit7f89cff0cdc63c4b6734bd2e3c56ee0e70957813 (patch)
treee7ab52e6cbe64da957ab9ab853b1194f6695b668 /xlators/system/posix-acl/src
parent30e46a9b3cef868e5c781044c99c3d5b066d4760 (diff)
posix-acl: skip acl_permits check when the owner setting GF_POSIX_ACL_xxxx
Change-Id: Iaeea470d040587027f37e0760ae27c4fc205a189 fixes: bz#1613098 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'xlators/system/posix-acl/src')
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index ccede3b1e8b..dd01d3e0f38 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -2010,13 +2010,10 @@ setxattr_scrutiny (call_frame_t *frame, inode_t *inode, dict_t *xattr)
if (!ctx)
return EIO;
- if (dict_get (xattr, POSIX_ACL_ACCESS_XATTR)) {
- found = 1;
- if (!frame_is_user (frame, ctx->uid))
- return EPERM;
- }
-
- if (dict_get (xattr, POSIX_ACL_DEFAULT_XATTR)) {
+ if (dict_get (xattr, POSIX_ACL_ACCESS_XATTR) ||
+ dict_get (xattr, POSIX_ACL_DEFAULT_XATTR) ||
+ dict_get (xattr, GF_POSIX_ACL_ACCESS) ||
+ dict_get (xattr, GF_POSIX_ACL_DEFAULT)) {
found = 1;
if (!frame_is_user (frame, ctx->uid))
return EPERM;
@@ -2176,7 +2173,9 @@ posix_acl_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
if (op_errno != 0)
goto red;
- posix_acl_setxattr_update (this, loc->inode, xattr);
+ if (dict_get (xattr, POSIX_ACL_ACCESS_XATTR) ||
+ dict_get (xattr, POSIX_ACL_DEFAULT_XATTR))
+ posix_acl_setxattr_update (this, loc->inode, xattr);
/*
* inode is required in call back function to update the context
@@ -2214,7 +2213,9 @@ posix_acl_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
if (op_errno != 0)
goto red;
- posix_acl_setxattr_update (this, fd->inode, xattr);
+ if (dict_get (xattr, POSIX_ACL_ACCESS_XATTR) ||
+ dict_get (xattr, POSIX_ACL_DEFAULT_XATTR))
+ posix_acl_setxattr_update (this, fd->inode, xattr);
STACK_WIND (frame, posix_acl_fsetxattr_cbk,
FIRST_CHILD(this), FIRST_CHILD(this)->fops->fsetxattr,