haskell / process

Library for dealing with system processes
http://hackage.haskell.org/package/process
Other
87 stars 82 forks source link

cbits: Ensure that fork pipe doesn't shadow std fds #280

Closed bgamari closed 1 year ago

bgamari commented 1 year ago

Previously we would assume that the pipe used to communicate errors from the child back to the parent did not shadow the standard descriptors (stdin, stdout, and stderr). Somewhat surprisingly, this appears to hold most platforms. However, OpenBSD appears to be a notable exception.

Avoid relying on this assumption by duping the pipe fds until they end up out of the standard fd range.

Closes #266.

bgamari commented 1 year ago

Cc @blackgnezdo. It would be very much appreciated if you could test this.

bgamari commented 1 year ago

This has been superceded by #282.