tests: fix access mode of root inode of throw-away container images
authorLennart Poettering <lennart@poettering.net>
Wed, 27 Nov 2024 09:17:36 +0000 (10:17 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 27 Nov 2024 15:13:27 +0000 (00:13 +0900)
Otherwise the root inode will typically have what mkdtemp sets up, which
is something like 0700, which is weird and somewhat broken when trying
to look into containers from unpriv users.

test/units/util.sh

index 51e0ad1ec0e322985a02c40cfdb8c8c495ce52d2..7a39d4267e1b0bba2c2e3658bb2cbc8ba7d77703 100755 (executable)
@@ -182,6 +182,7 @@ create_dummy_container() {
     fi
 
     mkdir -p "$root"
+    chmod 555 "$root"
     cp -a /usr/share/TEST-13-NSPAWN-container-template/* "$root"
     coverage_create_nspawn_dropin "$root"
 }