]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (cramfs) make GID and mode use more robust
authorKarel Zak <kzak@redhat.com>
Wed, 2 Mar 2022 10:34:06 +0000 (11:34 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Mar 2022 10:34:06 +0000 (11:34 +0100)
We already use the same in tests/ts/cramfs/mkfs.

Addresses: https://github.com/util-linux/util-linux/issues/1613
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts/cramfs/doubles

index 8a1b7bb8865dab37a4ce74ce1d368f57f5f7a8c0..eb2c7fa0f13e3412a4ce75f75cd4813acc09c7b3 100755 (executable)
@@ -36,10 +36,17 @@ IMAGE_SRC="$TS_OUTDIR/${TS_TESTNAME}-data"
 ts_log "create mountpoint dir"
 [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT
 
-mkdir -p $IMAGE_SRC
+rm -rf "$IMAGE_SRC"
+mkdir -m 755 -p $IMAGE_SRC
+
+umask 133
+
 echo hello > $IMAGE_SRC/a
 echo hello > $IMAGE_SRC/b
 
+# sudo may use whatever group
+chgrp -R 0 "$IMAGE_SRC"
+
 ts_log "create cramfs image"
 $TS_CMD_MKCRAMFS $IMAGE_SRC $IMAGE_PATH >> $TS_OUTPUT 2>> $TS_ERRLOG
 [ -s "$IMAGE_PATH" ] || ts_die "Cannot create $IMAGE_PATH"