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

Restore nonblock #244

Closed
wants to merge 3 commits into from
Closed

Restore nonblock #244

wants to merge 3 commits into from

Conversation

beldmit
Copy link

@beldmit beldmit commented Apr 9, 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

We introduce storing the real blocking state of the file descriptors and restoring it on closing the fds.
We also remove the too late restoring of the blocking mode

@djmdjm
Copy link
Contributor

djmdjm commented Jun 4, 2021

A fix for this was committed in 7be4ac8

@djmdjm djmdjm closed this Jun 4, 2021
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