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
+5
View File
@@ -0,0 +1,5 @@
tinyproxy is a lightweight HTTP/SSL proxy. Designed from the ground up to be
fast and yet small, it is an ideal solution for sites where a full-featured
HTTP proxy is required, but the system resources required to run a more
demanding HTTP proxy are unavailable. tinyproxy is fully compatible with all
existing web browsers.
+60
View File
@@ -0,0 +1,60 @@
# $NetBSD: Makefile,v 1.31 2013/02/06 23:24:04 jperkin Exp $
#
DISTNAME= tinyproxy-1.8.3
PKGREVISION= 2
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=tinyproxy/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://tinyproxy.sourceforge.net/
COMMENT= Lightweight HTTP/SSL proxy
LICENSE= gnu-gpl-v2
GNU_CONFIGURE= YES
RCD_SCRIPTS= tinyproxy
PKG_SYSCONFSUBDIR= tinyproxy
.include "../../mk/bsd.prefs.mk"
BUILD_DEPENDS+= asciidoc-[0-9]*:../../textproc/asciidoc
BUILD_DEFS+= VARBASE
TINYPROXY_USER?= tinyproxy
TINYPROXY_GROUP?= tinyproxy
PKG_GROUPS= ${TINYPROXY_GROUP}
PKG_USERS= ${TINYPROXY_USER}:${TINYPROXY_GROUP}
PKG_GROUPS_VARS+= TINYPROXY_GROUP
PKG_USERS_VARS+= TINYPROXY_USER
FILES_SUBST+= TINYPROXY_USER=${TINYPROXY_USER:Q}
FILES_SUBST+= TINYPROXY_GROUP=${TINYPROXY_GROUP:Q}
CONFIGURE_ARGS+= --with-config=${PKG_SYSCONFDIR}/tinyproxy.conf
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
CONFIGURE_ARGS+= --enable-transparent-proxy
.include "options.mk"
EGDIR= ${PREFIX}/share/examples/tinyproxy
CONF_FILES= ${EGDIR}/tinyproxy.conf.default ${PKG_SYSCONFDIR}/tinyproxy.conf
SUBST_CLASSES+= docs
SUBST_STAGE.docs= pre-configure
SUBST_FILES.docs= docs/man5/tinyproxy.conf.txt.in docs/man8/tinyproxy.txt.in etc/tinyproxy.conf.in
SUBST_SED.docs+= -e 's,@TINYPROXY_USER@,${TINYPROXY_USER},g'
SUBST_SED.docs+= -e 's,@TINYPROXY_GROUP@,${TINYPROXY_GROUP},g'
SUBST_SED.docs+= -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
SUBST_SED.docs+= -e 's,@VARBASE@,${VARBASE},g'
INSTALLATION_DIRS= ${EGDIR} share/doc/tinyproxy
post-install:
${INSTALL_DATA} ${WRKSRC}/etc/tinyproxy.conf \
${DESTDIR}${EGDIR}/tinyproxy.conf.default
${INSTALL_DATA} ${WRKSRC}/docs/filter-howto.txt \
${DESTDIR}${PREFIX}/share/doc/tinyproxy/
.include "../../security/openssl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
+10
View File
@@ -0,0 +1,10 @@
@comment $NetBSD: PLIST,v 1.5 2012/12/12 13:01:23 wiz Exp $
man/man5/tinyproxy.conf.5
man/man8/tinyproxy.8
sbin/tinyproxy
share/doc/tinyproxy/filter-howto.txt
share/examples/rc.d/tinyproxy
share/examples/tinyproxy/tinyproxy.conf.default
share/tinyproxy/debug.html
share/tinyproxy/default.html
share/tinyproxy/stats.html
+11
View File
@@ -0,0 +1,11 @@
$NetBSD: distinfo,v 1.8 2012/12/13 09:01:26 wiz Exp $
SHA1 (tinyproxy-1.8.3.tar.gz) = ebf4bda60ff2d0fdf1846467f07b3bbd9ef90faf
RMD160 (tinyproxy-1.8.3.tar.gz) = 41cae4c8fcc99650a76d7bed52a379a9dd0faef0
Size (tinyproxy-1.8.3.tar.gz) = 266744 bytes
SHA1 (patch-docs_man5_tinyproxy.conf.txt.in) = 1641f7c44ce84f2ebac6e945760af3ba77976f31
SHA1 (patch-docs_man8_tinyproxy.txt.in) = 12c43d0f874a8794cbe8da7c702e406e8b10a99b
SHA1 (patch-etc_Makefile.in) = 34ab3402bf11be5d2c1521f8ca0254ecbf19fc3c
SHA1 (patch-src_child.c) = 2263f1aa7edbc31a7b31343487afa4be4fb30405
SHA1 (patch-src_hashmap.c) = 92234430d31cd97620038a268ffd813344b262ba
SHA1 (patch-src_reqs.c) = 9a1186ab9ebe71009384ec12aa56aff86f3a1007
+18
View File
@@ -0,0 +1,18 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: tinyproxy.sh,v 1.2 2011/02/03 19:27:55 shattered Exp $
#
# PROVIDE: tinyproxy
# REQUIRE: DAEMON
. /etc/rc.subr
name="tinyproxy"
rcvar=$name
command="@PREFIX@/sbin/${name}"
pidfile="/var/run/${name}.pid"
required_files="@PKG_SYSCONFDIR@/$name.conf"
load_rc_config $name
run_rc_command "$1"
+14
View File
@@ -0,0 +1,14 @@
# $NetBSD: options.mk,v 1.2 2007/02/22 19:27:24 wiz Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.tinyproxy
PKG_SUPPORTED_OPTIONS+= socks5
PKG_SUGGESTED_OPTIONS+= socks5
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:Msocks5)
CONFIGURE_ARGS+= --enable-socks
BUILDLINK_TRANSFORM+= l:socks:socks5
.include "../../net/socks5/buildlink3.mk"
.endif
@@ -0,0 +1,15 @@
$NetBSD: patch-docs_man5_tinyproxy.conf.txt.in,v 1.1 2012/12/12 13:01:23 wiz Exp $
Adapt path for pkgsrc.
--- docs/man5/tinyproxy.conf.txt.in.orig 2011-08-16 12:14:34.000000000 +0000
+++ docs/man5/tinyproxy.conf.txt.in
@@ -19,7 +19,7 @@ DESCRIPTION
-----------
`tinyproxy(8)` reads its configuration file, typically stored in
-`/etc/tinyproxy/tinyproxy.conf` (or passed to Tinyproxy with -c on the
+`@PKG_SYSCONFDIR@/tinyproxy.conf` (or passed to Tinyproxy with -c on the
command line). This manpage describes the syntax and contents of the
configuration file.
@@ -0,0 +1,15 @@
$NetBSD: patch-docs_man8_tinyproxy.txt.in,v 1.1 2012/12/12 13:01:23 wiz Exp $
Adapt path for pkgsrc.
--- docs/man8/tinyproxy.txt.in.orig 2012-10-04 11:35:55.807186000 +0000
+++ docs/man8/tinyproxy.txt.in
@@ -130,7 +130,7 @@ configuration variable `StatFile`.
FILES
-----
-`/etc/tinyproxy/tinyproxy.conf`, `/var/run/tinyproxy/tinyproxy.pid`, `/var/log/tinyproxy/tinyproxy.log`
+`@PKG_SYSCONFDIR@/tinyproxy.conf`, `@VARBASE@/run/tinyproxy/tinyproxy.pid`, `@VARBASE@/log/tinyproxy/tinyproxy.log`
BUGS
----
@@ -0,0 +1,15 @@
$NetBSD: patch-etc_Makefile.in,v 1.1 2012/12/12 13:01:23 wiz Exp $
Use pkgsrc framework for config files.
--- etc/Makefile.in.orig 2012-10-04 23:12:45.697375000 +0000
+++ etc/Makefile.in
@@ -355,7 +355,7 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-sysconfDATA
+install-exec-am:
install-html: install-html-am
+24
View File
@@ -0,0 +1,24 @@
$NetBSD: patch-src_child.c,v 1.1 2012/12/13 09:01:26 wiz Exp $
Fix CVE-2012-3505 using Debian patch.
--- src/child.c.orig 2010-01-10 22:52:04.000000000 +0000
+++ src/child.c
@@ -20,6 +20,9 @@
* processing incoming connections.
*/
+#include <stdlib.h>
+#include <time.h>
+
#include "main.h"
#include "child.h"
@@ -196,6 +199,7 @@ static void child_main (struct child_s *
}
ptr->connects = 0;
+ srand(time(NULL));
while (!config.quit) {
ptr->status = T_WAITING;
+85
View File
@@ -0,0 +1,85 @@
$NetBSD: patch-src_hashmap.c,v 1.1 2012/12/13 09:01:26 wiz Exp $
Fix CVE-2012-3505 using Debian patch.
--- src/hashmap.c.orig 2010-01-25 18:24:01.000000000 +0000
+++ src/hashmap.c
@@ -25,6 +25,8 @@
* don't try to free the data, or realloc the memory. :)
*/
+#include <stdlib.h>
+
#include "main.h"
#include "hashmap.h"
@@ -50,6 +52,7 @@ struct hashbucket_s {
};
struct hashmap_s {
+ uint32_t seed;
unsigned int size;
hashmap_iter end_iterator;
@@ -65,7 +68,7 @@ struct hashmap_s {
*
* If any of the arguments are invalid a negative number is returned.
*/
-static int hashfunc (const char *key, unsigned int size)
+static int hashfunc (const char *key, unsigned int size, uint32_t seed)
{
uint32_t hash;
@@ -74,7 +77,7 @@ static int hashfunc (const char *key, un
if (size == 0)
return -ERANGE;
- for (hash = tolower (*key++); *key != '\0'; key++) {
+ for (hash = seed; *key != '\0'; key++) {
uint32_t bit = (hash & 1) ? (1 << (sizeof (uint32_t) - 1)) : 0;
hash >>= 1;
@@ -104,6 +107,7 @@ hashmap_t hashmap_create (unsigned int n
if (!ptr)
return NULL;
+ ptr->seed = (uint32_t)rand();
ptr->size = nbuckets;
ptr->buckets = (struct hashbucket_s *) safecalloc (nbuckets,
sizeof (struct
@@ -201,7 +205,7 @@ hashmap_insert (hashmap_t map, const cha
if (!data || len < 1)
return -ERANGE;
- hash = hashfunc (key, map->size);
+ hash = hashfunc (key, map->size, map->seed);
if (hash < 0)
return hash;
@@ -382,7 +386,7 @@ ssize_t hashmap_search (hashmap_t map, c
if (map == NULL || key == NULL)
return -EINVAL;
- hash = hashfunc (key, map->size);
+ hash = hashfunc (key, map->size, map->seed);
if (hash < 0)
return hash;
@@ -416,7 +420,7 @@ ssize_t hashmap_entry_by_key (hashmap_t
if (!map || !key || !data)
return -EINVAL;
- hash = hashfunc (key, map->size);
+ hash = hashfunc (key, map->size, map->seed);
if (hash < 0)
return hash;
@@ -451,7 +455,7 @@ ssize_t hashmap_remove (hashmap_t map, c
if (map == NULL || key == NULL)
return -EINVAL;
- hash = hashfunc (key, map->size);
+ hash = hashfunc (key, map->size, map->seed);
if (hash < 0)
return hash;
+48
View File
@@ -0,0 +1,48 @@
$NetBSD: patch-src_reqs.c,v 1.1 2012/12/13 09:01:27 wiz Exp $
Fix CVE-2012-3505 using Debian patch.
--- src/reqs.c.orig 2011-02-07 12:31:03.000000000 +0000
+++ src/reqs.c
@@ -610,6 +610,11 @@ add_header_to_connection (hashmap_t hash
return hashmap_insert (hashofheaders, header, sep, len);
}
+/* define max number of headers. big enough to handle legitimate cases,
+ * but limited to avoid DoS
+ */
+#define MAX_HEADERS 10000
+
/*
* Read all the headers from the stream
*/
@@ -617,6 +622,7 @@ static int get_all_headers (int fd, hash
{
char *line = NULL;
char *header = NULL;
+ int count;
char *tmp;
ssize_t linelen;
ssize_t len = 0;
@@ -625,7 +631,7 @@ static int get_all_headers (int fd, hash
assert (fd >= 0);
assert (hashofheaders != NULL);
- for (;;) {
+ for (count = 0; count < MAX_HEADERS; count++) {
if ((linelen = readline (fd, &line)) <= 0) {
safefree (header);
safefree (line);
@@ -691,6 +697,12 @@ static int get_all_headers (int fd, hash
safefree (line);
}
+
+ /* if we get there, this is we reached MAX_HEADERS count.
+ bail out with error */
+ safefree (header);
+ safefree (line);
+ return -1;
}
/*