]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/09/17 20:52:47
authormouring <mouring>
Tue, 18 Sep 2001 05:51:13 +0000 (05:51 +0000)
committermouring <mouring>
Tue, 18 Sep 2001 05:51:13 +0000 (05:51 +0000)
     [channels.c channels.h clientloop.c]
     try to fix agent-forwarding-backconnection-bug, as seen on HPUX,
     for example; with Lutz.Jaenicke@aet.TU-Cottbus.DE,

ChangeLog
channels.c
channels.h
clientloop.c

index 089583427cfa24788c4c1ba42121dd90cb39d750..efc1105cb46ed97167d6a651730837415039e993 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
    - markus@cvs.openbsd.org 2001/09/17 20:50:22
      [key.c ssh-keygen.c]
      better error handling if you try to export a bad key to ssh.com
+   - markus@cvs.openbsd.org 2001/09/17 20:52:47
+     [channels.c channels.h clientloop.c]
+     try to fix agent-forwarding-backconnection-bug, as seen on HPUX, 
+     for example; with Lutz.Jaenicke@aet.TU-Cottbus.DE,
 
 20010917
  - (djm) x11-ssh-askpass-1.2.4 in RPM spec, revert workarounds
index 7bf127d91571c59bae4da3e6f5e9068e208c5c58..bf11716b82707b96d39722108effff0388481c3e 100644 (file)
@@ -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
@@ -2669,6 +2680,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) {
@@ -2931,6 +2943,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) {
index 2ee1496c789a0a311123719c4bcedd7cd33b8431..a1300483894778f43aa8d4c5be03bfc7c2b4d20b 100644 (file)
@@ -32,7 +32,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/* RCSID("$OpenBSD: channels.h,v 1.45 2001/07/17 21:04:57 markus Exp $"); */
+/* RCSID("$OpenBSD: channels.h,v 1.46 2001/09/17 20:52:47 markus Exp $"); */
 
 #ifndef CHANNEL_H
 #define CHANNEL_H
@@ -77,6 +77,7 @@ struct Channel {
        int     efd;            /* extended fd */
        int     sock;           /* sock fd */
        int     isatty;         /* rfd is a tty */
+       int     force_drain;            /* force close on iEOF */
        Buffer  input;          /* data read from socket, to be sent over
                                 * encrypted connection */
        Buffer  output;         /* data received over encrypted connection for
index 41aff8354e97f948ca0919d213c721bc5aaea109..e6da67d51a043d172504176db0627c4d9a191d22 100644 (file)
@@ -59,7 +59,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.81 2001/07/17 21:04:57 markus Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.82 2001/09/17 20:52:47 markus Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -1111,6 +1111,7 @@ client_request_x11(const char *request_type, int rchan)
                error("client_request_x11: channel_new failed");
                close(sock);
        }
+       c->force_drain = 1;
        return c;
 }
 
@@ -1136,6 +1137,7 @@ client_request_agent(const char *request_type, int rchan)
                error("client_request_agent: channel_new failed");
                close(sock);
        }
+       c->force_drain = 1;
        return c;
 }
 
This page took 0.421605 seconds and 5 git commands to generate.