Skip to contentSkip to conversation

xfstests-bld: correct file permissions on test appliance files

PATCH Superseded Eric Biggers 2 participants 3 messages Dec 21, 2016 – Dec 28, 2016

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfstests-bld: correct file permissions on test appliance files

From: Eric Biggers <[email protected]>

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]

---
 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(-)
kvm-xfstests/gce-xfstests +2 -1
index 04eee78..8839ea2 100755
@@ -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"
kvm-xfstests/kvm-xfstests +2 -1
index fbdae7a..bcada9e 100755
@@ -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"
kvm-xfstests/test-appliance/gce-create-image +2 -1
index 56366d1..005cc8e 100755
@@ -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
Signature · 1 line
2.8.0.rc3.226.g39d4020
#1 lore raw
Quoted 9 lines · Eric Biggers

From: Eric Biggers <[email protected]>

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

#2 lore raw
Quoted 11 lines · Theodore Ts'o
Quoted 9 lines · Eric Biggers

From: Eric Biggers <[email protected]>

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.

Quoted 4 lines

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