Bug 3310 - Correctly restoring channel's FDs nonblocking mode
Summary: Correctly restoring channel's FDs nonblocking mode
Status: CLOSED DUPLICATE of bug 3280
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 8.6p1
Hardware: Other Linux
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-11 17:55 AEST by Dmitry Belyavskiy
Modified: 2022-02-25 13:57 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Belyavskiy 2021-05-11 17:55:34 AEST
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 PR intended to fix the issue is https://github.com/openssh/openssh-portable/pull/246
Comment 1 Damien Miller 2021-05-19 11:19:41 AEST

*** This bug has been marked as a duplicate of bug 3280 ***
Comment 2 Damien Miller 2022-02-25 13:57:59 AEDT
closing bugs resolved before openssh-8.9