From a408ffca469cdc4ae10ecf4d26a52c44917841b8 Mon Sep 17 00:00:00 2001 From: partouf Date: Fri, 21 Jan 2022 11:31:27 +0000 Subject: [PATCH] sandbox instead of exec --- lib/base-compiler.js | 2 +- lib/external-parsers/base.ts | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/base-compiler.js b/lib/base-compiler.js index 5b56cbac6..2b0c7143a 100644 --- a/lib/base-compiler.js +++ b/lib/base-compiler.js @@ -110,7 +110,7 @@ export class BaseCompiler { this.externalparser = null; if (this.compiler.externalparser && this.compiler.externalparser.id) { const externalparserclass = getExternalParserByKey(this.compiler.externalparser.id); - this.externalparser = new externalparserclass(this.compiler, this.env, this.exec); + this.externalparser = new externalparserclass(this.compiler, this.env, exec.sandbox); } if (!this.compiler.instructionSet) { diff --git a/lib/external-parsers/base.ts b/lib/external-parsers/base.ts index 1de513392..8c34d11c1 100644 --- a/lib/external-parsers/base.ts +++ b/lib/external-parsers/base.ts @@ -67,17 +67,13 @@ export class ExternalParserBase implements IExternalParser { public async objdumpAndParseAssembly(buildfolder: string, objdumpArgs: string[], filters: IParseFilters): Promise { const scriptFilepath = await this.writeStarterScriptObjdump(buildfolder, filters); - const execOptions = { - customCwd: buildfolder, - }; + const execOptions = {}; const execResult = await this.execFunc(scriptFilepath, objdumpArgs, execOptions); return this.parseAsmExecResult(execResult); } public async parseAssembly(filepath: string, filters: IParseFilters): Promise { - const execOptions = { - customCwd: path.dirname(filepath), - }; + const execOptions = {}; const parserArgs = this.getParserArguments(filters, false); parserArgs.push(filepath);