From: Daan De Meyer Date: Sat, 1 Aug 2020 14:05:01 +0000 (+0100) Subject: nspawn: Fix incorrect usage of putenv X-Git-Tag: v247-rc1~470 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f646e01755df587bb33dae4ca78cdaad5721f5e;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 3b9493f232e..eb7c3321acc 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -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"); }