summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/channels.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-09-17 21:04:01 +0000
committermarkus <markus@openbsd.org>2001-09-17 21:04:01 +0000
commit93c4458b633f2dbcd69dbee0c34ec15ab53a27c1 (patch)
treef683a8e08065d04d0be5e8a5e493a71b177c7ec8 /usr.bin/ssh/channels.c
parenttry to fix agent-forwarding-backconnection-bug, as seen on HPUX, for example; (diff)
downloadwireguard-openbsd-93c4458b633f2dbcd69dbee0c34ec15ab53a27c1.tar.xz
wireguard-openbsd-93c4458b633f2dbcd69dbee0c34ec15ab53a27c1.zip
don't send fake dummy packets on CR (\r)
bugreport from yyua@cs.sfu.ca via solar@@openwall.com
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r--usr.bin/ssh/channels.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index 5c75f556a4f..82cf8fe077b 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.133 2001/09/17 20:52:47 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.134 2001/09/17 21:04:01 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -1292,14 +1292,17 @@ static int
channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
{
struct termios tio;
+ u_char *data;
+ u_int dlen;
int len;
/* Send buffered output data to the socket. */
if (c->wfd != -1 &&
FD_ISSET(c->wfd, writeset) &&
buffer_len(&c->output) > 0) {
- len = write(c->wfd, buffer_ptr(&c->output),
- buffer_len(&c->output));
+ data = buffer_ptr(&c->output);
+ dlen = buffer_len(&c->output);
+ len = write(c->wfd, data, dlen);
if (len < 0 && (errno == EINTR || errno == EAGAIN))
return 1;
if (len <= 0) {
@@ -1316,7 +1319,7 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
}
return -1;
}
- if (compat20 && c->isatty) {
+ if (compat20 && c->isatty && dlen >= 1 && data[0] != '\r') {
if (tcgetattr(c->wfd, &tio) == 0 &&
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
/*