Commit f223d2c
src: fix spawnSync CHECK when SIGKILL fails
We might not have sufficient privileges to signal the child process
so don't make assumptions about the return value of `uv_process_kill()`.
Example:
node -e 'child_process.spawnSync("sudo", ["ls"], { maxBuffer: 1 })'
No test because:
1. The test needs to run as root (can't invoke sudo), and
2. The parent needs to drop privileges but can't, because
then the child process won't have sufficient privileges.
Fixes: #31747
PR-URL: #31768
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>1 parent d3c9a82 commit f223d2c
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
611 | | - | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
612 | 613 | | |
613 | 614 | | |
614 | 615 | | |
| |||
0 commit comments