From: Vivek Goyal <vgoyal@redhat.com>
To: fstests <fstests@vger.kernel.org>, linux-unionfs@vger.kernel.org
Cc: Amir Goldstein <amir73il@gmail.com>, Miklos Szeredi <miklos@szeredi.hu>
Subject: [PATCH] xfstests: overlay: Do not lose security.capability xattr over metadata only file copy-up
Date: Wed, 30 Jan 2019 11:32:47 -0500 [thread overview]
Message-ID: <20190130163247.GB2757@redhat.com> (raw)
Extend test 064 to check security.capability xattr is not lost over copy-up
of a metadata only file. This requires mounting overlay with option
metacopy=on and first trigger metadata only copy-up and then trigger
data copy-up.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
tests/overlay/064 | 18 ++++++++++++++++++
tests/overlay/064.out | 1 +
2 files changed, 19 insertions(+)
Index: xfstests-dev/tests/overlay/064
===================================================================
--- xfstests-dev.orig/tests/overlay/064 2019-01-28 15:03:12.590434802 -0500
+++ xfstests-dev/tests/overlay/064 2019-01-30 11:18:29.595591985 -0500
@@ -55,6 +55,24 @@ $XFS_IO_PROG -c "stat" ${SCRATCH_MNT}/fi
# Make sure cap_setuid is still there
$GETCAP_PROG ${SCRATCH_MNT}/file | _filter_scratch
+# Test copy-up with metacopy on.
+$UMOUNT_PROG $SCRATCH_MNT
+_scratch_mkfs
+echo "This is lower" >> ${lowerdir}/file
+
+# Set CAP_SETUID
+$SETCAP_PROG cap_setuid+ep ${lowerdir}/file
+_scratch_mount "-o metacopy=on"
+
+# Trigger metadata only copy-up
+chmod 000 ${SCRATCH_MNT}/file
+
+# Trigger data copy-up
+$XFS_IO_PROG -c "stat" ${SCRATCH_MNT}/file >>$seqres.full
+
+# Make sure cap_setuid is still there
+$GETCAP_PROG ${SCRATCH_MNT}/file | _filter_scratch
+
# success, all done
status=0
exit
Index: xfstests-dev/tests/overlay/064.out
===================================================================
--- xfstests-dev.orig/tests/overlay/064.out 2019-01-28 15:03:12.590434802 -0500
+++ xfstests-dev/tests/overlay/064.out 2019-01-30 11:21:11.745591985 -0500
@@ -1,2 +1,3 @@
QA output created by 064
SCRATCH_MNT/file = cap_setuid+ep
+SCRATCH_MNT/file = cap_setuid+ep
next reply other threads:[~2019-01-30 16:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 16:32 Vivek Goyal [this message]
2019-01-30 17:58 ` [PATCH] xfstests: overlay: Do not lose security.capability xattr over metadata only file copy-up Amir Goldstein
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=20190130163247.GB2757@redhat.com \
--to=vgoyal@redhat.com \
--cc=amir73il@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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