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
diff --git a/ui/build/sandbox_linux.go b/ui/build/sandbox_linux.go
index 98eb028..dab0e75 100644
--- a/ui/build/sandbox_linux.go
+++ b/ui/build/sandbox_linux.go
@@ -181,15 +181,15 @@
// 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",