tests: Ensure non-root users have access to libcap tools
authorSimon McVittie <smcv@collabora.com>
Mon, 27 Feb 2023 12:40:05 +0000 (12:40 +0000)
committerSimon McVittie <smcv@collabora.com>
Mon, 27 Feb 2023 12:40:05 +0000 (12:40 +0000)
On Debian systems, by default only root has /{usr/,}sbin in PATH.

Signed-off-by: Simon McVittie <smcv@collabora.com>
tests/libtest.sh

index 264094b1e3d7b90dd31c08863c6dddbcb8d0e02e..963bc923a3cbf24bf3f49888d5f1fda3924b4f0a 100755 (executable)
@@ -32,6 +32,9 @@ else
 fi
 . ${test_srcdir}/libtest-core.sh
 
+# Make sure /sbin/capsh etc. are in our PATH even if non-root
+PATH="$PATH:/usr/sbin:/sbin"
+
 # Array of expressions to execute when exiting. Each expression should
 # be a single string (quoting if necessary) that will be eval'd. To add
 # a command to run on exit, append to the libtest_exit_cmds array like