Skip to content

Commit 8813867

Browse files
Alex GresnelMylesBorins
Alex Gresnel
authored andcommitted
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: #15299 Fixes: #13983 PR-URL: #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>
1 parent ff66d63 commit 8813867

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/api/child_process.md

+3
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ output on this fd is expected to be line delimited JSON objects.
304304
*Note: Unlike the fork(2) POSIX system call, `child_process.fork()` does
305305
not clone the current process.*
306306

307+
*Note*: The `shell` option available in [`child_process.spawn()`][] is not
308+
supported by `child_process.fork()` and will be ignored if set.
309+
307310
### child_process.spawn(command[, args][, options])
308311
<!-- YAML
309312
added: v0.1.90

lib/child_process.js

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ exports.fork = function(modulePath /*, args, options*/) {
5454
}
5555

5656
options.execPath = options.execPath || process.execPath;
57+
options.shell = false;
5758

5859
return spawn(options.execPath, args, options);
5960
};

0 commit comments

Comments
 (0)