1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-27 01:57:35 +03:00

tests: use setfacl to give $SUDO_USER read permissions on artifacts

We have to invoke the tests as superuser, and not being able to read
the journal as the invoking user is annoying. I don't think there are
any security considerations here, since the invoking user can already
put arbitrary code in the Makefile and test scripts which get executed
with root privileges.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-04-20 17:47:50 +02:00
parent 778139c6e4
commit 954c77c251

View File

@ -2393,6 +2393,12 @@ do_test() {
import_testdir
import_initdir
if [ -n "${SUDO_USER}" ]; then
ddebug "Making ${TESTDIR:?} readable for ${SUDO_USER} (acquired from sudo)"
setfacl -m "user:${SUDO_USER:?}:r-X" "${TESTDIR:?}"
setfacl -d -m "user:${SUDO_USER:?}:r-X" "${TESTDIR:?}"
fi
testname="$(basename "$PWD")"
while (($# > 0)); do