Skip to content

Commit

Permalink
fix(util): make process.chdir empty function in sandbox
Browse files Browse the repository at this point in the history
Closes #1427
  • Loading branch information
chemzqm committed Mar 17, 2020
1 parent d36b410 commit 44b556a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const Module: IModule = require('module')
const REMOVED_GLOBALS = [
'reallyExit',
'abort',
'chdir',
'umask',
'setuid',
'setgid',
Expand Down Expand Up @@ -138,6 +137,8 @@ function createSandbox(filename: string, logger: Logger): ISandbox {
REMOVED_GLOBALS.forEach(name => {
sandbox.process[name] = removedGlobalStub(name)
})
// tslint:disable-next-line: no-empty
sandbox.process['chdir'] = () => { }

// read-only umask
sandbox.process.umask = (mask: number) => {
Expand Down

0 comments on commit 44b556a

Please sign in to comment.