summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/channels.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-09-17 20:52:48 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-09-17 20:52:48 +0000
commitf85c2dae5600c72139cc708f2fb397e35da2c919 (patch)
tree26764aceb1e958de53ee015e76238589b388d36a /usr.bin/ssh/channels.c
parentaad4c7907aa6a2f0a6bc53a12ad05e75b7dae23d (diff)
try to fix agent-forwarding-backconnection-bug, as seen on HPUX, for example;
with Lutz.Jaenicke@aet.TU-Cottbus.DE,
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r--usr.bin/ssh/channels.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index 8b5612d1df2..5c75f556a4f 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.132 2001/07/17 21:04:56 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.133 2001/09/17 20:52:47 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -260,6 +260,7 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
c->cb_fn = NULL;
c->cb_arg = NULL;
c->cb_event = 0;
+ c->force_drain = 0;
c->detach_user = NULL;
c->input_filter = NULL;
debug("channel %d: new [%s]", found, remote_name);
@@ -874,6 +875,9 @@ static void
channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
{
int ret = x11_open_helper(&c->output);
+
+ /* c->force_drain = 1; */
+
if (ret == 1) {
c->type = SSH_CHANNEL_OPEN;
if (compat20)
@@ -1781,6 +1785,13 @@ channel_input_ieof(int type, int plen, void *ctxt)
if (c == NULL)
packet_disconnect("Received ieof for nonexistent channel %d.", id);
chan_rcvd_ieof(c);
+
+ /* XXX force input close */
+ if (c->force_drain) {
+ debug("channel %d: FORCE input drain", c->self);
+ c->istate = CHAN_INPUT_WAIT_DRAIN;
+ }
+
}
void
@@ -2612,6 +2623,7 @@ x11_input_open(int type, int plen, void *ctxt)
close(sock);
} else {
c->remote_id = remote_id;
+ c->force_drain = 1;
}
}
if (c == NULL) {
@@ -2874,6 +2886,7 @@ auth_input_open_request(int type, int plen, void *ctxt)
close(sock);
} else {
c->remote_id = remote_id;
+ c->force_drain = 1;
}
}
if (c == NULL) {