From 328398ff7bff9471589c288f2281fd118a079def Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Thu, 19 Jan 2017 17:52:37 +0000 Subject: [PATCH] Clear the environment before setting container environment. This ensures that there are no erroneous env variables left over by any subsystem before the container and process specific env variables are applied. Signed-off-by: Archana Shinde --- src/exec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/exec.c b/src/exec.c index 6af59fe0..3e8015bd 100644 --- a/src/exec.c +++ b/src/exec.c @@ -510,6 +510,9 @@ static int hyper_do_exec_cmd(struct hyper_exec *exec, int pipe, struct stdio_con goto out; } + // Make sure we start with a clean environment + clearenv(); + // set early env. the container env config can overwrite it setenv("HOME", "/root", 1); setenv("HOSTNAME", exec->pod->hostname, 1);