From 1612e2641e9056efaa0c98fba28c71960ef78daf Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Fri, 1 May 2020 16:26:56 -0700 Subject: [PATCH] nsjail: Always remount /tmp before src/out/dist A user was trying to use OUT_DIR=/tmp/...-out DIST_DIR=/tmp/...-dist Test: OUT_DIR=/tmp/test-out DIST_DIR=/tmp/test-dist m nothing Change-Id: I811cc8e1bda8d766406603df47309a8637cef48c --- ui/build/sandbox_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/build/sandbox_linux.go b/ui/build/sandbox_linux.go index 98eb028a8..dab0e756b 100644 --- a/ui/build/sandbox_linux.go +++ b/ui/build/sandbox_linux.go @@ -181,15 +181,15 @@ func (c *Cmd) wrapSandbox() { // For now, just map everything. Make most things readonly. "-R", "/", + // Mount a writable tmp dir + "-B", "/tmp", + // Mount source are read-write "-B", sandboxConfig.srcDir, //Mount out dir as read-write "-B", sandboxConfig.outDir, - // Mount a writable tmp dir - "-B", "/tmp", - // Disable newcgroup for now, since it may require newer kernels // TODO: try out cgroups "--disable_clone_newcgroup",