From 8727a545c635ed7ac174cf2c089a7e34b5a412ef Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 14:56:07 +1300 Subject: [PATCH] api: disable networking during execute --- api/src/executor/job.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 52792ac..b28589e 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -75,7 +75,7 @@ class Job { const compile = this.runtime.compiled && await new Promise((resolve, reject) => { var stdout = ''; var stderr = ''; - const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.files] ,{ + const proc = cp.spawn('unshare', ['-n', 'bash', path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.files] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, @@ -104,7 +104,7 @@ class Job { const run = await new Promise((resolve, reject) => { var stdout = ''; var stderr = ''; - const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'run'),this.main, ...this.args] ,{ + const proc = cp.spawn('unshare', ['-n', 'bash', path.join(this.runtime.pkgdir, 'run'),this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir,