summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gresnel <31708810+agresnel@users.noreply.github.com>2017-09-09 11:44:55 -0700
committerMyles Borins <mylesborins@google.com>2017-11-28 13:09:53 +0900
commit8813867577fce95ec57bf3890cdb60a701316acc (patch)
tree80cc98ceb261810f2c137d3bf50615701c80c141
parentff66d636429149517050ed118b8b8392386875a2 (diff)
downloadnode-new-8813867577fce95ec57bf3890cdb60a701316acc.tar.gz
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>
-rw-r--r--doc/api/child_process.md3
-rw-r--r--lib/child_process.js1
2 files changed, 4 insertions, 0 deletions
diff --git a/doc/api/child_process.md b/doc/api/child_process.md
index b3484de576..c984004f94 100644
--- a/doc/api/child_process.md
+++ b/doc/api/child_process.md
@@ -304,6 +304,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
diff --git a/lib/child_process.js b/lib/child_process.js
index e0e81c8dec..96fd8404ca 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -54,6 +54,7 @@ exports.fork = function(modulePath /*, args, options*/) {
}
options.execPath = options.execPath || process.execPath;
+ options.shell = false;
return spawn(options.execPath, args, options);
};