From owner-FreeBSD-users-jp@jp.freebsd.org  Thu Mar 18 12:05:18 1999
Received: by jaz.jp.freebsd.org (8.9.2+3.1W/8.7.3) id MAA03505;
	Thu, 18 Mar 1999 12:05:18 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from ns.crl.go.jp (ns.crl.go.jp [133.243.18.30])
	by jaz.jp.freebsd.org (8.9.2+3.1W/8.7.3) with ESMTP id MAA03496
	for <FreeBSD-users-jp@jp.freebsd.org>; Thu, 18 Mar 1999 12:05:13 +0900 (JST)
	(envelope-from aoki@crl.go.jp)
Received: from crlgw.crl.go.jp ([133.243.18.250])
	by ns.crl.go.jp (8.9.0/3.7W) with ESMTP id MAA15608
	for <FreeBSD-users-jp@jp.freebsd.org>; Thu, 18 Mar 1999 12:04:41 +0900 (JST)
Received: from curry.crl.go.jp (crlgw [133.243.18.250]) by crlgw.crl.go.jp (8.8.8+2.7Wbeta7/3.5Wpl7-MS980331) with ESMTP id MAA12120 for <FreeBSD-users-jp@jp.freebsd.org>; Thu, 18 Mar 1999 12:04:41 +0900 (JST)
Received: from localhost (localhost [127.0.0.1])
	by curry.crl.go.jp (8.9.3/3.7W) with ESMTP id MAA56386
	for <FreeBSD-users-jp@jp.freebsd.org>; Thu, 18 Mar 1999 12:04:40 +0900 (JST)
To: FreeBSD-users-jp@jp.freebsd.org
X-Mailer: Mew version 1.94b9 on Emacs 20.3 / Mule 4.0 (HANANOEN)
X-fingerprint: B6 D0 1A 6D 43 24 2C 09  BC 25 82 B2 6A 32 35 AE
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Message-Id: <19990318120439C.aoki@crl.go.jp>
Date: Thu, 18 Mar 1999 12:04:39 +0900
From: AOKI Tetsuo <aoki@crl.go.jp>
X-Dispatcher: imput version 990225(IM107)
Lines: 73
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+981115
X-Sequence: FreeBSD-users-jp 39980
Subject: [FreeBSD-users-jp 39980] FreeBSD3.1, socks, and emacs
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org
X-Originator: aoki@crl.go.jp

$B@DLZ$H?=$7$^$9!#(B
FreeBSD 3.1$B$G(Bsocks5-v1.0r9$B$r;H$C$F$$$^$9!#(Brtelnet$B$H$+!"(Brftp$B$J$I(B
ports$B$GF~$l$?$N$G$9$,$A$c$s$HF0$$$F$$$^$9!#(B
$B$H$3$m$,!"(Brunsocks$B$H(Bemacs$B$NAH9g$o$;$,$*$+$7$$$N$G$9!#(B
emacs$B$NCf$G!"(Bdisplay-time$B$rF0$+$7$F$$$k$N$G$9$,(Btimezone$B$r8+$F$/$l$J$$(B
$B$h$&$K$J$C$F$7$^$$!"(B9$B;~4V$:$l$?;~4V$,I=<($5$l$^$9!#(B
FreeBSD 3.0$B$G$O$=$&$O$J$j$^$;$s!#(B

runsocks$B$O!"(B

#!/bin/sh
#
# Put the path to the socks shared library in our LD_LIBRARY_PATH so when we
# preload the library, ld.so will find it...
#
if test -n "${SOCKS5_SHLIB_RUNPATH}" ; then
	SOCKS5_SHLIB_RUNPATH="${SOCKS5_SHLIB_RUNPATH}/"
elif test -n "/usr/local/lib"; then
	SOCKS5_SHLIB_RUNPATH="/usr/local/lib/"
else 
	SOCKS5_SHLIB_RUNPATH="./"
fi

#
# Some OS's use PRELOADS=lib while others use _RLD_LIST=lib:DEFAULT.  Hopefully 
# this can handle all those cases.  At any rate, this is basically causing the
# socks5 shared libary to be used to resolve symbols before other libraries,
# hence we get socks's connect before we get libc's connect...
#
# Also, on SunOS 4*, LD_LIBRARY_PATH has no effect on, so we need to put the path
# in front of it.  We make the path overridable with SOCKS5_SHLIB_RUNPATH...
#
case `uname -rs` in
SunOS*4.*)
	LD_PRELOAD=${SOCKS5_SHLIB_RUNPATH}libsocks5_sh.so
	export LD_PRELOAD
	;;
*)
	if test -z "$LD_LIBRARY_PATH" ; then
		LD_LIBRARY_PATH=${SOCKS5_SHLIB_RUNPATH}
	else
		LD_LIBRARY_PATH=${SOCKS5_SHLIB_RUNPATH}:${LD_LIBRARY_PATH}
		export LD_LIBRARY_PATH
	fi

	LD_PRELOAD=libsocks5_sh.so
	export LD_LIBRARY_PATH
	;;
esac
# 
# Run the actual program...
#
export LD_PRELOAD
exec "$@"

$B$C$F$J(Bsh$B%9%/%j%W%H$G!"$I$&$b(BLD_PRELOAD$B$K(Blibsocks5_sh.so$B$rF~$l$F!"(B
export$B$7$F$+$i(Bemacs$B$r8F$V$H(BTZ$B$,%;%C%H$5$l$^$;$s!#(B
*scratch$B$G!"(B
(current-time-zone)
$B$r(Beval$B$9$k$H!"(B
(0 "")
$B$K$J$C$F$7$^$$$^$9!#(B
$B2?$KLdBj$,$"$k$N$+$h$/$o$+$i$:!":$$C$F$$$^$9!#(B
libsocks5_sh.so$B$KF~$C$F$k$J$s$+$N4X?t$,$*$+$7$$$N$+!"(BFreeBSD3.1$B$N(B
$B%i%$%V%i%j$,$*$+$7$$$N$+!D(B

$B$J$+$J$+$&$^$/<ALd$r$^$H$a$i$l$^$;$s$,!"$3$s$J$N$GBg>fIW$G$7$g$&$+!#(B

-----
$B@DLZ!!E/O:!?M9@/>JDL?.Am9g8&5f=j(B $B8w7WB,8&5f<<(B
$BEl5~ET>.6b0f;T4S0fKLD.(B4-2-1
AOKI Tetsuo, Ph. D/Communications Research Lab., MPT., Japan
Tel: 042-327-7595 Fax: 042-327-6667
