All of lore.kernel.org
 help / color / mirror / Atom feed
* [xfstest-bld PATCH 1/2] test-appliance: add safety check for "gen-image --out-tar"
@ 2017-08-13 17:32 Theodore Ts'o
  2017-08-13 17:32 ` [xfstests-bld PATCH 2/2] Make the build and creation of xfstests.tar.gz to be reproducible Theodore Ts'o
  2017-08-16  3:40 ` [xfstest-bld PATCH 1/2] test-appliance: add safety check for "gen-image --out-tar" Eric Biggers
  0 siblings, 2 replies; 5+ messages in thread
From: Theodore Ts'o @ 2017-08-13 17:32 UTC (permalink / raw)
  To: fstests; +Cc: Theodore Ts'o

The gen-image script must not be run as root when generating a tar
file.  This is because it uses fakechroot and fakeroot, and if run as
root, the debootstrap script will end up damaging a large number of
devices in the /dev directory.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 kvm-xfstests/test-appliance/gen-image | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kvm-xfstests/test-appliance/gen-image b/kvm-xfstests/test-appliance/gen-image
index dbd9b84..e7bdb35 100755
--- a/kvm-xfstests/test-appliance/gen-image
+++ b/kvm-xfstests/test-appliance/gen-image
@@ -76,6 +76,10 @@ fi
 
 if test -n "$OUT_TAR" ; then
     if test "$FAKECHROOT" != "true" ; then
+	if test "$EUID" -eq 0 ; then
+	    echo "This script MUST NOT be run as root with --out_tar"
+	    exit 1;
+	fi
 	set -- "${SAVE_ARGS[@]}"
 	exec fakechroot $0 "$@"
     fi
-- 
2.11.0.rc0.7.gbe5a750


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-16 15:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-13 17:32 [xfstest-bld PATCH 1/2] test-appliance: add safety check for "gen-image --out-tar" Theodore Ts'o
2017-08-13 17:32 ` [xfstests-bld PATCH 2/2] Make the build and creation of xfstests.tar.gz to be reproducible Theodore Ts'o
2017-08-16  3:45   ` Eric Biggers
2017-08-16 15:02     ` Theodore Ts'o
2017-08-16  3:40 ` [xfstest-bld PATCH 1/2] test-appliance: add safety check for "gen-image --out-tar" Eric Biggers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.