jail: actually chdir into OCI defined CWD
authorDaniel Golle <daniel@makrotopia.org>
Mon, 13 Jul 2020 11:11:32 +0000 (12:11 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 13 Jul 2020 11:14:49 +0000 (12:14 +0100)
Current working directory was parsed by never applied. Apply it just
before executing user process.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/jail.c

index 5018fcc09fce13e6c22c3d161b3be0ef4e545def..1650534b1887ae16c85d6b0b6ce67801b50a480a 100644 (file)
@@ -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);