child_process: set shell to false in fork()

This commit ensures that spawn()'s shell option is unconditionally
set to false when fork() is called.

Refs: https://github.com/nodejs/node/pull/15299
Fixes: https://github.com/nodejs/node/issues/13983
PR-URL: https://github.com/nodejs/node/pull/15352
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Alex Gresnel 2017-09-09 11:44:55 -07:00 committed by cjihrig
parent b8d532c4bd
commit ed2f347f27
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
2 changed files with 4 additions and 0 deletions

View File

@ -356,6 +356,9 @@ output on this fd is expected to be line delimited JSON objects.
*Note*: Unlike the fork(2) POSIX system call, `child_process.fork()` does
not clone the current process.
*Note*: The `shell` option available in [`child_process.spawn()`][] is not
supported by `child_process.fork()` and will be ignored if set.
### child_process.spawn(command[, args][, options])
<!-- YAML
added: v0.1.90

View File

@ -93,6 +93,7 @@ exports.fork = function(modulePath /*, args, options*/) {
}
options.execPath = options.execPath || process.execPath;
options.shell = false;
return spawn(options.execPath, args, options);
};