All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: fstests@vger.kernel.org
Subject: Re: [xfstest-bld PATCH 1/2] test-appliance: add safety check for "gen-image --out-tar"
Date: Tue, 15 Aug 2017 20:40:13 -0700	[thread overview]
Message-ID: <20170816034013.GB1417@zzz.localdomain> (raw)
In-Reply-To: <20170813173224.28900-1-tytso@mit.edu>

On Sun, Aug 13, 2017 at 01:32:23PM -0400, Theodore Ts'o wrote:
> 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

Reviewed-by: Eric Biggers <ebiggers@google.com>

      parent reply	other threads:[~2017-08-16  3:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Eric Biggers [this message]

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=20170816034013.GB1417@zzz.localdomain \
    --to=ebiggers3@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 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.