From nagler@olsen.CH Wed Aug 18 10:51:59 1993
Received: by florida.syl.dl.nec.com (4.1/YDL1.9-920708.13)
	id AA24865(florida.syl.dl.nec.com); Wed, 18 Aug 93 10:51:58 CDT
Received: by texas.syl.dl.nec.com (4.1/YDL1.9-930614.17)
	id AA04169(texas.syl.dl.nec.com); Wed, 18 Aug 93 10:51:53 CDT
Received: from olsen.UUCP by chsun.eunet.ch (5.65c8/1.34)
	id AA27117; Wed, 18 Aug 1993 17:52:36 +0200
Received: from metical.olsen by olsen.olsen.ch (4.1/SMI-4.1)
	id AA22894; Wed, 18 Aug 93 17:25:02 +0200
Received: by metical.olsen (4.1/SMI-4.1)
	id AA29001; Wed, 18 Aug 93 17:25:01 +0200
Date: Wed, 18 Aug 93 17:25:01 +0200
From: nagler@olsen.ch (Rob Nagler)
Message-Id: <9308181525.AA29001@metical.olsen>
To: ylee@syl.dl.nec.com
Subject: Socks Patch
Status: R

Thanks for your work on Socks.  In trying to get it running at our
site, I ran into a small problem.  Rbind assumes that there is one
internet address visible from both sides of the server. Our server is
dual-homed, but it doesn't advertise its routes.  The Internet side
of the server is protected by a screening router.  As a result,
rftp didn't work.  The following patch fixes the problem.

Thanks again for your efforts.  Socks is a great package!

Rob nagler@olsen.ch 	    	Olsen & Associates AG
Tel: +411 386 4848    	    	Seefeldstrasse 233
Fax: +411 422 2282    	    	CH-8008 Zurich

[rest deleted]
------------------------------------------------------------------------

From nagler@olsen.CH Fri Aug 20 11:35:05 1993
Received: by florida.syl.dl.nec.com (4.1/YDL1.9-920708.13)
	id AA25965(florida.syl.dl.nec.com); Fri, 20 Aug 93 11:35:03 CDT
Received: by texas.syl.dl.nec.com (4.1/YDL1.9-930614.17)
	id AA20010(texas.syl.dl.nec.com); Fri, 20 Aug 93 11:34:52 CDT
Received: from olsen.UUCP by chsun.eunet.ch (5.65c8/1.34)
	id AA23910; Fri, 20 Aug 1993 18:35:39 +0200
Received: from metical.olsen by olsen.olsen.ch (4.1/SMI-4.1)
	id AA15212; Fri, 20 Aug 93 11:13:13 +0200
Received: by metical.olsen (4.1/SMI-4.1)
	id AA02010; Fri, 20 Aug 93 11:13:11 +0200
Date: Fri, 20 Aug 93 11:13:11 +0200
From: nagler@olsen.ch (Rob Nagler)
Message-Id: <9308200913.AA02010@metical.olsen>
To: ylee@syl.dl.nec.com
Subject: Re:  Socks Patch
Status: R

> Thanks.

Blush... The patch I sent you doesn't work.  The following patch
is correct.  If you already merged in the old patch, just delete
the line:
153a154
>       SocksInetHost = SocksHost;

Sorry for the trouble.
======================================================================
#!/bin/sh
#
# This is a shar (shell archive) file.
# In order to extract the contents of this archive, remove everything
# above the "#!/bin/sh" line.  Then execute the remaining file with
# /bin/sh.  The following file(s) will be extracted:
#    Rconnect.c-patch
#    socks.h-patch
#
#
# This archive was generated on Fri Aug 20 11:08:51 MET DST 1993
#
#
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if [ -f 'Rconnect.c-patch' -a "${1}" != "-c" ] ; then
    echo shar: Won\'t overwrite existing file "Rconnect.c-patch"
    exit 2
fi
echo x - Rconnect.c-patch
sed -e 's/^X//' > Rconnect.c-patch << '---END-OF-Rconnect.c-patch---'
X*** lib/Rconnect.c	Fri Aug 20 10:54:10 1993
X--- lib/Rconnect.c-dist	Tue Aug 17 14:57:00 1993
X***************
X*** 15,22 ****
X  extern int 			errno;
X  extern char			*getenv();
X  static struct sockaddr_in	cursin;
X! static unsigned long		SocksHost;	/* Safe side of the firewall */
X! static unsigned long		SocksInetHost;	/* Internet side of net */
X  u_short socks_port;
X  u_short	socks_conn_port = 0;
X  
X--- 15,21 ----
X  extern int 			errno;
X  extern char			*getenv();
X  static struct sockaddr_in	cursin;
X! static unsigned long		SocksHost;
X  u_short socks_port;
X  u_short	socks_conn_port = 0;
X  
X***************
X*** 82,90 ****
X  	static char	defaultNS[] = SOCKS_DEFAULT_NS;
X  #endif
X  	static char	defaultSERVER[] = SOCKS_DEFAULT_SERVER;
X- #ifdef SOCKS_DEFAULT_INET_SERVER
X- 	static char	defaultINETSERVER[] = SOCKS_DEFAULT_INET_SERVER;
X- #endif
X  	char		*cp, *ns = (char *)0;
X  	struct hostent	*hp;
X  	struct servent	*sp;
X--- 81,86 ----
X***************
X*** 119,153 ****
X  		_res.nscount = 1;
X  	}
X  
X- 	/* Get INET side first, because "ns" is used in a user msg below */
X- 	if ((cp = getenv("SOCKS_INET_SERVER")) == NULL) {
X- #ifdef SOCKS_DEFAULT_INET_SERVER
X- 		ns = defaultINETSERVER;
X- #else
X- 		ns = defaultSERVER;
X- #endif
X- 	} else {
X- 		ns = cp;
X- 	}
X- 	if ((hp = gethostbyname(ns)) == NULL) {
X- 		if ((SocksInetHost = inet_addr(ns)) < 0) {
X- 		    fprintf(stderr, "Unable to map SOCKS INET server %s\n",ns);
X- 		    return(1);
X- 		}
X- 	} else {
X- 		bcopy(hp->h_addr_list[0], &SocksInetHost, hp->h_length);
X- 	}
X- 
X  	if ((cp = getenv("SOCKS_SERVER")) == NULL) {
X  		ns = defaultSERVER;
X  	} else {
X  		ns = cp;
X  	}
X  	if ((hp = gethostbyname(ns)) == NULL) {
X! 		if ((SocksHost = inet_addr(ns)) < 0) {
X! 			fprintf(stderr, "Unable to map SOCKS server %s\n",ns);
X! 			return(1);
X! 		}
X  	} else {
X  		bcopy(hp->h_addr_list[0], &SocksHost, hp->h_length);
X  	}
X--- 115,128 ----
X  		_res.nscount = 1;
X  	}
X  
X  	if ((cp = getenv("SOCKS_SERVER")) == NULL) {
X  		ns = defaultSERVER;
X  	} else {
X  		ns = cp;
X  	}
X+ 
X  	if ((hp = gethostbyname(ns)) == NULL) {
X! 		SocksHost = inet_addr(ns);
X  	} else {
X  		bcopy(hp->h_addr_list[0], &SocksHost, hp->h_length);
X  	}
X***************
X*** 237,243 ****
X  
X  	cursin.sin_family = AF_INET;
X  	cursin.sin_port = dst.port;
X! 	cursin.sin_addr.s_addr = SocksInetHost;
X  
X  	return (check_result(dst.cmd));
X  }
X--- 212,218 ----
X  
X  	cursin.sin_family = AF_INET;
X  	cursin.sin_port = dst.port;
X! 	cursin.sin_addr.s_addr = SocksHost;
X  
X  	return (check_result(dst.cmd));
X  }
---END-OF-Rconnect.c-patch---
LEN=`wc -c < Rconnect.c-patch`
if [ $LEN !=  2510 ] ; then
    echo shar: File "Rconnect.c-patch" was $LEN, should have been 2510 bytes
fi
if [ -f 'socks.h-patch' -a "${1}" != "-c" ] ; then
    echo shar: Won\'t overwrite existing file "socks.h-patch"
    exit 2
fi
echo x - socks.h-patch
sed -e 's/^X//' > socks.h-patch << '---END-OF-socks.h-patch---'
X*** include/socks.h	Wed Aug 18 11:54:41 1993
X--- include/socks.h-dist	Fri Aug  6 18:23:33 1993
X***************
X*** 3,18 ****
X   * This is overridden at run time by the contents of environment
X   * variable SOCKS_SERVER if it exists.
X   */
X! #define SOCKS_DEFAULT_SERVER	"internet"
X! 
X! /*
X!  * Default SOCKS server host address as seen from the Internet.  Leave
X!  * it undefined if your gateway only has one internet address or it
X!  * advertises a route to SOCKS_DEFAULT_SERVER to the Internet.  This
X!  * is overridden at run time by the contents of environment variable
X!  * SOCKS_INET_SERVER if it exists.
X!  */
X! #define SOCKS_DEFAULT_INET_SERVER	"internet-dmz"
X  
X  /*
X   * Default Domain Nameserver for the SOCKS clients.
X--- 3,9 ----
X   * This is overridden at run time by the contents of environment
X   * variable SOCKS_SERVER if it exists.
X   */
X! #define SOCKS_DEFAULT_SERVER	"SOCKS.server.for.your.site"
X  
X  /*
X   * Default Domain Nameserver for the SOCKS clients.
---END-OF-socks.h-patch---
LEN=`wc -c < socks.h-patch`
if [ $LEN !=  979 ] ; then
    echo shar: File "socks.h-patch" was $LEN, should have been 979 bytes
fi
exit 0

