From 6f646e01755df587bb33dae4ca78cdaad5721f5e Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 1 Aug 2020 15:05:01 +0100 Subject: [PATCH] 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. --- src/nspawn/nspawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); } -- 2.47.3