]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests/lsfd: skip executable mode tests when not running as root
authorThomas Weißschuh <thomas@t-8ch.de>
Thu, 26 Feb 2026 16:55:58 +0000 (17:55 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Thu, 26 Feb 2026 16:55:58 +0000 (17:55 +0100)
This test does not necessarily work without root.

Reported-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
tests/ts/lsfd/column-xmode

index 048be3b5db64c42c269d7207e7f2e6399016df6b..2a4ab0f16cb571d0e51442e06d9ab06b44a4ee5f 100755 (executable)
@@ -87,6 +87,8 @@ EXPR='(ASSOC == "mem") and (INODE == '"$INO"') and (MODE != "r--") and (MODE !=
 ts_init_subtest "MODE-x-bit"
 if [ "$QEMU_USER" == "1" ]; then
     ts_skip_subtest "running under qemu-user emulation"
+elif [ "$UID" != "0" ]; then
+    ts_skip_subtest "no root permissions"
 else
     {
        coproc MKFDS { "$TS_HELPER_MKFDS" ro-regular-file $FD; }
@@ -103,6 +105,8 @@ fi
 ts_init_subtest "XMODE-x-bit"
 if [ "$QEMU_USER" == "1" ]; then
     ts_skip_subtest "running under qemu-user emulation"
+elif [ "$UID" != "0" ]; then
+    ts_skip_subtest "no root permissions"
 else
     {
        coproc MKFDS { "$TS_HELPER_MKFDS" ro-regular-file $FD; }