Bug 223482

Summary: [patch] Prevent OpenSSH from overwriting last line of remote output when conn. is closed
Product: [Fedora] Fedora Reporter: k3dzngrp8w2xtc9
Component: opensshAssignee: Tomas Mraz <tmraz>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-26 18:25:42 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description k3dzngrp8w2xtc9 2007-01-19 11:59:47 EST
Description of problem:
OpenSSH overwrites the last line of output from the remote server when the
connection is closed.

Version-Release number of selected component (if applicable):
Against openssh-4.3p2-noacss.tar.bz2 in openssh-4.3p2-14.fc6.src.rpm  

Additional info: (patch)

diff -aurp openssh-4.3p2.orig/clientloop.c openssh-4.3p2/clientloop.c
--- openssh-4.3p2.orig/clientloop.c     2005-12-31 06:22:32.000000000 +0100
+++ openssh-4.3p2/clientloop.c  2007-01-19 17:44:52.000000000 +0100
@@ -1518,7 +1518,7 @@ client_loop(int have_pty, int escape_cha
         * that the connection has been closed.
        if (have_pty && options.log_level != SYSLOG_LEVEL_QUIET) {
-               snprintf(buf, sizeof buf, "Connection to %.64s closed.\r\n", host);
+               snprintf(buf, sizeof buf, "\r\nConnection to %.64s closed.\r\n",
                buffer_append(&stderr_buffer, buf, strlen(buf));
Comment 1 Tomas Mraz 2007-01-26 15:51:21 EST
Can you give exact steps how to reproduce the problem?
Comment 2 k3dzngrp8w2xtc9 2007-01-26 17:58:34 EST
$ ssh -x demo@gein.vistech.net
# ...
demo@gein.vistech.net's password: << Log in with password "user"
# ...
GEIN $ logoff
Connection to gein.vistech.net closed.07 22:53:05.35

The "Connection to gein.vistech.net closed." overwrites the message from server.
Comment 3 k3dzngrp8w2xtc9 2007-01-26 18:06:19 EST
Sorry probably I accidentally unset the NEEDINFO....
Comment 4 k3dzngrp8w2xtc9 2007-01-26 18:11:37 EST
By the way telnet also does this:

GEIN $ logoff
Connection closed by foreign host.N-2007 23:10:28.72
Comment 5 k3dzngrp8w2xtc9 2007-01-26 18:17:20 EST
So actually.. probably it's fair to say the bug is in the VMS audit subsystem
because it terminates the line with a \r or maybe in the terminal emulator, but
not ssh or telnet
Comment 6 Tomas Mraz 2007-01-26 18:25:42 EST
Yes, that seems to be the case.