Skip to content

Commit 607832d

Browse files
Alex Gresneljasnell
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 427bf80 commit 607832d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/api/child_process.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ output on this fd is expected to be line delimited JSON objects.
356356
*Note*: Unlike the fork(2) POSIX system call, `child_process.fork()` does
357357
not clone the current process.
358358

359+
*Note*: The `shell` option available in [`child_process.spawn()`][] is not
360+
supported by `child_process.fork()` and will be ignored if set.
361+
359362
### child_process.spawn(command[, args][, options])
360363
<!-- YAML
361364
added: v0.1.90

lib/child_process.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ exports.fork = function(modulePath /*, args, options*/) {
9595
}
9696

9797
options.execPath = options.execPath || process.execPath;
98+
options.shell = false;
9899

99100
return spawn(options.execPath, args, options);
100101
};

0 commit comments

Comments
 (0)