api: disable networking during execute

This commit is contained in:
Thomas Hobson 2021-02-21 14:56:07 +13:00
parent 2f64f23896
commit 8727a545c6
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
1 changed files with 2 additions and 2 deletions

View File

@ -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,