diff --git a/src/exec.c b/src/exec.c index e02675c..7a6bf5c 100644 --- a/src/exec.c +++ b/src/exec.c @@ -519,9 +519,8 @@ int hyper_enter_container(struct hyper_pod *pod, /* TODO: wait for container finishing setup root */ chdir("/"); - if (hyper_setup_env(c->exec.envs, c->exec.envs_num) < 0) - goto out; - ret = hyper_setup_env(exec->envs, exec->envs_num); + // TODO: let the hyperd do it (merging the env) when needed. + ret = hyper_setup_env(c->exec.envs, c->exec.envs_num); out: close(ipcns); close(utsns); @@ -596,6 +595,12 @@ static int hyper_do_exec_cmd(void *data) goto exit; } + // set the container env + if (hyper_setup_env(exec->envs, exec->envs_num) < 0) { + fprintf(stderr, "setup env failed\n"); + goto exit; + } + if (hyper_dup_exec_tty(exec) < 0) { fprintf(stderr, "dup pts to exec stdio failed\n"); goto exit;