1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-26 08:55:18 +03:00

run: make --working-directory= work for --scope too

This sounds like a more user-friendly alternative to #24780

(cherry picked from commit fecc447766)
(cherry picked from commit c948091cc5)
This commit is contained in:
Lennart Poettering 2022-09-22 14:21:46 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 40766f6a48
commit 3f074e438a

View File

@ -1531,6 +1531,9 @@ static int start_transient_scope(sd_bus *bus) {
return log_error_errno(errno, "Failed to change UID to " UID_FMT ": %m", uid);
}
if (arg_working_directory && chdir(arg_working_directory) < 0)
return log_error_errno(errno, "Failed to change directory to '%s': %m", arg_working_directory);
env = strv_env_merge(environ, user_env, arg_environment);
if (!env)
return log_oom();