Add patch to ensure capsh is found in tests' PATH
authorSimon McVittie <smcv@debian.org>
Mon, 27 Feb 2023 12:42:41 +0000 (12:42 +0000)
committerSimon McVittie <smcv@debian.org>
Mon, 27 Feb 2023 12:42:41 +0000 (12:42 +0000)
Closes: #1031353
debian/patches/series
debian/patches/tests-Ensure-non-root-users-have-access-to-libcap-tools.patch [new file with mode: 0644]

index d9efcb28c5d8023516cfad055201154be043a5e5..72667ff8edaff4518603963b2e2ef8458cddb691 100644 (file)
@@ -1,2 +1,3 @@
+tests-Ensure-non-root-users-have-access-to-libcap-tools.patch
 debian/Skip-test-pull-repeated-during-CI.patch
 debian/test-sysroot-Skip-on-s390x-by-default.patch
diff --git a/debian/patches/tests-Ensure-non-root-users-have-access-to-libcap-tools.patch b/debian/patches/tests-Ensure-non-root-users-have-access-to-libcap-tools.patch
new file mode 100644 (file)
index 0000000..2907b07
--- /dev/null
@@ -0,0 +1,26 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 27 Feb 2023 12:40:05 +0000
+Subject: tests: Ensure non-root users have access to libcap tools
+
+On Debian systems, by default only root has /{usr/,}sbin in PATH.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/ostreedev/ostree/pull/2821
+---
+ tests/libtest.sh | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tests/libtest.sh b/tests/libtest.sh
+index 264094b..963bc92 100755
+--- a/tests/libtest.sh
++++ b/tests/libtest.sh
+@@ -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