Unverified Commit d09e1da6 authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Anna Henningsen
Browse files

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: https://github.com/nodejs/node/issues/31747

PR-URL: https://github.com/nodejs/node/pull/31768


Reviewed-By: default avatarSantiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarDavid Carlier <devnexen@gmail.com>
parent 0b49e2f3
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment