]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic: Test SGID inheritance with default ACLs
authorJan Kara <jack@suse.cz>
Thu, 22 Jun 2017 13:28:28 +0000 (15:28 +0200)
committerEryu Guan <eguan@redhat.com>
Thu, 22 Jun 2017 15:25:32 +0000 (23:25 +0800)
Test that subdirectory properly inherits SGID bit even if parent
directory has default ACLs.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/444 [new file with mode: 0755]
tests/generic/444.out [new file with mode: 0644]
tests/generic/group

diff --git a/tests/generic/444 b/tests/generic/444
new file mode 100755 (executable)
index 0000000..ebafeb4
--- /dev/null
@@ -0,0 +1,71 @@
+#! /bin/bash
+# FS QA Test 444
+#
+# Check if SGID is inherited when creating a subdirectory when the owner is not
+# in the owning group and directory has default ACLs.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2017 SUSE Linux.  All Rights Reserved.
+#
+# Author: Jan Kara <jack@suse.cz>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       cd /
+       rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/attr
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_test
+_require_runas
+_require_acls
+
+cd $TEST_DIR
+
+TDIR=testdir.$seq
+
+# Create SGID directory with default ACLs
+rm -rf $TDIR
+mkdir $TDIR
+setfacl -d -m u:101:rwx $TDIR
+chown 100:100 $TDIR
+chmod 2755 $TDIR
+
+_runas -u 100 -g 100 -- mkdir $TDIR/testsub1
+stat -c %A $TDIR/testsub1
+_runas -u 100 -g 101 -- mkdir $TDIR/testsub2
+stat -c %A $TDIR/testsub2
+
+status=0
+exit
diff --git a/tests/generic/444.out b/tests/generic/444.out
new file mode 100644 (file)
index 0000000..5988b98
--- /dev/null
@@ -0,0 +1,3 @@
+QA output created by 444
+drwxrwsr-x
+drwxrwsr-x
index d414cbd30a7b60089e4002dfb39a05b0d8597f47..ced111cd97f6077f7fc31130a9fa3f45576a70d2 100644 (file)
 441 auto quick
 442 blockdev
 443 auto quick rw
+444 auto quick acl