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.
This commit is contained in:
Daan De Meyer
2020-08-03 09:58:05 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 825cba0d43
commit 6f646e0175
+1 -1
View File
@@ -3259,7 +3259,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");
}