Closed
Description
At the moment an OpenHandler
can be provided to an interp.Runner
as a RunnerOption
.
When a process substitution creates a FIFO path it is created on the os filesystem; however, later operations sent to it treat it as a normal file sent to the OpenHandler
. This has a side effect that if the OpenHandler is mocked or is sandboxed in some way, that the open file for the process substitution's named pipe hangs because writes are going to the wrong file.
I would propose one of the following:
- Changing documentation such that users are specifically warned against sandboxing OpenHandler because of such scenarios
- Changing the https://github.com/mvdan/sh/blob/master/interp/runner.go#L107 and https://github.com/mvdan/sh/blob/master/interp/runner.go#L120 to use the
OpenHandler
instead of directly interacting with the OS, which may also involve a handler for removing the file - Provide a way to internally differentiate between Named Pipes and regular files before the
OpenHandler
is called.
Metadata
Metadata
Assignees
Labels
No labels