bugzilla-daemon at bugzilla.mindrot.org
2017-Oct-22 20:21 UTC
[Bug 2797] New: ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
Bug ID: 2797
Summary: ssh swallows end-of-file on output
Product: Portable OpenSSH
Version: 7.6p1
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5
Component: ssh
Assignee: unassigned-bugs at mindrot.org
Reporter: openssh at davidnewall.com
Ssh duplicates FILENO_STDOUT and FILENO_STDERR, thus there are two
descriptors for each of those files. When the remote program closes
its stdout or stderr, the remote sshd sends the appropriate message to
the local ssh which responds by closing the duplicate descriptor, but
the original descriptor remains open. A program reading from ssh's
stdout (or stderr) cannot tell that the remote program has closed the
file.
This is what should happen:
$ sh -c 'exec cat >&- 2>&-; sleep 5' | { read s || echo
eof; }
eof
[then 5 second pause]
This is what happens using ssh:
$ ssh localhost 'exec >&- 2>&-; sleep 5' | { read s ||
echo eof; }
[5 second pause]
eof
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Oct-22 23:04 UTC
[Bug 2797] ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |djm at mindrot.org
--- Comment #1 from Damien Miller <djm at mindrot.org> ---
Created attachment 3073
--> https://bugzilla.mindrot.org/attachment.cgi?id=3073&action=edit
transfer stdout to channel
This transfers ownership of stdout to the session channel, clobbering
the original STDOUT_FILENO with /dev/null to ensure that nothing writes
to it after any subsequent fds are opened, since they could be
allocated fd=1.
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Oct-23 00:02 UTC
[Bug 2797] ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #3073|0 |1
is obsolete| |
--- Comment #2 from Damien Miller <djm at mindrot.org> ---
Created attachment 3074
--> https://bugzilla.mindrot.org/attachment.cgi?id=3074&action=edit
attempt 2 - delay clobbering of stdout until after LocalCommand
Previous patch was incorrect - LocalCommand may write to stdout, so
delay clobbering STDOUT_FILENO until it has completed.
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Oct-23 05:28 UTC
[Bug 2797] ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
David Newall <openssh at davidnewall.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Oct-23 10:48 UTC
[Bug 2797] ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #3 from Damien Miller <djm at mindrot.org> ---
Hang on - the patch isn't committed yet!
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Oct-23 10:49 UTC
[Bug 2797] ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |2782
Referenced Bugs:
https://bugzilla.mindrot.org/show_bug.cgi?id=2782
[Bug 2782] Tracking bug for OpenSSH 7.7 release
--
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Oct-25 02:24 UTC
[Bug 2797] ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Damien Miller <djm at mindrot.org> ---
Patch has been committed and will be in openssh-7.7
--
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Apr-06 02:26 UTC
[Bug 2797] ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #5 from Damien Miller <djm at mindrot.org> ---
Close all resolved bugs after release of OpenSSH 7.7.
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-May-28 10:04 UTC
[Bug 2797] ssh swallows end-of-file on output
https://bugzilla.mindrot.org/show_bug.cgi?id=2797
dearvoid at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dearvoid at gmail.com
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.