summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle2020-07-13 11:11:32 +0000
committerDaniel Golle2020-07-13 11:14:49 +0000
commit83f4b72ab196d418b9b1edd0655a9a96acfa753b (patch)
tree720eef0b1dd37f08647f3b4f57eee6e10b52afc6
parent42a6217d42f9305f5b25a93188fed480ae4abc3d (diff)
downloadprocd-83f4b72ab196d418b9b1edd0655a9a96acfa753b.tar.gz
jail: actually chdir into OCI defined CWD
Current working directory was parsed by never applied. Apply it just before executing user process. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--jail/jail.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/jail/jail.c b/jail/jail.c
index 5018fcc..1650534 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -710,6 +710,9 @@ static int exec_jail(void *pipes_ptr)
if (!envp)
exit(EXIT_FAILURE);
+ if (opts.cwd && chdir(opts.cwd))
+ exit(EXIT_FAILURE);
+
if (opts.ociseccomp && applyOCIlinuxseccomp(opts.ociseccomp))
exit(EXIT_FAILURE);