Permalink
Browse files

add dante 1.2.2, by MaxMuster & er13 (closes #1027)

git-svn-id: file:///var/svn/freetz/trunk@9130 149334a1-2f27-0410-a3b9-fc62619ac1e6
  • Loading branch information...
1 parent 409cdaa commit 53230bdecb4584998c1f81c38456d188eb8b8fee cuma committed Jun 1, 2012
View
@@ -78,6 +78,7 @@ Latest changes:
* apache 2.4.2
* avahi 0.6.30
* CCID 1.4.6
+ * dante 1.2.2
* dbus 1.5.6
* fowsr 1.0
* inadyn-opendns 1.99
View
@@ -102,6 +102,7 @@ source make/classpath/Config.in
source make/comgt/Config.in
source make/cryptsetup/Config.in
source make/ctorrent/Config.in
+source make/dante/Config.in
source make/davfs2/Config.in
source make/dbus/Config.in
source make/debootstrap/Config.in
@@ -0,0 +1,7 @@
+config FREETZ_PACKAGE_DANTE
+ bool "dante 1.2.2 (binary only)"
+ select FREETZ_LIB_libcrypt
+ select FREETZ_LIB_libdl
+ default n
+ help
+ socks proxy daemon
View
@@ -0,0 +1,35 @@
+$(call PKG_INIT_BIN, 1.2.2)
+$(PKG)_SOURCE:=$(pkg)-$($(PKG)_VERSION).tar.gz
+$(PKG)_SOURCE_MD5:=69b9d6234154d7d6a91fcbd98c68e62a
+$(PKG)_SITE:=http://www.inet.no/dante/files
+
+$(PKG)_BINARY:=$($(PKG)_DIR)/sockd/sockd
+$(PKG)_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/sbin/danted
+
+$(PKG)_CONFIGURE_OPTIONS += --with-libc=libc.so
+$(PKG)_CONFIGURE_OPTIONS += --disable-libwrap
+$(PKG)_CONFIGURE_OPTIONS += --without-glibc-secure
+$(PKG)_CONFIGURE_OPTIONS += --without-pam
+$(PKG)_CONFIGURE_OPTIONS += --without-upnp
+
+$(PKG_SOURCE_DOWNLOAD)
+$(PKG_UNPACKED)
+$(PKG_CONFIGURED_CONFIGURE)
+
+$($(PKG)_BINARY): $($(PKG)_DIR)/.configured
+ $(SUBMAKE) -C $(DANTE_DIR) all
+
+$($(PKG)_TARGET_BINARY): $($(PKG)_BINARY)
+ $(INSTALL_BINARY_STRIP)
+
+$(pkg):
+
+$(pkg)-precompiled: $($(PKG)_TARGET_BINARY)
+
+$(pkg)-clean:
+ -$(SUBMAKE) -C $(DANTE_DIR) clean
+
+$(pkg)-uninstall:
+ $(RM) $(DANTE_TARGET_BINARY)
+
+$(PKG_FINISH)
@@ -0,0 +1,19 @@
+Description: Adapt the configure script for the Debian environment.
+ Always use Debian's libtool and libdl.so.2.
+ Do not add "-g -O2" to the Debian build's CFLAGS.
+Forwarded: not-needed
+Author: Adrian Bridgett <bridgett@debian.org>,
+ Peter Pentchev <roam@ringlet.net>
+Last-Update: 2010-10-12
+
+--- configure
++++ configure
+@@ -3279,7 +3279,7 @@
+ CFLAGS=$ac_save_CFLAGS
+ elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+- CFLAGS="-g -O2"
++ CFLAGS=""
+ else
+ CFLAGS="-g"
+ fi
@@ -0,0 +1,19 @@
+Description: Initialize the client at first connection if not done yet.
+Bug-Debian: http://bugs.debian.org/100375
+Forwarded: no
+Author: Philip Kendall <pak21@srcf.ucam.org>
+Last-Update: 2010-07-02
+
+--- lib/Rconnect.c
++++ lib/Rconnect.c
+@@ -82,6 +82,10 @@
+ return connect(s, name, namelen);
+ }
+
++#if SOCKS_CLIENT /* may be called before normal init, log to right place */
++ clientinit();
++#endif
++
+ slog(LOG_DEBUG, "%s: socket %d, address %s",
+ function, s, sockaddr2string(name, namestr, sizeof(namestr)));
+
@@ -0,0 +1,59 @@
+Description: Fix the build on non-Linux architectures.
+ - make the CMSG_CONTROLDATA() macro work and introduce
+ an lvalue equivalent
+ - only use PTHREAD_MUTEX_ERRORCHECK when available
+ - add two more kFreeBSD tests in the configure script
+ - supply a third argument to open() with O_CREAT
+Forwarded: no
+Author: Peter Pentchev <roam@ringlet.net>
+Last-Update: 2010-10-15
+
+--- include/common.h
++++ include/common.h
+@@ -338,8 +338,9 @@
+ * cast is necessary on AIX, due to buggy headers there?
+ * needs additional testing on AIX, disable for now.
+ */
+-/* #define CMSG_CONTROLDATA(msg) ((struct cmsghdr *)((msg).msg_control)) */
+-#define CMSG_CONTROLDATA(msg) ((msg).msg_control)
++#define CMSG_CONTROLDATA(msg) ((struct cmsghdr *)((msg).msg_control))
++#define CMSG_CONTROLDATA_MUTABLE(msg) ((msg).msg_control)
++/* #define CMSG_CONTROLDATA(msg) ((msg).msg_control) */
+ #else /* !HAVE_CMSGHDR */
+ #define CMSG_CONTROLDATA(msg) ((msg).msg_accrights)
+ #endif /* HAVE_CMSGHDR */
+--- lib/address.c
++++ lib/address.c
+@@ -1047,8 +1047,10 @@
+ if (socks_pthread_mutexattr_init(&attr) != 0)
+ serr(EXIT_FAILURE, "%s: mutexattr_init() failed", function);
+
++#ifdef PTHREAD_MUTEX_ERRORCHECK
+ if (socks_pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0)
+ swarn("%s: mutex_settype(PTHREAD_MUTEX_ERRORCHECK) failed", function);
++#endif
+
+ if (socks_pthread_mutex_init(&addrmutex, &attr) != 0) {
+ swarn("%s: mutex_init() failed", function);
+--- lib/Rcompat.c
++++ lib/Rcompat.c
+@@ -286,7 +286,7 @@
+
+ /* no cmsg on proxied sockets. */
+ CMSG_TOTLEN(*msg) = 0;
+- CMSG_CONTROLDATA(*msg) = NULL;
++ CMSG_CONTROLDATA_MUTABLE(*msg) = NULL;
+
+ for (received = ioc = rc = 0; ioc < (size_t)msg->msg_iovlen; ++ioc) {
+ /* LINTED pointer casts may be troublesome */
+--- lib/util.c
++++ lib/util.c
+@@ -874,7 +874,7 @@
+ if (strstr(newtemplate, "XXXXXX") != NULL)
+ s = mkstemp(newtemplate);
+ else
+- s = open(newtemplate, O_RDWR | O_CREAT | O_EXCL);
++ s = open(newtemplate, O_RDWR | O_CREAT | O_EXCL, 0600);
+
+ if (s == -1) {
+ swarn("%s: mkstemp(%s)", function, newtemplate);
@@ -0,0 +1,223 @@
+Description: Fix a whole slew of warnings from the C compiler.
+Forwarded: no
+Author: Peter Pentchev <roam@ringlet.net>
+Last-Update: 2010-10-12
+
+--- lib/config.c
++++ lib/config.c
+@@ -1034,19 +1034,19 @@
+ bufused = snprintfn(buf, sizeof(buf), "extension(s): ");
+ if (state->extension.bind)
+ bufused += snprintfn(&buf[bufused], sizeof(buf) - bufused, "bind");
+- slog(LOG_DEBUG, buf);
++ slog(LOG_DEBUG, "%s", buf);
+
+ bufused = snprintfn(buf, sizeof(buf), "protocol(s): ");
+ protocols2string(&state->protocol,
+ &buf[bufused], sizeof(buf) - bufused);
+- slog(LOG_DEBUG, buf);
++ slog(LOG_DEBUG, "%s", buf);
+
+ showmethod(state->methodc, state->methodv);
+
+ bufused = snprintfn(buf, sizeof(buf), "proxyprotocol(s): ");
+ proxyprotocols2string(&state->proxyprotocol,
+ &buf[bufused], sizeof(buf) - bufused);
+- slog(LOG_DEBUG, buf);
++ slog(LOG_DEBUG, "%s", buf);
+
+ #if HAVE_GSSAPI
+ if (methodisset(AUTHMETHOD_GSSAPI, state->methodv, state->methodc)) {
+--- lib/httpproxy.c
++++ lib/httpproxy.c
+@@ -59,7 +59,7 @@
+ struct sockaddr addr;
+ socklen_t addrlen;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ sockshost2string(&packet->req.host, host, sizeof(host));
+
+--- lib/msproxy_clientprotocol.c
++++ lib/msproxy_clientprotocol.c
+@@ -300,7 +300,7 @@
+ struct sockaddr_in addr;
+ socklen_t len;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ #if 0
+
+@@ -521,7 +521,7 @@
+ struct sockaddr_in addr;
+ socklen_t len;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ bzero(&req, sizeof(req));
+ req.clientid = packet->state.msproxy.clientid;
+@@ -685,7 +685,7 @@
+ struct timeval timeout;
+ int dbits;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ /*
+ * Find the socket we were signalled for.
+@@ -1888,7 +1888,7 @@
+ struct socksfd_t socksfdmem;
+ int i, max;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ for (i = 0, max = getmaxofiles(softlimit); i < max; ++i) {
+ if ((socksfd = socks_getaddr(i, 1)) == NULL)
+@@ -1911,7 +1911,7 @@
+ const char *function = "msproxy_sessionend()";
+ struct msproxy_request_t req;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ bzero(&req, sizeof(req));
+ *req.username = NUL;
+@@ -1937,7 +1937,7 @@
+ struct msproxy_response_t res;
+ int i, max;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ for (i = 0, max = getmaxofiles(softlimit); i < max; ++i) {
+ if ((socksfd = socks_getaddr(i, 1)) == NULL)
+--- sockd/serverconfig.c
++++ sockd/serverconfig.c
+@@ -596,13 +596,13 @@
+ for (i = 0; (size_t)i < sockscf->methodc; ++i)
+ bufused += snprintfn(&buf[bufused], sizeof(buf) - bufused, "%s%s",
+ i > 0 ? ", " : "", method2string(sockscf->methodv[i]));
+- slog(LOG_DEBUG, buf);
++ slog(LOG_DEBUG, "%s", buf);
+
+ bufused = snprintfn(buf, sizeof(buf), "clientmethod(s): ");
+ for (i = 0; (size_t)i < sockscf->clientmethodc; ++i)
+ bufused += snprintfn(&buf[bufused], sizeof(buf) - bufused, "%s%s",
+ i > 0 ? ", " : "", method2string(sockscf->clientmethodv[i]));
+- slog(LOG_DEBUG, buf);
++ slog(LOG_DEBUG, "%s", buf);
+
+ if (sockscf->option.debug) {
+ struct rule_t *rule;
+--- sockd/sockd.c
++++ sockd/sockd.c
+@@ -472,7 +472,7 @@
+ "%lu slot%s free",
+ function, childtype2string(child->type),
+ (unsigned long)child->pid,
+- child->freec, child->freec == 1 ? "" : "s");
++ (unsigned long)child->freec, child->freec == 1 ? "" : "s");
+
+ if (child->type == CHILD_IO) {
+ /*
+@@ -1071,7 +1071,7 @@
+
+ sig = -sig;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ clients = 0;
+ clients += childcheck(-CHILD_NEGOTIATE);
+@@ -1190,7 +1190,7 @@
+
+ sig = -sig;
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ while (1) {
+ pid = waitpid(WAIT_ANY, &status, WNOHANG);
+--- lib/config_parse.c
++++ lib/config_parse.c
+@@ -1334,8 +1334,8 @@
+ va_end(ap);
+
+ if (errno)
+- serr(EXIT_FAILURE, buf);
+- serrx(EXIT_FAILURE, buf);
++ serr(EXIT_FAILURE, "%s", buf);
++ serrx(EXIT_FAILURE, "%s", buf);
+ }
+
+ void
+@@ -1364,8 +1364,8 @@
+ va_end(ap);
+
+ if (errno)
+- swarn(buf);
+- swarnx(buf);
++ swarn("%s", buf);
++ swarnx("%s", buf);
+ }
+
+ static void
+--- lib/config_scan.c
++++ lib/config_scan.c
+@@ -2020,7 +2020,7 @@
+ /* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
++#define ECHO if (fwrite( yytext, yyleng, 1, yyout ) != 1) yy_fatal_error("flex: config_scan.c: fwrite() failed")
+ #endif
+
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+--- lib/upnp.c
++++ lib/upnp.c
+@@ -79,7 +79,7 @@
+ int devtype, rc;
+ #endif /* HAVE_LIBMINIUPNP */
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ #if !HAVE_LIBMINIUPNP
+ return -1;
+@@ -210,7 +210,7 @@
+ int rc;
+ #endif /* HAVE_LIBMINIUPNP */
+
+- slog(LOG_DEBUG, function);
++ slog(LOG_DEBUG, "%s", function);
+
+ #if !HAVE_LIBMINIUPNP
+ SERRX(0);
+--- sockd/auth_pam.c
++++ sockd/auth_pam.c
+@@ -174,7 +174,7 @@
+ }
+
+ if ((rc = pam_end(pamh, rc)) != PAM_SUCCESS)
+- swarnx("%s: strange ... pam_end() failed: %s", pam_strerror(pamh, rc));
++ swarnx("%s: strange ... pam_end() failed: %s", function, pam_strerror(pamh, rc));
+
+ return 0;
+ }
+--- sockd/sockd_child.c
++++ sockd/sockd_child.c
+@@ -573,8 +573,8 @@
+
+ if (type >= 0) {
+ if (proxyc < minfreeslots && sockscf.child.addchild) {
+- slog(LOG_DEBUG, "%s: current # of free %s-slots is %d, thus less than "
+- "configured minimum of %d. Trying to add a "
++ slog(LOG_DEBUG, "%s: current # of free %s-slots is %lu, thus less than "
++ "configured minimum of %lu. Trying to add a "
+ "%s-child",
+ function, childtype2string(type),
+ (unsigned long)proxyc, (unsigned long)minfreeslots,
Oops, something went wrong.

0 comments on commit 53230bd

Please sign in to comment.