projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d0f831
)
jail: consider PATH for argv in OCI container
author
Daniel Golle
<
[email protected]
>
Mon, 13 Jul 2020 02:00:22 +0000
(
03:00
+0100)
committer
Daniel Golle
<
[email protected]
>
Mon, 13 Jul 2020 11:14:49 +0000
(12:14 +0100)
Signed-off-by: Daniel Golle <
[email protected]
>
jail/jail.c
patch
|
blob
|
history
diff --git
a/jail/jail.c
b/jail/jail.c
index aa9285c88dc896743a11583fc0dd20a71c59ef56..5018fcc09fce13e6c22c3d161b3be0ef4e545def 100644
(file)
--- 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);