summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavan T C <tcp@gluster.com>2011-09-09 08:22:34 +0530
committerAnand Avati <avati@gluster.com>2011-09-08 20:06:33 -0700
commit5b4537c70ea46cea055240584d2af9da96359169 (patch)
treee753d5d17f09e2d6e02781484e476d6f641962ee
parentf421ca932152c3a6102b19607d789dafdbe87ef1 (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: I4d3758389327c1aa78a0ebde0079c855503a3dd7 BUG: 3522 Reviewed-on: http://review.gluster.com/379 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
-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 8648485cf79..3a8325660f6 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -512,7 +512,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;
}