Commit 6bacaef
committed
child_process: use module.exports.spawn in fork and execFile
`fork()` and `execFile()` call the locally-scoped `spawn()` function
directly, bypassing any wrapping applied to `child_process.spawn` via
module exports. This is inconsistent with `exec()`, which correctly
uses `module.exports.execFile()`.
APM tools, security monitors, and testing frameworks that wrap
`child_process.spawn` to intercept child process creation silently
miss processes spawned through `fork()` and `execFile()`.
Fix both functions to use `module.exports.spawn()`, consistent with
the existing `exec()` pattern.
Signed-off-by: Daniel Lando <daniel.sorridi@gmail.com>1 parent f1ed8d6 commit 6bacaef
File tree
2 files changed
+35
-2
lines changed- lib
- test/parallel
2 files changed
+35
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments