Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

8
net/tsocks/DESCR Normal file
View File

@@ -0,0 +1,8 @@
tsocks allows non SOCKS aware applications (e.g telnet, ssh, ftp etc) to use
SOCKS without any modification. It does this by intercepting the calls that
applications make to establish network connections and negotiating them through
a SOCKS server as necessary.
tsocks is based on the 'shared library interceptor' concept. Through use of
the LD_PRELOAD environment variable, tsocks is automatically loaded into the
process space of every executed program.

45
net/tsocks/Makefile Normal file
View File

@@ -0,0 +1,45 @@
# $NetBSD: Makefile,v 1.17 2013/04/06 21:07:34 rodent Exp $
#
DISTNAME= tsocks-1.8beta5
PKGREVISION= 3
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=tsocks/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://tsocks.sourceforge.net/
COMMENT= Transparent SOCKS proxying library
LICENSE= gnu-gpl-v2
MAKE_JOBS_SAFE= no
WRKSRC= ${WRKDIR}/tsocks-1.8
GNU_CONFIGURE= YES
USE_TOOLS+= gmake
USE_LIBTOOL= yes
CONFIGURE_ARGS+= --with-conf=${PKG_SYSCONFDIR}/tsocks.conf
EGDIR= ${PREFIX}/share/examples/tsocks
SUBST_CLASSES+= tsocks
SUBST_STAGE.tsocks= post-configure
SUBST_MESSAGE.tsocks= Generating tsocks wrapper script.
SUBST_FILES.tsocks= tsocks
SUBST_SED.tsocks= -e "s|@SH@|${SH}|g"
SUBST_SED.tsocks+= -e "s|@PREFIX@|${PREFIX}|g"
INSTALLATION_DIRS+= ${EGDIR}
post-extract:
${RM} -f ${WRKSRC}/config.cache
${CP} ${FILESDIR}/tsocks.sh ${WRKSRC}/tsocks
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/tsocks ${DESTDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/tsocks.conf.complex.example \
${DESTDIR}${EGDIR}/tsocks.conf.complex
${INSTALL_DATA} ${WRKSRC}/tsocks.conf.simple.example \
${DESTDIR}${EGDIR}/tsocks.conf.simple
.include "../../mk/bsd.pkg.mk"

8
net/tsocks/PLIST Normal file
View File

@@ -0,0 +1,8 @@
@comment $NetBSD: PLIST,v 1.3 2009/06/14 18:09:46 joerg Exp $
bin/tsocks
lib/libtsocks.la
man/man1/tsocks.1
man/man5/tsocks.conf.5
man/man8/tsocks.8
share/examples/tsocks/tsocks.conf.complex
share/examples/tsocks/tsocks.conf.simple

9
net/tsocks/distinfo Normal file
View File

@@ -0,0 +1,9 @@
$NetBSD: distinfo,v 1.7 2006/09/17 11:50:15 jmmv Exp $
SHA1 (tsocks-1.8beta5.tar.gz) = 489f88c5df999ba21b27cdaa7836d9426d062aec
RMD160 (tsocks-1.8beta5.tar.gz) = 12e3eeeafaf7f3be21dd8901da38d5890659b09e
Size (tsocks-1.8beta5.tar.gz) = 83928 bytes
SHA1 (patch-aa) = 46fd0a518e3c9e21c874de1135c5ac427eff539d
SHA1 (patch-ab) = 01f621f9b59d87b5305ea8b451b1bf1aab590700
SHA1 (patch-ac) = 2c913fde3564efdb40ed3b946218d3b4f64d584a
SHA1 (patch-ad) = 1df65aaa8c87f65c58348015361de786aa3073f1

View File

@@ -0,0 +1,58 @@
#! @SH@
libtsocks="@PREFIX@/lib/libtsocks.so"
usage() {
echo "usage:"
echo " $0 [program [arguments...]]"
echo " . $0 on"
echo " . $0 off"
}
tsocks_on() {
case $LD_PRELOAD in
*"$libtsocks"*)
;;
"") LD_PRELOAD="$libtsocks"
;;
*) LD_PRELOAD="$LD_PRELOAD $libtsocks"
;;
esac
export LD_PRELOAD
}
tsocks_off() {
LD_PRELOAD=`echo $LD_PRELOAD | sed 's,$libtsocks[ :]?,,'`
if [ "$LD_PRELOAD" ]; then
export LD_PRELOAD
else
unset LD_PRELOAD
fi
}
if [ $# -eq 0 ]; then
set -- ${SHELL:-/bin/sh}
fi
case "$1" in
on)
tsocks_on
;;
off)
tsocks_off
;;
show | sh)
echo "LD_PRELOAD=\"$LD_PRELOAD\""
;;
-h | -?)
usage
;;
-*) usage 1>&2
exit 1
;;
*)
tsocks_on
exec "$@"
;;
esac

View File

@@ -0,0 +1,77 @@
$NetBSD: patch-aa,v 1.4 2006/09/17 11:50:15 jmmv Exp $
--- Makefile.in.orig 2002-03-16 11:12:40.000000000 +0100
+++ Makefile.in
@@ -13,7 +13,7 @@ includedir = @includedir@
SHELL = /bin/sh
MKINSTALLDIRS = ${SHELL} mkinstalldirs
-SHCC = ${CC} -fPIC
+SHCC = ${LIBTOOL} --mode=compile ${CC}
INSPECT = inspectsocks
SAVE = saveme
LIB_NAME = libtsocks
@@ -23,7 +23,7 @@ VALIDATECONF = validateconf
SCRIPT = tsocks
SHLIB_MAJOR = 1
SHLIB_MINOR = 8
-SHLIB = ${LIB_NAME}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
+SHLIB = ${LIB_NAME}.la
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -34,26 +34,25 @@ SPECIALLIBS = @SPECIALLIBS@
SHOBJS = ${OBJS:.o=.so}
-OBJS= tsocks.o
+OBJS= tsocks.lo
-TARGETS= ${SHLIB} ${UTIL_LIB} ${SAVE} ${INSPECT} ${VALIDATECONF}
+TARGETS= ${SHLIB} ${UTIL_LIB} ${INSPECT} ${VALIDATECONF}
all: ${TARGETS}
${VALIDATECONF}: ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o
- ${SHCC} ${CFLAGS} ${INCLUDES} -o ${VALIDATECONF} ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o ${LIBS}
+ ${CC} ${CFLAGS} ${INCLUDES} -o ${VALIDATECONF} ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o ${LIBS}
${INSPECT}: ${INSPECT}.c ${COMMON}.o
- ${SHCC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS}
+ ${CC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS}
${SAVE}: ${SAVE}.c
- ${SHCC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c
+ ${CC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c
-${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o
- ${SHCC} ${CFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}
- ln -sf ${SHLIB} ${LIB_NAME}.so
+${SHLIB}: ${OBJS} ${COMMON}.lo ${PARSER}.lo
+ ${LIBTOOL} --mode=link ${CC} -rpath ${PREFIX}/lib -version-info ${SHLIB_MAJOR}:${SHLIB_MINOR} ${LDFLAGS} -o ${SHLIB} ${OBJS} ${COMMON}.lo ${PARSER}.lo ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}
-%.so: %.c
+%.lo: %.c
${SHCC} ${CFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@
%.o: %.c
@@ -67,9 +66,7 @@ installscript:
installlib:
${MKINSTALLDIRS} "${DESTDIR}${libdir}"
- ${INSTALL} ${SHLIB} ${DESTDIR}${libdir}
- ln -sf ${SHLIB} ${DESTDIR}${libdir}/${LIB_NAME}.so.${SHLIB_MAJOR}
- ln -sf ${LIB_NAME}.so.${SHLIB_MAJOR} ${DESTDIR}${libdir}/${LIB_NAME}.so
+ ${LIBTOOL} --mode=install ${INSTALL} ${SHLIB} ${DESTDIR}${libdir}
installman:
${MKINSTALLDIRS} "${DESTDIR}${mandir}/man1"
@@ -78,7 +75,7 @@ installman:
${INSTALL_DATA} tsocks.8 ${DESTDIR}${mandir}/man8/
${MKINSTALLDIRS} "${DESTDIR}${mandir}/man5"
${INSTALL_DATA} tsocks.conf.5 ${DESTDIR}${mandir}/man5/
-
+
clean:
-rm -f *.so *.so.* *.o *~ ${TARGETS}

View File

@@ -0,0 +1,83 @@
$NetBSD: patch-ab,v 1.4 2006/03/23 16:37:46 joerg Exp $
--- configure.orig 2002-07-15 22:51:08.000000000 +0000
+++ configure
@@ -538,7 +538,6 @@ fi
-test "$libdir" = "\${exec_prefix}/lib" && libdir="/lib"
# Check whether --enable-socksdns or --disable-socksdns was given.
if test "${enable_socksdns+set}" = set; then
@@ -1375,7 +1374,7 @@ fi
done
-for ac_func in strcspn strdup strerror strspn strtol
+for ac_func in strcspn strdup strerror strspn strtol dlopen
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1382: checking for $ac_func" >&5
@@ -1426,9 +1425,11 @@ if eval "test \"`echo '$ac_cv_func_'$ac_
EOF
else
+if [ ${ac_func} != "dlopen" ]; then
echo "$ac_t""no" 1>&6
{ echo "configure: error: "Required function not found"" 1>&2; exit 1; }
fi
+fi
done
@@ -1836,6 +1837,7 @@ fi
SIMPLELIBS=${LIBS}
LIBS=
+if [ $ac_cv_func_dlopen != "yes" ]; then
echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6
echo "configure:1841: checking for dlsym in -ldl" >&5
ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'`
@@ -1883,6 +1885,7 @@ else
echo "$ac_t""no" 1>&6
{ echo "configure: error: "libdl is required"" 1>&2; exit 1; }
fi
+fi
echo $ac_n "checking "for RTLD_NEXT from dlfcn.h"""... $ac_c" 1>&6
@@ -2078,12 +2081,16 @@ EOF
echo $ac_n "checking "location of libc.so"""... $ac_c" 1>&6
echo "configure:2081: checking "location of libc.so"" >&5
+ if test "$OPSYS" != "IRIX"; then
LIBC=
for DIR in '/lib' '/usr/lib'; do
if test "${LIBC}" = ""; then
LIBC=`$FIND $DIR -name "libc.so.?" 2>/dev/null | $TAIL -1`
fi
done
+ else
+ LIBC=/usr/lib$ABI/libc.so
+ fi
cat >> confdefs.h <<EOF
#define LIBC "${LIBC}"
@@ -2151,6 +2158,7 @@ do
#line 2152 "configure"
#include "confdefs.h"
+ #include <sys/types.h>
#include <sys/socket.h>
int connect($testproto);
@@ -2228,7 +2236,7 @@ EOF
echo $ac_n "checking for correct poll prototype""... $ac_c" 1>&6
echo "configure:2230: checking for correct poll prototype" >&5
PROTO=
-for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout'
+for testproto in 'struct pollfd *ufds, nfds_t nfds, int timeout' 'struct pollfd *ufds, unsigned int nfds, int timeout'
do
if test "${PROTO}" = ""; then
cat > conftest.$ac_ext <<EOF

View File

@@ -0,0 +1,48 @@
$NetBSD: patch-ac,v 1.2 2006/09/17 11:45:04 jmmv Exp $
Except for the first two chunks:
https://sourceforge.net/tracker/index.php?func=detail&aid=1252703&group_id=17338&atid=117338
--- tsocks.c.orig 2002-07-16 00:50:52.000000000 +0200
+++ tsocks.c
@@ -68,7 +68,7 @@ static int suid = 0;
static char *conffile = NULL;
/* Exported Function Prototypes */
-void _init(void);
+void __tsocks_init(void) __attribute__ ((__constructor__));
int connect(CONNECT_SIGNATURE);
int select(SELECT_SIGNATURE);
int poll(POLL_SIGNATURE);
@@ -100,7 +100,7 @@ static int read_socksv4_req(struct connr
static int read_socksv5_connect(struct connreq *conn);
static int read_socksv5_auth(struct connreq *conn);
-void _init(void) {
+void __tsocks_init(void) {
#ifdef USE_OLD_DLSYM
void *lib;
#endif
@@ -658,7 +658,7 @@ int poll(POLL_SIGNATURE) {
* come around again (since we can't flag it for read, we don't know
* if there is any data to be read and can't be bothered checking) */
if (conn->selectevents & WRITE) {
- setevents |= POLLOUT;
+ ufds[i].revents |= (conn->selectevents & WRITE);
nevents++;
}
}
@@ -852,7 +852,12 @@ static int connect_server(struct connreq
sizeof(conn->serveraddr));
show_msg(MSGDEBUG, "Connect returned %d, errno is %d\n", rc, errno);
- if (rc) {
+ if (rc && errno == EISCONN) {
+ rc = 0;
+ show_msg(MSGDEBUG, "Socket %d already connected to SOCKET server\n",
+ conn->sockid);
+ conn->state = CONNECTED;
+ } else if (rc) {
if (errno != EINPROGRESS) {
show_msg(MSGERR, "Error %d attempting to connect to SOCKS "
"server (%s)\n", errno, strerror(errno));

View File

@@ -0,0 +1,19 @@
$NetBSD: patch-ad,v 1.1 2006/09/17 11:45:04 jmmv Exp $
https://sourceforge.net/tracker/index.php?func=detail&aid=1252703&group_id=17338&atid=117338
--- tsocks.h.orig 2002-03-13 13:58:09.000000000 +0100
+++ tsocks.h
@@ -75,9 +75,9 @@ struct connreq {
#define FAILED 14
/* Flags to indicate what events a socket was select()ed for */
-#define READ (1<<0)
-#define WRITE (1<<1)
-#define EXCEPT (1<<2)
+#define READ (POLLIN|POLLRDNORM)
+#define WRITE (POLLOUT|POLLWRNORM|POLLWRBAND)
+#define EXCEPT (POLLRDBAND|POLLPRI)
#define READWRITE (READ|WRITE)
#define READWRITEEXCEPT (READ|WRITE|EXCEPT)