All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xfstests-bld: correct file permissions on test appliance files
@ 2016-12-21 18:06 Eric Biggers
  2016-12-22 16:55 ` Theodore Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers @ 2016-12-21 18:06 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: fstests, Eric Biggers

From: Eric Biggers <ebiggers@google.com>

The xfstests-bld repository may have been cloned with a umask that
masked out the other bits.  When using --update-files in this situation
or when creating a GCE image, the VM ended up in a state where non-root
users were unable to execute anything, which made all tests using the
fsgqa user get skipped.  Fix this by copying the r and x group bits to
the other bits when creating files.tar.gz.  Also set the owner and group
to root while we're at it.

[v2: also fix gce-create-image]

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 kvm-xfstests/gce-xfstests                    | 3 ++-
 kvm-xfstests/kvm-xfstests                    | 3 ++-
 kvm-xfstests/test-appliance/gce-create-image | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/kvm-xfstests/gce-xfstests b/kvm-xfstests/gce-xfstests
index 04eee78..8839ea2 100755
--- a/kvm-xfstests/gce-xfstests
+++ b/kvm-xfstests/gce-xfstests
@@ -471,7 +471,8 @@ then
 	exit 1
     fi
     (cd "$DIR/test-appliance"; \
-     tar -X gce-exclude-files --exclude=etc -C files -cf - . | \
+     tar -X gce-exclude-files --exclude=etc -C files \
+		--owner=root --group=root --mode=o+g-w -cf - . | \
 	 gzip -9n > $LOCAL_FILES)
     get_local_hash "$LOCAL_FILES"
     get_remote_hash "$GS_FILES"
diff --git a/kvm-xfstests/kvm-xfstests b/kvm-xfstests/kvm-xfstests
index fbdae7a..bcada9e 100755
--- a/kvm-xfstests/kvm-xfstests
+++ b/kvm-xfstests/kvm-xfstests
@@ -75,7 +75,8 @@ then
 	exit 1
     fi
     (cd "$DIR/test-appliance"; \
-     tar -X kvm-exclude-files -C files -cf - . | \
+     tar -X kvm-exclude-files -C files \
+		--owner=root --group=root --mode=o+g-w -cf - . | \
 	 gzip -9n > "$TDIR/files.tar.gz")
     tar -r -f $VDH -C "$TDIR" files.tar.gz
     rm -rf "$TDIR"
diff --git a/kvm-xfstests/test-appliance/gce-create-image b/kvm-xfstests/test-appliance/gce-create-image
index 56366d1..005cc8e 100755
--- a/kvm-xfstests/test-appliance/gce-create-image
+++ b/kvm-xfstests/test-appliance/gce-create-image
@@ -87,7 +87,8 @@ then
     cat ../../*.ver > files/root/xfstests/git-versions
 fi
 
-tar -X gce-exclude-files -C files -cf - . | gzip -9n > $t
+tar -X gce-exclude-files -C files --owner=root --group=root --mode=o+g-w \
+	-cf - . | gzip -9n > $t
 GS_FILES_TARBALL=gs://$GS_BUCKET/files.tar.gz
 
 if test -f files/root/xfstests/git-versions
-- 
2.8.0.rc3.226.g39d4020


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

* Re: [PATCH v2] xfstests-bld: correct file permissions on test appliance files
  2016-12-21 18:06 [PATCH v2] xfstests-bld: correct file permissions on test appliance files Eric Biggers
@ 2016-12-22 16:55 ` Theodore Ts'o
  2016-12-28 21:07   ` Eric Biggers
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2016-12-22 16:55 UTC (permalink / raw)
  To: Eric Biggers; +Cc: fstests, Eric Biggers

On Wed, Dec 21, 2016 at 10:06:27AM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> The xfstests-bld repository may have been cloned with a umask that
> masked out the other bits.  When using --update-files in this situation
> or when creating a GCE image, the VM ended up in a state where non-root
> users were unable to execute anything, which made all tests using the
> fsgqa user get skipped.  Fix this by copying the r and x group bits to
> the other bits when creating files.tar.gz.  Also set the owner and group
> to root while we're at it.

Wouldn't it be better to use "--mode=go+u-w"?  This will solve the
problem for those people who use a umask of 077.

	    	  	     	 - Ted

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

* Re: [PATCH v2] xfstests-bld: correct file permissions on test appliance files
  2016-12-22 16:55 ` Theodore Ts'o
@ 2016-12-28 21:07   ` Eric Biggers
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Biggers @ 2016-12-28 21:07 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: fstests, Eric Biggers

On Thu, Dec 22, 2016 at 11:55:51AM -0500, Theodore Ts'o wrote:
> On Wed, Dec 21, 2016 at 10:06:27AM -0800, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@google.com>
> > 
> > The xfstests-bld repository may have been cloned with a umask that
> > masked out the other bits.  When using --update-files in this situation
> > or when creating a GCE image, the VM ended up in a state where non-root
> > users were unable to execute anything, which made all tests using the
> > fsgqa user get skipped.  Fix this by copying the r and x group bits to
> > the other bits when creating files.tar.gz.  Also set the owner and group
> > to root while we're at it.
> 
> Wouldn't it be better to use "--mode=go+u-w"?  This will solve the
> problem for those people who use a umask of 077.
> 
> 	    	  	     	 - Ted

Yes, you're correct.  I was thinking that the user and group permissions could
be different on the files, but actually git can only store mode 755 or 644, so
we might as well use go+u-w.  I'll send a revised patch.

Eric

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

end of thread, other threads:[~2016-12-28 21:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21 18:06 [PATCH v2] xfstests-bld: correct file permissions on test appliance files Eric Biggers
2016-12-22 16:55 ` Theodore Ts'o
2016-12-28 21:07   ` 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.