diff options
author | jmmv <jmmv@pkgsrc.org> | 2006-09-17 11:45:04 +0000 |
---|---|---|
committer | jmmv <jmmv@pkgsrc.org> | 2006-09-17 11:45:04 +0000 |
commit | 20adb265453d81f998d4f35e2f8085d50e7ecdfc (patch) | |
tree | b1f2c3bf9298cf3b40c04a80949f95c25eccf65e /net/tsocks | |
parent | 0ec6b379edaa0149438078e067cab8aa6de3e8d5 (diff) | |
download | pkgsrc-20adb265453d81f998d4f35e2f8085d50e7ecdfc.tar.gz |
Fix serious portability issues (to NetBSD) as regards poll(2) usage.
This change lets, e.g. tnftp work when using tsocks. From soda@ in
PR pkg/30921. Bump PKGREVISION to 2.
Diffstat (limited to 'net/tsocks')
-rw-r--r-- | net/tsocks/Makefile | 4 | ||||
-rw-r--r-- | net/tsocks/distinfo | 5 | ||||
-rw-r--r-- | net/tsocks/patches/patch-ac | 30 | ||||
-rw-r--r-- | net/tsocks/patches/patch-ad | 19 |
4 files changed, 52 insertions, 6 deletions
diff --git a/net/tsocks/Makefile b/net/tsocks/Makefile index 921a92c4186..2b98ffcfabf 100644 --- a/net/tsocks/Makefile +++ b/net/tsocks/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.10 2006/04/22 09:22:13 rillig Exp $ +# $NetBSD: Makefile,v 1.11 2006/09/17 11:45:04 jmmv Exp $ # DISTNAME= tsocks-1.8beta5 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=tsocks/} diff --git a/net/tsocks/distinfo b/net/tsocks/distinfo index d572667556a..8d501ad54ba 100644 --- a/net/tsocks/distinfo +++ b/net/tsocks/distinfo @@ -1,8 +1,9 @@ -$NetBSD: distinfo,v 1.5 2006/03/23 16:37:46 joerg Exp $ +$NetBSD: distinfo,v 1.6 2006/09/17 11:45:04 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) = a789618746a8666d2dc476f8b8ac975209892723 SHA1 (patch-ab) = 01f621f9b59d87b5305ea8b451b1bf1aab590700 -SHA1 (patch-ac) = 3e5c38ca7ea7c0a499e1ed42dca406b8d5769333 +SHA1 (patch-ac) = 2c913fde3564efdb40ed3b946218d3b4f64d584a +SHA1 (patch-ad) = 1df65aaa8c87f65c58348015361de786aa3073f1 diff --git a/net/tsocks/patches/patch-ac b/net/tsocks/patches/patch-ac index 40696e1381e..7437d0875c3 100644 --- a/net/tsocks/patches/patch-ac +++ b/net/tsocks/patches/patch-ac @@ -1,6 +1,9 @@ -$NetBSD: patch-ac,v 1.1 2005/08/04 10:22:21 drochner Exp $ +$NetBSD: patch-ac,v 1.2 2006/09/17 11:45:04 jmmv Exp $ ---- tsocks.c.orig 2005-08-04 11:46:19.000000000 +0200 +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; @@ -20,3 +23,26 @@ $NetBSD: patch-ac,v 1.1 2005/08/04 10:22:21 drochner Exp $ #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)); diff --git a/net/tsocks/patches/patch-ad b/net/tsocks/patches/patch-ad new file mode 100644 index 00000000000..bdebe74e1e7 --- /dev/null +++ b/net/tsocks/patches/patch-ad @@ -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) + |