From: Daniel Golle Date: Mon, 13 Jul 2020 11:11:32 +0000 (+0100) Subject: jail: actually chdir into OCI defined CWD X-Git-Url: http://git.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=83f4b72ab196d418b9b1edd0655a9a96acfa753b 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 --- 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);