From: Christoph Hellwig <hch@lst.de>
To: fstests@vger.kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH] xfs: add a new test for removing ACLs through the attr interface
Date: Tue, 7 Jan 2020 17:52:55 +0100 [thread overview]
Message-ID: <20200107165255.261877-1-hch@lst.de> (raw)
Test that removing the SGI_ACL_FILE attr also removes the cached ACL
used for access control checking.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
tests/xfs/666 | 58 +++++++++++++++++++++++++++++++++++++++++++++++
tests/xfs/666.out | 7 ++++++
tests/xfs/group | 1 +
3 files changed, 66 insertions(+)
create mode 100755 tests/xfs/666
create mode 100644 tests/xfs/666.out
diff --git a/tests/xfs/666 b/tests/xfs/666
new file mode 100755
index 00000000..00d3cbc1
--- /dev/null
+++ b/tests/xfs/666
@@ -0,0 +1,58 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Christoph Hellwig
+#
+# FS QA Test 666
+#
+# Ensure that removing the access ACL through the XFS-specific attr name removes
+# the cached ACL as well
+#
+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 $FILE
+}
+
+# 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
+_require_user
+
+FILE=$TEST_DIR/foo
+
+echo "This is a test" > ${FILE}
+chmod g-r $FILE
+chmod o-r $FILE
+chmod u-r $FILE
+
+echo "No ACL: "
+_user_do "cat $FILE"
+
+echo "With ACL: "
+setfacl -m u:$qa_user:r $FILE
+_user_do "cat $FILE"
+
+echo "ACL Removed through attr:"
+setfattr -x trusted.SGI_ACL_FILE ${FILE}
+_user_do "cat $FILE"
+
+status=0
+exit
diff --git a/tests/xfs/666.out b/tests/xfs/666.out
new file mode 100644
index 00000000..bd45c3ef
--- /dev/null
+++ b/tests/xfs/666.out
@@ -0,0 +1,7 @@
+QA output created by 666
+No ACL:
+Permission denied
+With ACL:
+This is a test
+ACL Removed through attr:
+Permission denied
diff --git a/tests/xfs/group b/tests/xfs/group
index c7253cf1..6af5171e 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -509,3 +509,4 @@
509 auto ioctl
510 auto ioctl quick
511 auto quick quota
+666 auto quick acl attr
--
2.24.1
reply other threads:[~2020-01-07 16:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200107165255.261877-1-hch@lst.de \
--to=hch@lst.de \
--cc=fstests@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).