From: Oleg Drokin Date: Tue, 29 Apr 2014 17:57:19 +0000 (+0000) Subject: Revert "LU-4924 llite: Only kill SGID/SUID bits" X-Git-Tag: 2.5.59~76 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=75df074297cfc8d73561eb4d8290b9d422c156c8 Revert "LU-4924 llite: Only kill SGID/SUID bits" Did not notice that this introduces 100% failure all in itself. This reverts commit 70c37954649fbc4fc2d0820d5d422f96144071f9. Change-Id: If27762e2ffa9afc3857446a733ee3a8751fe6292 Reviewed-on: http://review.whamcloud.com/10151 Reviewed-by: Oleg Drokin Tested-by: Oleg Drokin --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 8cf1e31..40961da 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1787,14 +1787,12 @@ int ll_setattr(struct dentry *de, struct iattr *attr) !(attr->ia_mode & S_ISGID)))) attr->ia_valid |= ATTR_FORCE; - if ((attr->ia_valid & ATTR_MODE) && - (mode & S_ISUID) && + if ((mode & S_ISUID) && !(attr->ia_mode & S_ISUID) && !(attr->ia_valid & ATTR_KILL_SUID)) attr->ia_valid |= ATTR_KILL_SUID; - if ((attr->ia_valid & ATTR_MODE) && - ((mode & (S_ISGID|S_IXGRP)) == (S_ISGID|S_IXGRP)) && + if (((mode & (S_ISGID|S_IXGRP)) == (S_ISGID|S_IXGRP)) && !(attr->ia_mode & S_ISGID) && !(attr->ia_valid & ATTR_KILL_SGID)) attr->ia_valid |= ATTR_KILL_SGID; diff --git a/lustre/tests/acl/4924.test b/lustre/tests/acl/4924.test deleted file mode 100644 index 9b8a0c2..0000000 --- a/lustre/tests/acl/4924.test +++ /dev/null @@ -1,13 +0,0 @@ -LU-4924 - chmod g+s, touch should not clear sgid bit - - $ mkdir 4924 - $ cd 4924 - $ touch f - $ chmod u=rwx,g=rwxs f - $ ls -l f | awk -- '{ print $1, $3, $4 }' - > -rwxrwsr-- root root - $ touch f - $ ls -l f | awk -- '{ print $1, $3, $4 }' - > -rwxrwsr-- root root - $ cd .. - $ rm -rf 4924 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 42d8eff..57fbe1a 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -6699,8 +6699,6 @@ test_103 () { run_acl_subtest 2561_zfs || error "LU-2561 zfs test failed" fi - run_acl_subtest 4924 || error "LU-4924 test failed" - cd $SAVE_PWD umask $SAVE_UMASK