From owner-freebsd-hackers Thu Dec 16 14: 2:41 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from gizmo.internode.com.au (gizmo.internode.com.au [192.83.231.115]) by hub.freebsd.org (Postfix) with ESMTP id 39C41157FF for ; Thu, 16 Dec 1999 14:02:32 -0800 (PST) (envelope-from newton@gizmo.internode.com.au) Received: (from newton@localhost) by gizmo.internode.com.au (8.9.3/8.9.3) id IAA03503; Fri, 17 Dec 1999 08:32:27 +1030 (CST) (envelope-from newton) Date: Fri, 17 Dec 1999 08:32:27 +1030 From: Mark Newton To: John and Jennifer Reynolds Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: anybody using tn-gw-nav to tunnel ssh through a proxy? Message-ID: <19991217083227.A3471@internode.com.au> References: <14425.10973.878258.39420@whale.home-net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <14425.10973.878258.39420@whale.home-net> X-PGP-Key: http://www.on.net/~newton/pgpkey.txt Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Dec 16, 1999 at 11:09:33AM -0700, John and Jennifer Reynolds wrote: > but upon trying to ssh from work to my box I get this error message: > Local: Corrupted check bytes on input. tn-gw isn't 8-bit-clean; you'll need to patch it. Try something like this: it creates a new tn-gw-> prompt command called "rawopen" which gives you an 8-bit-clean link to whatever host/port you specify. ... and check with your IT security folks before running nos-tun over it, won't you? :-) - mark *** tn-gw.c.orig Fri Jul 4 10:05:22 1997 --- tn-gw.c Mon Jul 7 10:48:15 1997 *************** *** 61,66 **** --- 61,67 ---- static unsigned char prebuf[BUFSIZ]; static int prebufc; static int kludgeraw = 0; + static int gimme8bit = 0; static time_t ontime; static time_t offtime; *************** *** 78,83 **** --- 79,85 ---- static int cmd_connect(); static int cmd_passwd(); static int cmd_xforward(); + static int cmd_rawconn(); typedef struct { char *name; *************** *** 88,93 **** --- 90,96 ---- "connect", " connect hostname [serv/port]", cmd_connect, "telnet", " telnet hostname [serv/port]", cmd_connect, "open", 0, cmd_connect, + "rawopen", " rawopen hostname [serv/port]", cmd_rawconn, "x-gw", " x-gw [hostname/display]", cmd_xforward, "help", " help/?", cmd_help, "quit", " quit/exit", cmd_quit, *************** *** 316,322 **** if(!kludgeraw && FD_ISSET(0,&rdy)) { if(rfd == -1) { ! say(0,"Remote server has closed connection"); goto leave; } x = read(0,xuf,sizeof(xuf)); --- 319,325 ---- if(!kludgeraw && FD_ISSET(0,&rdy)) { if(rfd == -1) { ! if (!gimme8bit) say(0,"Remote server has closed connection"); goto leave; } x = read(0,xuf,sizeof(xuf)); *************** *** 342,348 **** } if(write(rfd,clientnull,x) != x) { ! say(0,"Remote server has closed connection"); goto leave; } outbytcnt += x; --- 345,351 ---- } if(write(rfd,clientnull,x) != x) { ! if (!gimme8bit) say(0,"Remote server has closed connection"); goto leave; } outbytcnt += x; *************** *** 356,362 **** if(rfd != -1 && FD_ISSET(rfd,&rdy)) { x = read(rfd,xuf,sizeof(xuf)); if(x <= 0) { ! say(0,"Remote server has closed connection"); goto leave; } if(write(0,xuf,x) != x) --- 359,365 ---- if(rfd != -1 && FD_ISSET(rfd,&rdy)) { x = read(rfd,xuf,sizeof(xuf)); if(x <= 0) { ! if (!gimme8bit) say(0,"Remote server has closed connection"); goto leave; } if(write(0,xuf,x) != x) *************** *** 738,744 **** } else syslog(LLEV,"permit host=%s/%s destination=%s",rladdr,riaddr,av[1]); ! if(port != TNPORT) { unsigned char xuf[9]; xuf[0] = IAC; --- 741,753 ---- } else syslog(LLEV,"permit host=%s/%s destination=%s",rladdr,riaddr,av[1]); ! /* 19970704 newton@atdot.dotat.org ! * "gimme8bit" flag used to determine whether this actually happens. ! * Normally, if the proxy isn't connecting to port 23 it will ! * intercept telnet IAC sequences, meaning that we can't get an ! * 8-bit clean connection. If gimme8bit is true, this behaviour ! * will be suppressed. */ ! if((port != TNPORT) && (!gimme8bit)) { unsigned char xuf[9]; xuf[0] = IAC; *************** *** 753,758 **** --- 762,769 ---- if(write(0,xuf,9) != 9) return(1); kludgeraw = 1; + } else if (gimme8bit) { + syslog(LLEV, "RAW connection requested"); } if((rfd = conn_server(av[1],port,0,buf)) < 0) { *************** *** 768,774 **** return(2); } ! baddest(fd,dest) int fd; --- 779,793 ---- return(2); } ! static int ! cmd_rawconn(ac, av, cbuf) ! int ac; ! char *av[]; ! char *cbuf; ! { ! gimme8bit = 1; ! return(cmd_connect(ac, av, cbuf)); ! } baddest(fd,dest) int fd; -- Mark Newton Email: newton@internode.com.au (W) Network Engineer Email: newton@atdot.dotat.org (H) Internode Systems Pty Ltd Desk: +61-8-82232999 "Network Man" - Anagram of "Mark Newton" Mobile: +61-416-202-223 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message