summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-09-18 05:51:13 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-09-18 05:51:13 +0000
commit944c4f0bdaa12ac3c58b77ee866758958e708329 (patch)
treefa88329431b6580c3a023670c585ae9a27ab7768
parent99a30f11c2e698916f3a3d8434a438085d9f298f (diff)
- 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,
-rw-r--r--ChangeLog6
-rw-r--r--channels.c15
-rw-r--r--channels.h3
-rw-r--r--clientloop.c4
4 files changed, 24 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e6582c9a4..cb863a247 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,10 @@
26 - markus@cvs.openbsd.org 2001/09/17 20:50:22 26 - markus@cvs.openbsd.org 2001/09/17 20:50:22
27 [key.c ssh-keygen.c] 27 [key.c ssh-keygen.c]
28 better error handling if you try to export a bad key to ssh.com 28 better error handling if you try to export a bad key to ssh.com
29 - markus@cvs.openbsd.org 2001/09/17 20:52:47
30 [channels.c channels.h clientloop.c]
31 try to fix agent-forwarding-backconnection-bug, as seen on HPUX,
32 for example; with Lutz.Jaenicke@aet.TU-Cottbus.DE,
29 33
3020010917 3420010917
31 - (djm) x11-ssh-askpass-1.2.4 in RPM spec, revert workarounds 35 - (djm) x11-ssh-askpass-1.2.4 in RPM spec, revert workarounds
@@ -6486,4 +6490,4 @@
6486 - Wrote replacements for strlcpy and mkdtemp 6490 - Wrote replacements for strlcpy and mkdtemp
6487 - Released 1.0pre1 6491 - Released 1.0pre1
6488 6492
6489$Id: ChangeLog,v 1.1536 2001/09/18 05:49:14 mouring Exp $ 6493$Id: ChangeLog,v 1.1537 2001/09/18 05:51:13 mouring Exp $
diff --git a/channels.c b/channels.c
index 7bf127d91..bf11716b8 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.132 2001/07/17 21:04:56 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.133 2001/09/17 20:52:47 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -260,6 +260,7 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
260 c->cb_fn = NULL; 260 c->cb_fn = NULL;
261 c->cb_arg = NULL; 261 c->cb_arg = NULL;
262 c->cb_event = 0; 262 c->cb_event = 0;
263 c->force_drain = 0;
263 c->detach_user = NULL; 264 c->detach_user = NULL;
264 c->input_filter = NULL; 265 c->input_filter = NULL;
265 debug("channel %d: new [%s]", found, remote_name); 266 debug("channel %d: new [%s]", found, remote_name);
@@ -874,6 +875,9 @@ static void
874channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset) 875channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
875{ 876{
876 int ret = x11_open_helper(&c->output); 877 int ret = x11_open_helper(&c->output);
878
879 /* c->force_drain = 1; */
880
877 if (ret == 1) { 881 if (ret == 1) {
878 c->type = SSH_CHANNEL_OPEN; 882 c->type = SSH_CHANNEL_OPEN;
879 if (compat20) 883 if (compat20)
@@ -1781,6 +1785,13 @@ channel_input_ieof(int type, int plen, void *ctxt)
1781 if (c == NULL) 1785 if (c == NULL)
1782 packet_disconnect("Received ieof for nonexistent channel %d.", id); 1786 packet_disconnect("Received ieof for nonexistent channel %d.", id);
1783 chan_rcvd_ieof(c); 1787 chan_rcvd_ieof(c);
1788
1789 /* XXX force input close */
1790 if (c->force_drain) {
1791 debug("channel %d: FORCE input drain", c->self);
1792 c->istate = CHAN_INPUT_WAIT_DRAIN;
1793 }
1794
1784} 1795}
1785 1796
1786void 1797void
@@ -2669,6 +2680,7 @@ x11_input_open(int type, int plen, void *ctxt)
2669 close(sock); 2680 close(sock);
2670 } else { 2681 } else {
2671 c->remote_id = remote_id; 2682 c->remote_id = remote_id;
2683 c->force_drain = 1;
2672 } 2684 }
2673 } 2685 }
2674 if (c == NULL) { 2686 if (c == NULL) {
@@ -2931,6 +2943,7 @@ auth_input_open_request(int type, int plen, void *ctxt)
2931 close(sock); 2943 close(sock);
2932 } else { 2944 } else {
2933 c->remote_id = remote_id; 2945 c->remote_id = remote_id;
2946 c->force_drain = 1;
2934 } 2947 }
2935 } 2948 }
2936 if (c == NULL) { 2949 if (c == NULL) {
diff --git a/channels.h b/channels.h
index 2ee1496c7..a13004838 100644
--- a/channels.h
+++ b/channels.h
@@ -32,7 +32,7 @@
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */ 34 */
35/* RCSID("$OpenBSD: channels.h,v 1.45 2001/07/17 21:04:57 markus Exp $"); */ 35/* RCSID("$OpenBSD: channels.h,v 1.46 2001/09/17 20:52:47 markus Exp $"); */
36 36
37#ifndef CHANNEL_H 37#ifndef CHANNEL_H
38#define CHANNEL_H 38#define CHANNEL_H
@@ -77,6 +77,7 @@ struct Channel {
77 int efd; /* extended fd */ 77 int efd; /* extended fd */
78 int sock; /* sock fd */ 78 int sock; /* sock fd */
79 int isatty; /* rfd is a tty */ 79 int isatty; /* rfd is a tty */
80 int force_drain; /* force close on iEOF */
80 Buffer input; /* data read from socket, to be sent over 81 Buffer input; /* data read from socket, to be sent over
81 * encrypted connection */ 82 * encrypted connection */
82 Buffer output; /* data received over encrypted connection for 83 Buffer output; /* data received over encrypted connection for
diff --git a/clientloop.c b/clientloop.c
index 41aff8354..e6da67d51 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
59 */ 59 */
60 60
61#include "includes.h" 61#include "includes.h"
62RCSID("$OpenBSD: clientloop.c,v 1.81 2001/07/17 21:04:57 markus Exp $"); 62RCSID("$OpenBSD: clientloop.c,v 1.82 2001/09/17 20:52:47 markus Exp $");
63 63
64#include "ssh.h" 64#include "ssh.h"
65#include "ssh1.h" 65#include "ssh1.h"
@@ -1111,6 +1111,7 @@ client_request_x11(const char *request_type, int rchan)
1111 error("client_request_x11: channel_new failed"); 1111 error("client_request_x11: channel_new failed");
1112 close(sock); 1112 close(sock);
1113 } 1113 }
1114 c->force_drain = 1;
1114 return c; 1115 return c;
1115} 1116}
1116 1117
@@ -1136,6 +1137,7 @@ client_request_agent(const char *request_type, int rchan)
1136 error("client_request_agent: channel_new failed"); 1137 error("client_request_agent: channel_new failed");
1137 close(sock); 1138 close(sock);
1138 } 1139 }
1140 c->force_drain = 1;
1139 return c; 1141 return c;
1140} 1142}
1141 1143