]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2002/01/05 10:43:40
authordjm <djm>
Tue, 22 Jan 2002 12:19:38 +0000 (12:19 +0000)
committerdjm <djm>
Tue, 22 Jan 2002 12:19:38 +0000 (12:19 +0000)
     [channels.c]
     fix hanging x11 channels for rejected cookies (e.g. XAUTHORITY=/dev/null xbiff)
     bug #36, based on patch from djast@cs.toronto.edu

ChangeLog
channels.c

index 94668a88759582caf9a6a7bbdeaeb156a9351e76..04a310b65d94706d6c774cb0e493c3231b7a6d6c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      [servconf.c sshd.8]
      protocol 2 HostKey code default is now /etc/ssh_host_rsa_key and
      /etc/ssh_host_dsa_key like we have in sshd_config.  ok markus@
+   - markus@cvs.openbsd.org 2002/01/05 10:43:40
+     [channels.c]
+     fix hanging x11 channels for rejected cookies (e.g. 
+     XAUTHORITY=/dev/null xbiff) bug #36, based on patch from
+     djast@cs.toronto.edu
 
 
 20020121
index 4f02fc5b86192ecfdb8e92e2d57b0bfe1e2b4ba1..fe1db03ab718dc5a2a3cbf54f35f3b984775f668 100644 (file)
@@ -13,7 +13,7 @@
  * called by a name other than "ssh" or "Secure Shell".
  *
  * SSH2 support added by Markus Friedl.
- * Copyright (c) 1999, 2000, 2001 Markus Friedl.  All rights reserved.
+ * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl.  All rights reserved.
  * Copyright (c) 1999 Dug Song.  All rights reserved.
  * Copyright (c) 1999 Theo de Raadt.  All rights reserved.
  *
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.155 2001/12/29 21:56:01 stevesk Exp $");
+RCSID("$OpenBSD: channels.c,v 1.156 2002/01/05 10:43:40 markus Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -872,9 +872,17 @@ channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
                else
                        channel_pre_open_15(c, readset, writeset);
        } else if (ret == -1) {
+               log("X11 connection rejected because of wrong authentication.");
                debug("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate);
-               chan_read_failed(c);    /** force close? */
-               chan_write_failed(c);
+               chan_read_failed(c);
+               buffer_clear(&c->input);
+               chan_ibuf_empty(c);
+               buffer_clear(&c->output);
+               /* for proto v1, the peer will send an IEOF */
+               if (compat20)
+                       chan_write_failed(c);
+               else
+                       c->type = SSH_CHANNEL_OPEN;
                debug("X11 closed %d i%d/o%d", c->self, c->istate, c->ostate);
        }
 }
@@ -1807,7 +1815,7 @@ channel_input_ieof(int type, u_int32_t seq, void *ctxt)
        chan_rcvd_ieof(c);
 
        /* XXX force input close */
-       if (c->force_drain) {
+       if (c->force_drain && c->istate == CHAN_INPUT_OPEN) {
                debug("channel %d: FORCE input drain", c->self);
                c->istate = CHAN_INPUT_WAIT_DRAIN;
        }
This page took 0.276703 seconds and 5 git commands to generate.