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   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-26 23:25:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description k3dzngrp8w2xtc9 2007-01-19 16:59:47 UTC
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",
host);
                buffer_append(&stderr_buffer, buf, strlen(buf));
        }

Comment 1 Tomas Mraz 2007-01-26 20:51:21 UTC
Can you give exact steps how to reproduce the problem?


Comment 2 k3dzngrp8w2xtc9 2007-01-26 22:58:34 UTC
$ ssh -x demo.net
# ...
demo.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 23:06:19 UTC
Sorry probably I accidentally unset the NEEDINFO....

Comment 4 k3dzngrp8w2xtc9 2007-01-26 23:11:37 UTC
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 23:17:20 UTC
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 23:25:42 UTC
Yes, that seems to be the case.