summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/channels.c b/channels.c
index 4f02fc5b8..fe1db03ab 100644
--- a/channels.c
+++ b/channels.c
@@ -13,7 +13,7 @@
13 * called by a name other than "ssh" or "Secure Shell". 13 * called by a name other than "ssh" or "Secure Shell".
14 * 14 *
15 * SSH2 support added by Markus Friedl. 15 * SSH2 support added by Markus Friedl.
16 * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. 16 * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
17 * Copyright (c) 1999 Dug Song. All rights reserved. 17 * Copyright (c) 1999 Dug Song. All rights reserved.
18 * Copyright (c) 1999 Theo de Raadt. All rights reserved. 18 * Copyright (c) 1999 Theo de Raadt. All rights reserved.
19 * 19 *
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.155 2001/12/29 21:56:01 stevesk Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.156 2002/01/05 10:43:40 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -872,9 +872,17 @@ channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
872 else 872 else
873 channel_pre_open_15(c, readset, writeset); 873 channel_pre_open_15(c, readset, writeset);
874 } else if (ret == -1) { 874 } else if (ret == -1) {
875 log("X11 connection rejected because of wrong authentication.");
875 debug("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate); 876 debug("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate);
876 chan_read_failed(c); /** force close? */ 877 chan_read_failed(c);
877 chan_write_failed(c); 878 buffer_clear(&c->input);
879 chan_ibuf_empty(c);
880 buffer_clear(&c->output);
881 /* for proto v1, the peer will send an IEOF */
882 if (compat20)
883 chan_write_failed(c);
884 else
885 c->type = SSH_CHANNEL_OPEN;
878 debug("X11 closed %d i%d/o%d", c->self, c->istate, c->ostate); 886 debug("X11 closed %d i%d/o%d", c->self, c->istate, c->ostate);
879 } 887 }
880} 888}
@@ -1807,7 +1815,7 @@ channel_input_ieof(int type, u_int32_t seq, void *ctxt)
1807 chan_rcvd_ieof(c); 1815 chan_rcvd_ieof(c);
1808 1816
1809 /* XXX force input close */ 1817 /* XXX force input close */
1810 if (c->force_drain) { 1818 if (c->force_drain && c->istate == CHAN_INPUT_OPEN) {
1811 debug("channel %d: FORCE input drain", c->self); 1819 debug("channel %d: FORCE input drain", c->self);
1812 c->istate = CHAN_INPUT_WAIT_DRAIN; 1820 c->istate = CHAN_INPUT_WAIT_DRAIN;
1813 } 1821 }