Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly restoring channel's FDs nonblocking mode#246

Closed
wants to merge 3 commits into from

Conversation

beldmit
Copy link

@beldmit beldmit commented Apr 22, 2021

OpenSSH incorrectly restores the standard mode (blocking mode) on standard output upon exiting. This causes the next shell scripts commands to potentially fail in EAGAIN.
The reproducer is:

#!/bin/sh
(
ssh localhost true
cat /dev/zero
) | sleep 30

Restoring the blocking modes happens with the duped file descriptors and too late.

The changes causing this problem was introduced in 4d5456c
The previous patches was provided in #244

This is an alternate approach to fix this problem provided by Masaki Kimura

@djmdjm
Copy link
Contributor

djmdjm commented May 19, 2021

Thanks - a similar fix was committed in similar fix was

@djmdjm djmdjm closed this May 19, 2021
@djmdjm
Copy link
Contributor

djmdjm commented May 19, 2021

(err, truncated)

... committed in 7be4ac8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants