summaryrefslogtreecommitdiffstats
path: root/xlators/system/posix-acl/src
diff options
context:
space:
mode:
authorPavan T C <tcp@gluster.com>2011-09-07 18:05:57 +0530
committerAnand Avati <avati@gluster.com>2011-09-08 00:20:21 -0700
commit51138e1cbf602e16011768040440cf829367c40c (patch)
treed2c30265253a102914c8fb2b49f47ee4a30bb013 /xlators/system/posix-acl/src
parent7d4560cbcdcae0d74cf486c544d5eb58775da51f (diff)
Save the mode flags set by the application when ACLs are in use
While inheriting the ACLs from a directory that has default ACLs, make sure that the mode flags set by the application are saved. It is required to inherit only the Read, Write and Execute permissions while leaving the others viz. setuid, setgid and sticky bit untouched hence honouring the requests made by the application during create operations (mknod, mkdir et al). For a description of the problem, root cause and evaluation, refer: http://bugs.gluster.com/show_bug.cgi?id=3522 Change-Id: I994077fb321a35d8254f0cc5a7de99a17ec40c47 BUG: 3522 Reviewed-on: http://review.gluster.com/368 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/system/posix-acl/src')
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index d695f6200..cd6fa11bb 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -509,7 +509,8 @@ posix_acl_inherit_mode (struct posix_acl *acl, mode_t modein)
mode &= (group_ce->perm << 3) | ~S_IRWXG;
}
- newmode = ((modein & S_IFMT) | (mode & (S_IRWXU|S_IRWXG|S_IRWXO)));
+ newmode = ((modein & (S_IFMT | S_ISUID | S_ISGID | S_ISVTX)) |
+ (mode & (S_IRWXU|S_IRWXG|S_IRWXO)));
return newmode;
}