summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/serverloop.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-02-19 09:53:31 +0000
committermarkus <markus@openbsd.org>2001-02-19 09:53:31 +0000
commit474fdaa1119718347ef8c2df565aa690cf0055cf (patch)
treeccef8d8ddef0be1bbbb30b7e4900f753fd65a627 /usr.bin/ssh/serverloop.c
parentbash-like 'double-tab' completion (diff)
downloadwireguard-openbsd-474fdaa1119718347ef8c2df565aa690cf0055cf.tar.xz
wireguard-openbsd-474fdaa1119718347ef8c2df565aa690cf0055cf.zip
ssh-1.2.{18-22} has broken handling of ignore messages; report from itojun@
Diffstat (limited to 'usr.bin/ssh/serverloop.c')
-rw-r--r--usr.bin/ssh/serverloop.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c
index 858cc282b62..4ceee02d1ad 100644
--- a/usr.bin/ssh/serverloop.c
+++ b/usr.bin/ssh/serverloop.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.49 2001/02/15 23:19:59 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.50 2001/02/19 09:53:32 markus Exp $");
#include "xmalloc.h"
#include "packet.h"
@@ -70,6 +70,7 @@ static long fdout_bytes = 0; /* Number of stdout bytes read from program. */
static int stdin_eof = 0; /* EOF message received from client. */
static int fdout_eof = 0; /* EOF encountered reading from fdout. */
static int fderr_eof = 0; /* EOF encountered readung from fderr. */
+static int fdin_is_tty = 0; /* fdin points to a tty. */
static int connection_in; /* Connection to client (input). */
static int connection_out; /* Connection to client (output). */
static u_int buffer_high;/* "Soft" max buffer size. */
@@ -338,7 +339,7 @@ process_output(fd_set * writeset)
fdin = -1;
} else {
/* Successful write. */
- if (tcgetattr(fdin, &tio) == 0 &&
+ if (fdin_is_tty && tcgetattr(fdin, &tio) == 0 &&
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
/*
* Simulate echo to reduce the impact of
@@ -434,6 +435,9 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg)
if (fderr != -1)
set_nonblock(fderr);
+ if (!(datafellows & SSH_BUG_IGNOREMSG) && isatty(fdin))
+ fdin_is_tty = 1;
+
connection_in = packet_get_connection_in();
connection_out = packet_get_connection_out();