diff --git a/net/tsocks/Makefile b/net/tsocks/Makefile new file mode 100644 index 00000000..ebdbd71d --- /dev/null +++ b/net/tsocks/Makefile @@ -0,0 +1,41 @@ +PORTNAME= tsocks +DISTVERSION= 1.8.b5 +CATEGORIES= net security +MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/1.8%20beta%205 \ + http://ftp1.sourceforge.net/tsocks/ \ + http://www.yazzy.org/ports/tsocks/ +DISTNAME= ${PORTNAME}-${PORTVERSION:C/.b/beta/} + +MAINTAINER= ehaupt@FreeBSD.org +COMMENT= Allow non SOCKS aware applications to use SOCKS without modification +WWW= https://tsocks.sourceforge.net + +USES= gmake +USE_LDCONFIG= yes + +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --libdir=${PREFIX}/lib \ + --with-conf=${PREFIX}/etc/tsocks.conf + +SUB_FILES= pkg-message + +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION:C/.b.*//} + +#CONFIGURE_ARGS+= --disable-hostnames +#CONFIGURE_ARGS+= --disable-debug +#CONFIGURE_ARGS+= --enable-oldmethod +#CONFIGURE_ARGS+= --enable-socksdns + +post-patch: + ${REINPLACE_CMD} -e 's|/usr|${PREFIX}|' ${WRKSRC}/tsocks + +post-install: + ${INSTALL_PROGRAM} ${WRKSRC}/inspectsocks ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/validateconf ${STAGEDIR}${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/tsocks.conf.simple.example \ + ${STAGEDIR}${PREFIX}/etc/tsocks.conf.sample + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/*.example ${STAGEDIR}${EXAMPLESDIR} + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so + +.include diff --git a/net/tsocks/distinfo b/net/tsocks/distinfo new file mode 100644 index 00000000..8268e441 --- /dev/null +++ b/net/tsocks/distinfo @@ -0,0 +1,2 @@ +SHA256 (tsocks-1.8beta5.tar.gz) = 849d7ef5af80d03e76cc05ed9fb8fa2bcc2b724b51ebfd1b6be11c7863f5b347 +SIZE (tsocks-1.8beta5.tar.gz) = 83928 diff --git a/net/tsocks/files/patch-INSTALL b/net/tsocks/files/patch-INSTALL new file mode 100644 index 00000000..65c3898c --- /dev/null +++ b/net/tsocks/files/patch-INSTALL @@ -0,0 +1,113 @@ +--- INSTALL.orig 2002-05-18 02:12:30 UTC ++++ INSTALL +@@ -1,12 +1,7 @@ +-Quick Installation Instructions ++Quick Instructions + ------------------------------- + +-1. Unpack the archive (though if you're reading this you've already +-achieved that) +- +- tar -zxvf tsocks-.tar.gx +- +-2. Run ./configure, options which might be of interest (and that are ++1. Explenations of the ./configure options which might be of interest (and that are + specific to tsocks include): + --enable-socksdns This option causes tsocks to intercept + DNS lookups and attempt to force them +@@ -39,55 +34,31 @@ achieved that) + Other standard autoconf options are provided by typing './configure + --help' + +-NOTE: The install path for the library is _NOT_ prefixed with --prefix, +-this is because it is strongly recommended that tsocks is installed into +-/lib (and not /usr/lib). This is important if tsocks is put into +-/etc/ld.so.preload since /usr is not mounted on many systems at boot +-time, meaning that programs running before /usr is mounted will try to +-preload tsocks, fail to find it and die, making the machine unusable. If +-you really wish to install the library into some other path use --libdir. +- +-3. Compile the code by typing: +- +- make ++2. Created files: + +-This should result in the creation of the following: + - libtsocks.so - the libtsocks library + - validateconf - a utility to verify the tsocks configuration file + - inspectsocks - a utility to determine the version of a socks server + - saveme - a statically linked utility to remove /etc/ld.so.preload + if it becomes corrupt ++ - man pages - tsocks(8), tsocks(1) and tsocks.conf(5) + +-4. If you experience any errors at this step and don't know how to fix +-them, seek help using the contacts listed on +-http://tsocks.sourceforge.net/contact.php +- +-5. Install the compiled library. You can skip this step if you only plan +-to use the library for personal use. If you want all users on the machine +-to be able to use it however, su to root then type +- +- make install +- +-This will install the library, the tsocks script and its man pages +-(tsocks(8), tsocks(1) and tsocks.conf(5)) to the paths specified to +-configure. +- +-Note that by default the library is installed to /lib and that the +-configure --prefix is IGNORED. See above for more detail. ++3. Configuration + +-6. At this point you'll need to create the tsocks configuration file. +-There are two samples provided in the build directory called ++You'll need to create the tsocks configuration file. ++There are two samples provided in the build directory and ++/usr/local/share/examples/tsocks called + tsocks.conf.simple.example and tsocks.conf.complex.example. + Documentation on the configuration file format is provided in the + tsocks.conf man page ('man tsocks.conf'). + +-7. Having created the tsocks.conf file you should verify it using ++4. Having created the tsocks.conf file you should verify it using + validateconf (some detail on validateconf can be found in the tsocks.conf + man page). Normally validateconf is run without arguments + ('./validateconf'). Any errors which are displayed by validateconf need + to be rectified before tsocks will function correctly. + +-8. You can now choose to make the library affect all users or just those ++5. You can now choose to make the library affect all users or just those + who choose to use it. If you want users to use it themselves, they can + simply use the tsocks(1) shell script to run programs (see 'man tsocks') + or do the following in their shell before running applications that need +@@ -97,25 +68,15 @@ to be transparently proxied: + + (in CSH) setenv LD_PRELOAD + +- = e.g /lib/libtsocks.so.1.8 +- +-If you want all users to pick up the library, place the full path to the +-full library in the file /etc/ld.so.preload (e.g "/lib/libtsocks.so"). Be +-EXTREMELY careful if you do this, if you mistype it or in some way get it +-wrong this will make your machine UNUSABLE. Also, if you do this, make +-sure the directory you put the library in is in the root of the +-filesystem, if the library is not available at boot time, again, your +-machine will be UNUSABLE. ++ = e.g /usr/local/lib/tsocks/libtsocks.so.1.8 + +-9. Go ahead and use it! At this point everything should work. Again, if ++6. Go ahead and use it! At this point everything should work. Again, if + you experience any problems, use the contact points listed at +-http://tsocks.sourceforge.net/contact.php. If you do happen to break your +-machine with /etc/ld.so.preload, the build process creates a statically +-linked executable called saveme in the build directory. This executable +-simply unlinks /etc/ld.so.preload, this may or may not save you so give +-it a try. If it fails, you'll need to switch off the machine and get a +-rescue disk (e.g tomsrtbt) mount the disk and remove the file manually. ++http://tsocks.sourceforge.net/contact.php. + + Thats it, + + Thanks, Shaun Clowes (delius@progsoc.org) ++ ++ ++Adapted for FreeBSD by Marcin Jessa (yazzy@yazzy.org) diff --git a/net/tsocks/files/patch-Makefile.in b/net/tsocks/files/patch-Makefile.in new file mode 100644 index 00000000..9e9563ee --- /dev/null +++ b/net/tsocks/files/patch-Makefile.in @@ -0,0 +1,12 @@ +--- Makefile.in.orig 2002-03-16 10:12:40 UTC ++++ Makefile.in +@@ -67,8 +67,7 @@ installscript: + + installlib: + ${MKINSTALLDIRS} "${DESTDIR}${libdir}" +- ${INSTALL} ${SHLIB} ${DESTDIR}${libdir} +- ln -sf ${SHLIB} ${DESTDIR}${libdir}/${LIB_NAME}.so.${SHLIB_MAJOR} ++ ${INSTALL} ${SHLIB} ${DESTDIR}${libdir}/${LIB_NAME}.so.${SHLIB_MAJOR} + ln -sf ${LIB_NAME}.so.${SHLIB_MAJOR} ${DESTDIR}${libdir}/${LIB_NAME}.so + + installman: diff --git a/net/tsocks/files/patch-configure b/net/tsocks/files/patch-configure new file mode 100644 index 00000000..68a2c7c9 --- /dev/null +++ b/net/tsocks/files/patch-configure @@ -0,0 +1,56 @@ +--- configure.orig 2002-07-15 22:51:08 UTC ++++ configure +@@ -1836,14 +1836,14 @@ fi + SIMPLELIBS=${LIBS} + LIBS= + +-echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6 +-echo "configure:1841: checking for dlsym in -ldl" >&5 ++echo $ac_n "checking for dlsym in -lc""... $ac_c" 1>&6 ++echo "configure:1841: checking for dlsym in -lc" >&5 + ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-ldl $LIBS" ++LIBS="-lc $LIBS" + cat > conftest.$ac_ext <&6 +@@ -2151,6 +2151,7 @@ do + #line 2152 "configure" + #include "confdefs.h" + ++ #include + #include + int connect($testproto); + +@@ -2227,14 +2228,16 @@ 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' ++PROTO1="struct pollfd fds[], nfds_t nfds, int timeout" ++PROTO2="struct pollfd *fds, unsigned int nfds, int timeout" ++for PROTO in "$PROTO1" "$PROTO2" + do + if test "${PROTO}" = ""; then + cat > conftest.$ac_ext < + #include + int poll($testproto); + diff --git a/net/tsocks/files/patch-parser.c b/net/tsocks/files/patch-parser.c new file mode 100644 index 00000000..1c98675c --- /dev/null +++ b/net/tsocks/files/patch-parser.c @@ -0,0 +1,10 @@ +--- parser.c.orig 2002-03-13 12:34:22 UTC ++++ parser.c +@@ -4,6 +4,7 @@ + + */ + ++#include + #include + #include + #include diff --git a/net/tsocks/files/patch-tsocks b/net/tsocks/files/patch-tsocks new file mode 100644 index 00000000..ee7b7441 --- /dev/null +++ b/net/tsocks/files/patch-tsocks @@ -0,0 +1,11 @@ +--- tsocks.orig 2002-03-16 10:27:18 UTC ++++ tsocks +@@ -53,7 +53,7 @@ case "$1" in + fi + ;; + off) +- export LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's/\/usr\/lib\/libtsocks.so \?//'` ++ export LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's|/usr/lib/libtsocks.so[[:blank:]]*||'` + if [ -z "$LD_PRELOAD" ] + then + unset LD_PRELOAD diff --git a/net/tsocks/files/patch-tsocks.1 b/net/tsocks/files/patch-tsocks.1 new file mode 100644 index 00000000..a592243c --- /dev/null +++ b/net/tsocks/files/patch-tsocks.1 @@ -0,0 +1,63 @@ +--- tsocks.1.orig 2002-03-16 10:34:44 UTC ++++ tsocks.1 +@@ -1,24 +1,24 @@ +-.TH TSOCKS 1 "" "TSOCKS" +- +-.SH NAME ++.\" ++.TH "TSOCKS" "1" "" "TSOCKS" "" ++.SH "NAME" + .BR tsocks + \- Shell wrapper to simplify the use of the tsocks(8) library to + transparently allow an application to use a SOCKS proxy +-.SH SYNOPSIS ++.SH "SYNOPSIS" + .B tsocks + .RB [application\ [application's\ arguments]] +-.br ++.br + or + .B tsocks + .RB [on|off] +-.br ++.br + or + .B tsocks +-.SH DESCRIPTION ++.SH "DESCRIPTION" + .B tsocks + is a wrapper between the tsocks library and the application what you + would like to run socksified. +-.SH OPTIONS ++.SH "OPTIONS" + .IP \fB[application\ \fB[application's\ arguments]] + run the application as specified with the environment (LD_PRELOAD) set + such that tsocks(8) will transparently proxy SOCKS connections in +@@ -28,19 +28,19 @@ this option adds or removes tsocks(8) fr + variable. When tsocks(8) is in this variable all executed + applications are automatically socksified. If you want to + use this function, you HAVE to source the shell script from yours, +-like this: "source /usr/bin/tsocks" or ". /usr/bin/tsocks" +-.br ++like this: "source /usr/local/bin/tsocks" or ". /usr/local/bin/tsocks" ++.br + Example: +-.br +-". tsocks on" -- add the tsocks lib to LD_PRELOAD +-.br +-". tsocks off" -- remove the tsocks lib from LD_PRELOAD ++.br ++". tsocks on" \-\- add the tsocks lib to LD_PRELOAD ++.br ++". tsocks off" \-\- remove the tsocks lib from LD_PRELOAD + .IP \fB[show|sh] + show the current value of the LD_PRELOAD variable + .IP \fB + create a new shell with LD_PRELOAD including tsocks(8). +-.PP +-.SH AUTHOR ++.PP ++.SH "AUTHOR" + This script was created by Tamas SZERB for the debian + package of tsocks. It (along with this manual page) have since been + adapted into the main tsocks project and modified. diff --git a/net/tsocks/files/patch-tsocks.8 b/net/tsocks/files/patch-tsocks.8 new file mode 100644 index 00000000..ec1b8ae3 --- /dev/null +++ b/net/tsocks/files/patch-tsocks.8 @@ -0,0 +1,168 @@ +--- tsocks.8.orig 2002-03-16 10:20:51 UTC ++++ tsocks.8 +@@ -1,25 +1,24 @@ +-.TH TSOCKS 8 "" "Shaun Clowes" \" -*- +- \" nroff -* +- +-.SH NAME ++.\" \" nroff -* ++.\" ++.TH "TSOCKS" "8" "" "Shaun Clowes" "\"" ++.SH "NAME" + .BR tsocks + \- Library for intercepting outgoing network connections and + redirecting them through a SOCKS server. + +-.SH SYNOPSIS +- ++.SH "SYNOPSIS" + Set LD_PRELOAD to load the library then use applications as normal + + The syntax to force preload of the library for different shells is + specified below: + +-Bash, Ksh and Bourne shell - ++Bash, Ksh and Bourne shell \- + +-export LD_PRELOAD=/lib/libtsocks.so ++export LD_PRELOAD=/usr/local/lib/libtsocks.so + +-C Shell - ++C Shell \- + +-setenv LD_PRELOAD=/lib/libtsocks.so ++setenv LD_PRELOAD=/usr/local/lib/libtsocks.so + + This process can be automated (for Bash, Bourne and Korn shell + users) for a single command or for all commands in a shell session +@@ -30,13 +29,12 @@ automatically use it, a very useful configuration. For + information on this configuration see the CAVEATS section of this + manual page. + +-.SH DESCRIPTION +- ++.SH "DESCRIPTION" + .BR tsocks + is a library to allow transparent SOCKS proxying. It wraps the normal + connect() function. When a connection is attempted, it consults the + configuration file (which is defined at configure time but defaults to +-/etc/tsocks.conf) and determines if the IP address specified is local. If ++/usr/local/etc/tsocks.conf) and determines if the IP address specified is local. If + it is not, the library redirects the connection to a SOCKS server + specified in the configuration file. It then negotiates that connection + with the SOCKS server and passes the connection back to the calling +@@ -52,42 +50,42 @@ the SOCKSified TCP/IP stacks seen on other platforms. + Most arguments to + .BR tsocks + are provided in the configuration file (the location of which is defined +-at configure time by the --with-conf= argument but defaults to +-/etc/tsocks.conf). The structure of this file is documented in tsocks.conf(8) ++at configure time by the \-\-with\-conf= argument but defaults to ++/usr/local/etc/tsocks.conf). The structure of this file is documented in tsocks.conf(8) + + Some configuration options can be specified at run time using environment + variables as follows: + +-.TP ++.TP + .I TSOCKS_CONFFILE + This environment variable overrides the default location of the tsocks + configuration file. This variable is not honored if the program tsocks + is embedded in is setuid. In addition this environment variable can +-be compiled out of tsocks with the --disable-envconf argument to ++be compiled out of tsocks with the \-\-disable\-envconf argument to + configure at build time + +-.TP ++.TP + .I TSOCKS_DEBUG + This environment variable sets the level of debug output that should be + generated by tsocks (debug output is generated in the form of output to + standard error). If this variable is not present by default the logging + level is set to 0 which indicates that only error messages should be output. + Setting it to higher values will cause tsocks to generate more messages +-describing what it is doing. If set to -1 tsocks will output absolutely no ++describing what it is doing. If set to \-1 tsocks will output absolutely no + error or debugging messages. This is only needed if tsocks output interferes + with a program it is embedded in. Message output can be permanently compiled +-out of tsocks by specifying the --disable-debug option to configure at ++out of tsocks by specifying the \-\-disable\-debug option to configure at + build time + +-.TP ++.TP + .I TSOCKS_DEBUG_FILE + This option can be used to redirect the tsocks output (which would normally + be sent to standard error) to a file. This variable is not honored if the + program tsocks is embedded in is setuid. For programs where tsocks output + interferes with normal operation this option is generally better than +-disabling messages (with TSOCKS_DEBUG = -1) ++disabling messages (with TSOCKS_DEBUG = \-1) + +-.TP ++.TP + .I TSOCKS_USERNAME + This environment variable can be used to specify the username to be used when + version 5 SOCKS servers request username/password authentication. This +@@ -95,7 +93,7 @@ overrides the default username that can be specified i + file using 'default_user', see tsocks.conf(8) for more information. This + variable is ignored for version 4 SOCKS servers. + +-.TP ++.TP + .I TSOCKS_PASSWORD + This environment variable can be used to specify the password to be used when + version 5 SOCKS servers request username/password authentication. This +@@ -115,11 +113,12 @@ consult the INSTALL file for more information. + .BR tsocks + will generate error messages and print them to stderr when there are + problems with the configuration file or the SOCKS negotiation with the +-server if the TSOCKS_DEBUG environment variable is not set to -1 or and +---disable-debug was not specified at compile time. This output may cause ++server if the TSOCKS_DEBUG environment variable is not set to \-1 or and ++\-\-disable\-debug was not specified at compile time. This output may cause + some problems with programs that redirect standard error. + + .SS CAVEATS ++.BR Linux specific: + .BR tsocks + will not in the above configuration be able to provide SOCKS proxying to + setuid applications or applications that are not run from a shell. You can +@@ -132,8 +131,7 @@ the INSTALL file for more info). THIS IS A ***WARNING + careful. Also be sure the library is in the root filesystem as all hell + will break loose if the directory it is in is not available at boot time. + +-.SH BUGS +- ++.SH "BUGS" + .BR tsocks + can only proxy outgoing TCP connections + +@@ -157,21 +155,21 @@ not. This introduces overhead and should only be used + .BR tsocks + uses ELF dynamic loader features to intercept dynamic function calls from + programs in which it is embedded. As a result, it cannot trace the +-actions of statically linked executables, non-ELF executables, or ++actions of statically linked executables, non\-ELF executables, or + executables that make system calls directly with the system call trap or + through the syscall() routine. + +-.SH FILES +-/etc/tsocks.conf - default tsocks configuration file ++.SH "FILES" ++/usr/local/etc/tsocks.conf \- default tsocks configuration file + +-.SH SEE ALSO ++.SH "SEE ALSO" + tsocks.conf(5) + tsocks(1) + +-.SH AUTHOR ++.SH "AUTHOR" + Shaun Clowes (delius@progsoc.uts.edu.au) + +-.SH COPYRIGHT ++.SH "COPYRIGHT" + Copyright 2000 Shaun Clowes + + tsocks and its documentation may be freely copied under the terms and diff --git a/net/tsocks/files/patch-tsocks.c b/net/tsocks/files/patch-tsocks.c new file mode 100644 index 00000000..4694fc25 --- /dev/null +++ b/net/tsocks/files/patch-tsocks.c @@ -0,0 +1,133 @@ +--- tsocks.c.orig 2002-07-15 22:50:52 UTC ++++ tsocks.c +@@ -531,12 +531,12 @@ int poll(POLL_SIGNATURE) { + /* If we're not currently managing any requests we can just + * leave here */ + if (!requests) +- return(realpoll(ufds, nfds, timeout)); ++ return(realpoll(fds, nfds, timeout)); + + get_environment(); + + show_msg(MSGDEBUG, "Intercepted call to poll with %d fds, " +- "0x%08x timeout %d\n", nfds, ufds, timeout); ++ "0x%08x timeout %d\n", nfds, fds, timeout); + + for (conn = requests; conn != NULL; conn = conn->next) + conn->selectevents = 0; +@@ -544,16 +544,16 @@ int poll(POLL_SIGNATURE) { + /* Record what events on our sockets the caller was interested + * in */ + for (i = 0; i < nfds; i++) { +- if (!(conn = find_socks_request(ufds[i].fd, 0))) ++ if (!(conn = find_socks_request(fds[i].fd, 0))) + continue; + show_msg(MSGDEBUG, "Have event checks for socks enabled socket %d\n", + conn->sockid); +- conn->selectevents = ufds[i].events; ++ conn->selectevents = fds[i].events; + monitoring = 1; + } + + if (!monitoring) +- return(realpoll(ufds, nfds, timeout)); ++ return(realpoll(fds, nfds, timeout)); + + /* This is our poll loop. In it we repeatedly call poll(). We + * pass select the same event list as provided by the caller except we +@@ -566,25 +566,25 @@ int poll(POLL_SIGNATURE) { + do { + /* Enable our sockets for the events WE want to hear about */ + for (i = 0; i < nfds; i++) { +- if (!(conn = find_socks_request(ufds[i].fd, 0))) ++ if (!(conn = find_socks_request(fds[i].fd, 0))) + continue; + + /* We always want to know about socket exceptions but they're + * always returned (i.e they don't need to be in the list of + * wanted events to be returned by the kernel */ +- ufds[i].events = 0; ++ fds[i].events = 0; + + /* If we're waiting for a connect or to be able to send + * on a socket we want to get write events */ + if ((conn->state == SENDING) || (conn->state == CONNECTING)) +- ufds[i].events |= POLLOUT; ++ fds[i].events |= POLLOUT; + /* If we're waiting to receive data we want to get + * read events */ + if (conn->state == RECEIVING) +- ufds[i].events |= POLLIN; ++ fds[i].events |= POLLIN; + } + +- nevents = realpoll(ufds, nfds, timeout); ++ nevents = realpoll(fds, nfds, timeout); + /* If there were no events we must have timed out or had an error */ + if (nevents <= 0) + break; +@@ -597,29 +597,29 @@ int poll(POLL_SIGNATURE) { + continue; + + /* Find the socket in the poll list */ +- for (i = 0; ((i < nfds) && (ufds[i].fd != conn->sockid)); i++) ++ for (i = 0; ((i < nfds) && (fds[i].fd != conn->sockid)); i++) + /* Empty Loop */; + if (i == nfds) + continue; + + show_msg(MSGDEBUG, "Checking socket %d for events\n", conn->sockid); + +- if (!ufds[i].revents) { ++ if (!fds[i].revents) { + show_msg(MSGDEBUG, "No events on socket\n"); + continue; + } + + /* Clear any read or write events on the socket, we'll reset + * any that are necessary later. */ +- setevents = ufds[i].revents; ++ setevents = fds[i].revents; + if (setevents & POLLIN) { + show_msg(MSGDEBUG, "Socket had read event\n"); +- ufds[i].revents &= ~POLLIN; ++ fds[i].revents &= ~POLLIN; + nevents--; + } + if (setevents & POLLOUT) { + show_msg(MSGDEBUG, "Socket had write event\n"); +- ufds[i].revents &= ~POLLOUT; ++ fds[i].revents &= ~POLLOUT; + nevents--; + } + if (setevents & (POLLERR | POLLNVAL | POLLHUP)) +@@ -669,10 +669,10 @@ int poll(POLL_SIGNATURE) { + + /* Now restore the events polled in each of the blocks */ + for (i = 0; i < nfds; i++) { +- if (!(conn = find_socks_request(ufds[i].fd, 1))) ++ if (!(conn = find_socks_request(fds[i].fd, 1))) + continue; + +- ufds[i].events = conn->selectevents; ++ fds[i].events = conn->selectevents; + } + + return(nevents); +@@ -852,7 +852,7 @@ static int connect_server(struct connreq *conn) { + sizeof(conn->serveraddr)); + + show_msg(MSGDEBUG, "Connect returned %d, errno is %d\n", rc, errno); +- if (rc) { ++ if (rc && errno != EISCONN) { + if (errno != EINPROGRESS) { + show_msg(MSGERR, "Error %d attempting to connect to SOCKS " + "server (%s)\n", errno, strerror(errno)); +@@ -862,6 +862,7 @@ static int connect_server(struct connreq *conn) { + conn->state = CONNECTING; + } + } else { ++ rc = 0; + show_msg(MSGDEBUG, "Socket %d connected to SOCKS server\n", conn->sockid); + conn->state = CONNECTED; + } diff --git a/net/tsocks/files/pkg-message.in b/net/tsocks/files/pkg-message.in new file mode 100644 index 00000000..4f3ec123 --- /dev/null +++ b/net/tsocks/files/pkg-message.in @@ -0,0 +1,10 @@ +[ +{ type: install + message: <