Commit 85d2faab authored by Rudolf Polzer's avatar Rudolf Polzer
Browse files

Fix auth prompt if stdin is unconnected.

The subprocess code calls pipe(), dups the pipe fd to 0 and then closes
the pipe. However, if fd 0 is unconnected, pipe() may generate fd 0 and
wreak havoc.

The updated code handles this case:

- If the write end is already 0, no dup2 and close needed for it.
- If the read end is 0, the dup2 of the write end onto 0 already closed it.
parent 1090b9fe
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