]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: hardcode shell to use
authorLennart Poettering <lennart@poettering.net>
Fri, 3 Jan 2020 17:25:51 +0000 (18:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 6 Jan 2020 12:25:33 +0000 (13:25 +0100)
let's make sure we always invoke our commands through /bin/sh, since
on some distros su will use /bin/nologin (or whatever is listed in
/etc/passwd) as shell otherwise and we don#t want that.

test/TEST-43-PRIVATEUSER-UNPRIV/testsuite.sh

index cd61dc95c9560edb0750f5bd9bbf1179ead585d5..158889888ef2662c021beff4217fc258f16daad9 100755 (executable)
@@ -7,7 +7,7 @@ systemd-analyze log-level debug
 runas() {
     declare userid=$1
     shift
-    su "$userid" -c 'XDG_RUNTIME_DIR=/run/user/$UID "$@"' -- sh "$@"
+    su "$userid" -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID exec "$@"' -- sh "$@"
 }
 
 runas nobody systemctl --user --wait is-system-running