Merge pull request #87414 from chkno/specify-shell-when-sudoing-to-user-with-unknown-shell

nixos/test-driver: Specify /bin/sh shell when running a bourne shell script as the user
This commit is contained in:
Florian Klink 2020-05-11 13:32:46 +02:00 committed by GitHub
commit b12c08ca88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -369,7 +369,7 @@ class Machine:
q = q.replace("'", "\\'")
return self.execute(
(
"su -l {} -c "
"su -l {} --shell /bin/sh -c "
"$'XDG_RUNTIME_DIR=/run/user/`id -u` "
"systemctl --user {}'"
).format(user, q)