diff options
author | Simon McVittie <smcv@collabora.com> | 2022-07-26 19:54:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-26 19:54:46 +0100 |
commit | 8af578d0888356be974cf934cd6b768ca3d670f8 (patch) | |
tree | 6997745f6123a8f585c0239bbd51a49758aeedcb | |
parent | 7d54d050a2ef24aa2a88a625ea43fc4ed5e54fd7 (diff) | |
parent | 2b4c4a789969d12baca17689911021ba88d7ed10 (diff) | |
download | bubblewrap-8af578d0888356be974cf934cd6b768ca3d670f8.tar.gz |
Merge pull request #510 from smcv/etc-shadow
Adjust tests related to /etc/shadow
-rwxr-xr-x | tests/test-run.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test-run.sh b/tests/test-run.sh index f25a9bc..da92ffb 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -39,9 +39,16 @@ for ALT in "" "--unshare-user-try" "--unshare-pid" "--unshare-user-try --unshare CAP="" fi - if ! ${is_uidzero} && $RUN $CAP $ALT --unshare-net --proc /proc --bind /etc/shadow /tmp/foo cat /etc/shadow; then + if ! cat /etc/shadow >/dev/null && + $RUN $CAP $ALT --unshare-net --proc /proc --bind /etc/shadow /tmp/foo cat /tmp/foo; then + assert_not_reached Could read /etc/shadow via /tmp/foo bind-mount + fi + + if ! cat /etc/shadow >/dev/null && + $RUN $CAP $ALT --unshare-net --proc /proc --bind /etc/shadow /tmp/foo cat /etc/shadow; then assert_not_reached Could read /etc/shadow fi + echo "ok - cannot read /etc/shadow with $ALT" # Unreadable dir if [ "x$UNREADABLE" != "x" ]; then |