![]() We were using `cmd.Std{in,err,out}Pipe` and would then spin off goroutines to copy that data back and forth between the child process and the session. We would then concurrently call `cmd.Wait()` to wait for the process to exit. However, this interaction is documented as unsafe. ``` StdoutPipe returns a pipe that will be connected to the command's standard output when the command starts. Wait will close the pipe after seeing the command exit, so most callers need not close the pipe themselves. It is thus incorrect to call Wait before all reads from the pipe have completed. ``` Instead of doing that, take ownership of the pipe and explicitly close them when the session completes. Fixes #7601 Co-authored-by: Joe Tsai <joetsai@digital-static.net> Signed-off-by: Maisem Ali <maisem@tailscale.com> |
||
---|---|---|
.. | ||
incubator.go | ||
incubator_linux.go | ||
privs_test.go | ||
tailssh.go | ||
tailssh_test.go | ||
user.go |