From 8c467584f6051bf59fc357b71b967adac8bda9a9 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sat, 15 Aug 2020 18:05:59 +0200 Subject: [PATCH] coverage.sh: check that xattrs are set in the original tarball --- coverage.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/coverage.sh b/coverage.sh index 1766003..aa23db9 100755 --- a/coverage.sh +++ b/coverage.sh @@ -530,6 +530,15 @@ sysctl -w kernel.unprivileged_userns_clone=1 # identical to a round trip through "taridshift X" and "taridshift -X" runuser -u user -- $CMD --mode=unshare --variant=apt --include=iputils-ping $DEFAULT_DIST - $mirror \ | ./taridshift 0 > /tmp/debian-chroot.tar +# make sure that xattrs are set in the original tarball +mkdir /tmp/debian-chroot +tar --xattrs --xattrs-include='*' --directory /tmp/debian-chroot -xf /tmp/debian-chroot.tar ./bin/ping +echo "/tmp/debian-chroot/bin/ping cap_net_raw=ep" > expected +getcap /tmp/debian-chroot/bin/ping | diff -u expected - +rm /tmp/debian-chroot/bin/ping +rmdir /tmp/debian-chroot/bin +rmdir /tmp/debian-chroot +# shift the uid/gid forward by 100000 and backward by 100000 ./taridshift 100000 < /tmp/debian-chroot.tar > /tmp/debian-chroot-shifted.tar ./taridshift -100000 < /tmp/debian-chroot-shifted.tar > /tmp/debian-chroot-shiftedback.tar # the tarball before and after the roundtrip through taridshift should be bit