Implement linux sandboxing with nsjail

This really only initializes the sandbox, it does not attempt to change
the view of the filesystem, nor does it turn off networking.

Bug: 122270019
Test: m
Test: trigger nsjail check failure; lunch; m; cat out/soong.log
Test: USE_GOMA=true m libc
Change-Id: Ib291072dcee8247c7a15f5b6831295ead6e4fc22
This commit is contained in:
Dan Willemsen
2019-01-02 12:24:44 -08:00
parent 073941d780
commit 63663c6bc9
3 changed files with 151 additions and 16 deletions

View File

@@ -59,6 +59,7 @@ func runNinja(ctx Context, config Config) {
"-w", "missingdepfile=err")
cmd := Command(ctx, config, "ninja", executable, args...)
cmd.Sandbox = ninjaSandbox
if config.HasKatiSuffix() {
cmd.Environment.AppendFromKati(config.KatiEnvFile())
}