mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-06 12:58:22 +03:00
nspawn: Fix incorrect usage of putenv
strv_env_get only returns the environment variable value. putenv expects KEY=VALUE format strings. Use setenv instead to fix the use. (cherry picked from commit 6f646e01755df587bb33dae4ca78cdaad5721f5e) (cherry picked from commit b81504a3c76bfb3afd339cb74988892f9dccedd1) (cherry picked from commit 492a8b34178cf851ded4f23815d1182025bbbf8a) (cherry picked from commit d56055f47f5ba86e0f56126e364b1939d035001f)
This commit is contained in:
parent
8ca6e3dc71
commit
8504c6ee2a
@ -3167,7 +3167,7 @@ static int inner_child(
|
||||
* binary. */
|
||||
dollar_path = strv_env_get(env_use, "PATH");
|
||||
if (dollar_path) {
|
||||
if (putenv((char*) dollar_path) != 0)
|
||||
if (setenv("PATH", dollar_path, 1) < 0)
|
||||
return log_error_errno(errno, "Failed to update $PATH: %m");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user