diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-02-10 15:40:27 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-02-10 15:40:27 +0000 |
commit | 6bc2e4d7c5906e46a8f275a876ead6ec41aca5bb (patch) | |
tree | cee0a97398040001220ece3cd48c3d568bcddb4a /net-proxy/tinyproxy | |
parent | 1db00cc6e94b90c08090bb5b8c406622946c4ae5 (diff) |
gentoo resync : 10.02.2019
Diffstat (limited to 'net-proxy/tinyproxy')
-rw-r--r-- | net-proxy/tinyproxy/Manifest | 4 | ||||
-rw-r--r-- | net-proxy/tinyproxy/files/tinyproxy-1.8.1-ldflags.patch | 11 | ||||
-rw-r--r-- | net-proxy/tinyproxy/files/tinyproxy-1.8.1-minimal.patch | 10 | ||||
-rw-r--r-- | net-proxy/tinyproxy/files/tinyproxy-1.8.3-r2-DoS-Prevention.patch | 183 | ||||
-rw-r--r-- | net-proxy/tinyproxy/files/tinyproxy-1.8.3-r2.initd | 40 |
5 files changed, 0 insertions, 248 deletions
diff --git a/net-proxy/tinyproxy/Manifest b/net-proxy/tinyproxy/Manifest index 26d27ca76d06..ef40627a73b9 100644 --- a/net-proxy/tinyproxy/Manifest +++ b/net-proxy/tinyproxy/Manifest @@ -1,9 +1,5 @@ AUX tinyproxy-1.10.0.initd 855 BLAKE2B 4bd9a260a930958ea449a08edce1f9e8633429a5222a3ea7254b4bdc03808c5f9f87d9b33556f345e305d28e155834b33ff2a952c041af582cae3bedbae2034d SHA512 cd440ed686e8128ed46441ca29da8376c4d28e9e34ae9b85c18eb2f1681d60c0c04b79401a7368f917eeab6768965d6c867d0ac6578a7858557c11b356446c02 AUX tinyproxy-1.10.0.service 181 BLAKE2B 1e5c14f607d0c54d215a6ffe5656bac288e48ca809aca67b658bb13917869e5203d66730f52670fb9030dd9f6cf249d09f357bbdd143436f6b358377d8f78036 SHA512 7721b986326f82b03d79983be33047fdf4b37b5c63992645a321bf8bd3edea63680a2bf81b2d51fbeab2a5884773a0598dba14f9d597d3db0eea7c7f6b4c79d3 -AUX tinyproxy-1.8.1-ldflags.patch 306 BLAKE2B 2a21760a37ccb0bff53cf1c89c220363d32cbca7f4738f65ab3e99b0609edba6796473600919b8ecd8537d57ca40fdb55ae40e213605ab008b3fe9958e1795f7 SHA512 d9daf50c1fcd2237ec59e7701adce76ba09347193439a1940c24e942600ab10bfc192e6c30a3fbcc3e1194f52b7aaab2fe5ef69468c01041f1a9d5fc6deacc8b -AUX tinyproxy-1.8.1-minimal.patch 109 BLAKE2B 8ff9e2678150bcbef92c3e83a8e2b9996cfcce7aee50cddd2f61bed75af5e12e2694f5574df8f8fcbb54decdb4f791532df5ff9b6dad9bf0e47cb31a4f310a8f SHA512 56126f4e315dfade7983a9961ab3a30687e5fb575d9fd0964f081cb1e4be718f54b3999f69f769832717ebae1dd832aaff5e60289b465976b2f95325af48d79d -AUX tinyproxy-1.8.3-r2-DoS-Prevention.patch 6100 BLAKE2B 81ee5fdbba35d02fc03d20b145a455ea0349bb03360b8fe7f797d9bde5c1cee188f1bb82e1d7a5535ff1566197ba3c22d1bf2885d666bc848cdf8602038fcfcd SHA512 ea023535ecf5fc9b0ab63d5e3ab4fe6222a54218de43894699ae742ff89e38ba65ea2a601f17de130e1169f37b0b7189ec55af471074222aecd827104d8f4ce0 -AUX tinyproxy-1.8.3-r2.initd 845 BLAKE2B 476c8e1b6ab41c42c65429fc031f8c58a2baa3298103b5d0550acec2d7b5909e6f4007d0a243042101a95e83aea49954dd19351527dad8e993ddc1c3768774e2 SHA512 b9baebf7d718b0acd3ee0c824c93cab836ae3233113b07d53e6aae204418992a9e9db83d8fceae949f36a72d000c6521efe3b0698421ee1561bb9201cd18d5e3 AUX tinyproxy.service 172 BLAKE2B d2e6199bfee2bac52e08d4c5506131f19e2630ebe1d9ed12f71d575cef37454c229e9e08b1fc89d9e26052a1192913289ed3602d69686d6894eb68b8639e7a5a SHA512 4c4cd36a7e34d9ee27c05475b72d1b61f90592ccb44c9deb96a1375bb681b7901702f078ed24b7c633074c83e450275a4a66829f3b270f75fc786a50d1ef393f AUX tinyproxy.tmpfiles.conf 48 BLAKE2B f2cd35878580eb198920f5db8493e3e266b4325160a9590a0b59bef1cf0577d0129bb636d99442cdb2154b444a8cdc1c6d01b4850b57df774be00338c61902e4 SHA512 24440cdaed0af6cbdb191acb1769e0a17871ef95e03e62a6621a413a2616e5d90d748d909bb5d18c029b25d7bf91485dbe46ee11e8703a1cb9008be470536715 DIST tinyproxy-1.10.0.tar.xz 176060 BLAKE2B 58f9b443c731de6b74d689a80ebd422d3b6f51f643546ee144b37fb3262725246f6a5fa1015267a94f192f8715eaf71ffc078ead75e6225a210f58ec28ee8fcf SHA512 8d82598c5f9c89bc672f4632139ac52696d5c7788963de51688a8aeb576c69004f8338fe1e1897bf704a21dfd25ab1effb092003b6afaa9a88c2b5d0608310f5 diff --git a/net-proxy/tinyproxy/files/tinyproxy-1.8.1-ldflags.patch b/net-proxy/tinyproxy/files/tinyproxy-1.8.1-ldflags.patch deleted file mode 100644 index bd40ec33e31a..000000000000 --- a/net-proxy/tinyproxy/files/tinyproxy-1.8.1-ldflags.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure.ac 2010-03-09 12:41:45.000000000 +0100 -+++ b/configure.ac 2010-05-17 23:07:39.000000000 +0200 -@@ -222,7 +222,7 @@ - CFLAGS="-DNDEBUG $CFLAGS" - fi - --LDFLAGS="-Wl,-z,defs" -+LDFLAGS="$LDFLAGS -Wl,-z,defs" - - dnl - dnl Make sure we can actually handle the "--with-*" and "--enable-*" stuff. diff --git a/net-proxy/tinyproxy/files/tinyproxy-1.8.1-minimal.patch b/net-proxy/tinyproxy/files/tinyproxy-1.8.1-minimal.patch deleted file mode 100644 index 82793a8894d0..000000000000 --- a/net-proxy/tinyproxy/files/tinyproxy-1.8.1-minimal.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/Makefile.am -+++ b/Makefile.am -@@ -2,7 +2,6 @@ - src \ - data \ - etc \ -- docs \ - m4macros \ - tests - diff --git a/net-proxy/tinyproxy/files/tinyproxy-1.8.3-r2-DoS-Prevention.patch b/net-proxy/tinyproxy/files/tinyproxy-1.8.3-r2-DoS-Prevention.patch deleted file mode 100644 index 059f178c1ee2..000000000000 --- a/net-proxy/tinyproxy/files/tinyproxy-1.8.3-r2-DoS-Prevention.patch +++ /dev/null @@ -1,183 +0,0 @@ -https://banu.com/bugzilla/show_bug.cgi?id=110#c4 - -From 526215dbb4abb1cff9a170343fa50dbda9492eb1 Mon Sep 17 00:00:00 2001 -From: Michael Adam <obnox@samba.org> -Date: Fri, 15 Mar 2013 12:34:01 +0100 -Subject: [PATCH 1/2] [BB#110] secure the hashmaps by adding a seed - -Based on patch provided by gpernot@praksys.org on bugzilla. - -Signed-off-by: Michael Adam <obnox@samba.org> ---- - configure.ac | 2 ++ - src/child.c | 1 + - src/hashmap.c | 14 ++++++++------ - 3 files changed, 11 insertions(+), 6 deletions(-) - -diff --git a/configure.ac b/configure.ac -index ecbcba0..cc40e85 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -205,6 +205,8 @@ AC_CHECK_FUNCS([gethostname inet_ntoa memchr memset select socket strcasecmp \ - AC_CHECK_FUNCS([isascii memcpy setrlimit ftruncate regcomp regexec]) - AC_CHECK_FUNCS([strlcpy strlcat]) - -+AC_CHECK_FUNCS([time rand srand]) -+ - - dnl Enable extra warnings - DESIRED_FLAGS="-fdiagnostics-show-option -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wfloat-equal -Wundef -Wformat=2 -Wlogical-op -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Waggregate-return -Winit-self -Wpacked --std=c89 -ansi -pedantic -Wno-overlength-strings -Wc++-compat -Wno-long-long -Wno-overlength-strings -Wdeclaration-after-statement -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-qual -Wcast-align -Wwrite-strings -Wp,-D_FORTIFY_SOURCE=2 -fno-common" -diff --git a/src/child.c b/src/child.c -index 34e20e0..0d778d9 100644 ---- a/src/child.c -+++ b/src/child.c -@@ -196,6 +196,7 @@ static void child_main (struct child_s *ptr) - } - - ptr->connects = 0; -+ srand(time(NULL)); - - while (!config.quit) { - ptr->status = T_WAITING; -diff --git a/src/hashmap.c b/src/hashmap.c -index f46fdcb..8cf7c6b 100644 ---- a/src/hashmap.c -+++ b/src/hashmap.c -@@ -50,6 +50,7 @@ struct hashbucket_s { - }; - - struct hashmap_s { -+ uint32_t seed; - unsigned int size; - hashmap_iter end_iterator; - -@@ -65,7 +66,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 +75,7 @@ static int hashfunc (const char *key, unsigned int size) - 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 +105,7 @@ hashmap_t hashmap_create (unsigned int nbuckets) - if (!ptr) - return NULL; - -+ ptr->seed = (uint32_t)rand(); - ptr->size = nbuckets; - ptr->buckets = (struct hashbucket_s *) safecalloc (nbuckets, - sizeof (struct -@@ -201,7 +203,7 @@ hashmap_insert (hashmap_t map, const char *key, const void *data, size_t len) - 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 +384,7 @@ ssize_t hashmap_search (hashmap_t map, const char *key) - 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 +418,7 @@ ssize_t hashmap_entry_by_key (hashmap_t map, const char *key, void **data) - 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 +453,7 @@ ssize_t hashmap_remove (hashmap_t map, const char *key) - if (map == NULL || key == NULL) - return -EINVAL; - -- hash = hashfunc (key, map->size); -+ hash = hashfunc (key, map->size, map->seed); - if (hash < 0) - return hash; - --- -1.7.9.5 - -https://banu.com/bugzilla/show_bug.cgi?id=110#c5 - -From f1189daec6866efeb44f24073cd19d7ece86e537 Mon Sep 17 00:00:00 2001 -From: Michael Adam <obnox@samba.org> -Date: Fri, 15 Mar 2013 13:10:01 +0100 -Subject: [PATCH 2/2] [BB#110] limit the number of headers per request to - prevent DoS - -Based on patch provided by gpernot@praksys.org on bugzilla. - -Signed-off-by: Michael Adam <obnox@samba.org> ---- - src/reqs.c | 17 ++++++++++++++++- - 1 file changed, 16 insertions(+), 1 deletion(-) - -diff --git a/src/reqs.c b/src/reqs.c -index 2de43a8..af014ba 100644 ---- a/src/reqs.c -+++ b/src/reqs.c -@@ -611,12 +611,19 @@ add_header_to_connection (hashmap_t hashofheaders, char *header, size_t 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 - */ - static int get_all_headers (int fd, hashmap_t hashofheaders) - { - char *line = NULL; - char *header = NULL; -+ int count; - char *tmp; - ssize_t linelen; - ssize_t len = 0; -@@ -625,7 +632,7 @@ static int get_all_headers (int fd, hashmap_t hashofheaders) - 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 +698,14 @@ static int get_all_headers (int fd, hashmap_t hashofheaders) - - safefree (line); - } -+ -+ /* -+ * if we get there, this is we reached MAX_HEADERS count -+ * bail out with error -+ */ -+ safefree (header); -+ safefree (line); -+ return -1; - } - - /* --- -1.7.9.5 diff --git a/net-proxy/tinyproxy/files/tinyproxy-1.8.3-r2.initd b/net-proxy/tinyproxy/files/tinyproxy-1.8.3-r2.initd deleted file mode 100644 index 0d6618b69a9a..000000000000 --- a/net-proxy/tinyproxy/files/tinyproxy-1.8.3-r2.initd +++ /dev/null @@ -1,40 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2018 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -get_config() { - res=$(awk '$1 == "'$1'" { s=$2 } END { print s }' "$CONFFILE") - - if [ "x$res" = "x" ]; then - echo "$2" - else - eval echo "$res" - fi -} - -: ${CONFFILE:="/etc/${SVCNAME}.conf"} - -command=/usr/sbin/tinyproxy -command_args="-c ${CONFFILE}" -pidfile=$(get_config PidFile /run/tinyproxy/${SVCNAME}.pid) - -depend() { - config "$CONFFILE" - - use dns - - [ "$(get_config Syslog Off)" = "On" ] && \ - use logger -} - -start_pre() { - piddir=$(dirname ${pidfile}) - - if [ "${piddir}" = "/run" ]; then - eerror "Please change your PidFile settings to be within the" - eerror "/run/tinyproxy directory" - eend 1 - else - checkpath -d -o $(get_config User tinyproxy):$(get_config Group tinyproxy) ${piddir} - fi -} |