Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 328398f

Browse files
committed
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 <archana.m.shinde@intel.com>
1 parent 3c4448c commit 328398f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/exec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ static int hyper_do_exec_cmd(struct hyper_exec *exec, int pipe, struct stdio_con
510510
goto out;
511511
}
512512

513+
// Make sure we start with a clean environment
514+
clearenv();
515+
513516
// set early env. the container env config can overwrite it
514517
setenv("HOME", "/root", 1);
515518
setenv("HOSTNAME", exec->pod->hostname, 1);

0 commit comments

Comments
 (0)