Restoring block mode on exiting
dbelyavs at redhat.com
Fri Apr 23 01:36:21 AEST 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:
ssh localhost true
) | sleep 30
Restoring the blocking modes happens with the duped file descriptors and
The changes causing this problem was introduced in
The 2 possible fixes can be found in
https://github.com/openssh/openssh-portable/pull/244 (adhoc patch) and
https://github.com/openssh/openssh-portable/pull/246 (more robust one).
I think it's worth fixing the issue in this, that or any other way.
I'll be happy to adopt any of those patches to the state when they become
suitable for upstream.
Many thanks in advance!
More information about the openssh-unix-dev