Fix file number re-use/clobber issues in LightProcess::proc_open
commitffde9f4f6bccd8df2feb5156a17d60d59ad84f9f
authorFred Emmott <fe@fb.com>
Fri, 15 May 2020 00:16:10 +0000 (14 17:16 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 15 May 2020 00:18:49 +0000 (14 17:18 -0700)
tree1df3978bb4947d9001d0d54f59eb45349bb848a7
parentdb4c49b00b72bc9245e49d412a34b2ac7bed03da
Fix file number re-use/clobber issues in LightProcess::proc_open

Summary:
Reuses the code from the new fork_and_execve function.

- prevents re-use issues
- closes all FDs other than those specifically requested

Reviewed By: dneiter

Differential Revision: D21481037

fbshipit-source-id: a81a94d65b348dcc3505268a3d6893d7d1a8f7db
hphp/test/slow/ext_process/no_stdin.php [new file with mode: 0644]
hphp/test/slow/ext_process/no_stdin.php.expect [new file with mode: 0644]
hphp/test/slow/ext_process/no_stdin.php.ini [new file with mode: 0644]
hphp/util/light-process.cpp
hphp/util/process.cpp