diff options
| author | Daniel Golle | 2020-07-13 02:00:22 +0000 |
|---|---|---|
| committer | Daniel Golle | 2020-07-13 11:14:49 +0000 |
| commit | 42a6217d42f9305f5b25a93188fed480ae4abc3d (patch) | |
| tree | 6d44f1bae20a748230ec4cf99ae19b1a1ceaa6ea | |
| parent | 9d0f83183400be105bd3cd8b9530d6eb9d678e0d (diff) | |
| download | procd-42a6217d42f9305f5b25a93188fed480ae4abc3d.tar.gz | |
jail: consider PATH for argv in OCI container
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
| -rw-r--r-- | jail/jail.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/jail/jail.c b/jail/jail.c index aa9285c..5018fcc 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -714,7 +714,11 @@ static int exec_jail(void *pipes_ptr) exit(EXIT_FAILURE); INFO("exec-ing %s\n", *opts.jail_argv); - execve(*opts.jail_argv, opts.jail_argv, envp); + if (opts.envp) /* respect PATH if potentially set in ENV */ + execvpe(*opts.jail_argv, opts.jail_argv, envp); + else + execve(*opts.jail_argv, opts.jail_argv, envp); + /* we get there only if execve fails */ ERROR("failed to execve %s: %m\n", *opts.jail_argv); exit(EXIT_FAILURE); |