summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorsborrill <sborrill>2015-09-03 11:55:40 +0000
committersborrill <sborrill>2015-09-03 11:55:40 +0000
commitbf2b9bf48b3c173e9c1592c271210c991616f8ba (patch)
tree5b9979c2a3a19ee4e93507735ef485d2a321bca3 /www
parent1ce22a80a87a5b7ea91adc64b03cfdd9bfa320fc (diff)
downloadpkgsrc-bf2b9bf48b3c173e9c1592c271210c991616f8ba.tar.gz
Fix some bugs related to maxuploadsize. Without these patches, all file
uploads are blocked irrespective of what is set in the configuration files. Remove MESSAGE as licence has changed, it is now entirely GPL. Bump PKGREVISION.
Diffstat (limited to 'www')
-rw-r--r--www/dansguardian/MESSAGE20
-rw-r--r--www/dansguardian/Makefile4
-rw-r--r--www/dansguardian/distinfo7
-rw-r--r--www/dansguardian/patches/patch-configs_dansguardian.conf.in26
-rw-r--r--www/dansguardian/patches/patch-configs_dansguardianf1.conf.in24
-rw-r--r--www/dansguardian/patches/patch-src_ConnectionHandler.cpp22
-rw-r--r--www/dansguardian/patches/patch-src_FOptionContainer.cpp36
-rw-r--r--www/dansguardian/patches/patch-src_FOptionContainer.hpp14
8 files changed, 130 insertions, 23 deletions
diff --git a/www/dansguardian/MESSAGE b/www/dansguardian/MESSAGE
deleted file mode 100644
index 73a4c7da101..00000000000
--- a/www/dansguardian/MESSAGE
+++ /dev/null
@@ -1,20 +0,0 @@
-===========================================================================
-$NetBSD: MESSAGE,v 1.1.1.1 2008/02/22 17:13:29 sborrill Exp $
-
-Please read the copyright and licensing notice for DansGuardian at
-http://dansguardian.org/?page=copyright2
-
-DansGuardian 2 is:
-- licensed under the GPL version 2
-- Open Source
-- Free Software where 'Free' means Freedom
-- freely (no cost) downloadable from the main DG site for non-commercial use
-- freely (no cost) downloadable from the main DG site for general purpose unix
- distributions like FreeBSD, Debian, Fedora, Ubuntu, etc
-- not freely downloadable from the main DG site for installation by 3rd parties
- charging for installation or support
-- not freely downloadable from the main DG site for commercial use
-- a registered trade mark of Daniel Barron
-- copyright Daniel Barron
-
-===========================================================================
diff --git a/www/dansguardian/Makefile b/www/dansguardian/Makefile
index 3bbf46971ac..d2459a67ef6 100644
--- a/www/dansguardian/Makefile
+++ b/www/dansguardian/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.22 2015/06/12 10:51:49 wiz Exp $
+# $NetBSD: Makefile,v 1.23 2015/09/03 11:55:40 sborrill Exp $
DISTNAME= dansguardian-2.12.0.3
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dansguardian/}
EXTRACT_SUFX= .tar.bz2
diff --git a/www/dansguardian/distinfo b/www/dansguardian/distinfo
index 83a37f31c6b..ef9649185e9 100644
--- a/www/dansguardian/distinfo
+++ b/www/dansguardian/distinfo
@@ -1,9 +1,14 @@
-$NetBSD: distinfo,v 1.9 2015/01/20 11:34:43 prlw1 Exp $
+$NetBSD: distinfo,v 1.10 2015/09/03 11:55:40 sborrill Exp $
SHA1 (dansguardian-2.12.0.3.tar.bz2) = c5d8175910310f9a03efc2e6cb440ea418adb896
RMD160 (dansguardian-2.12.0.3.tar.bz2) = 312db0ce2db9d1b2ed537807f9b2eca5d76a4123
Size (dansguardian-2.12.0.3.tar.bz2) = 577701 bytes
+SHA1 (patch-configs_dansguardian.conf.in) = 8707f9506ea7d93b3ff2caca3612054d1b0724e7
+SHA1 (patch-configs_dansguardianf1.conf.in) = 777e1b3a463d7619d937ff193ee94a7a44410c7a
SHA1 (patch-configure) = be2ccff5ecd42994cf8727843372e5997004e5e4
+SHA1 (patch-src_ConnectionHandler.cpp) = c7d9ed8f825a3d1d74c3e2612169e8ad11d7fd44
+SHA1 (patch-src_FOptionContainer.cpp) = 09ed12353ea4622e5b78dc8d0a12cacd65283ea4
+SHA1 (patch-src_FOptionContainer.hpp) = 3be847e4e7821ee90c668524b543c28658920478
SHA1 (patch-src_ImageContainer.cpp) = b1296ac496a699d2089255b61841f607eba9d084
SHA1 (patch-src_OptionContainer.cpp) = d94a851522751b53c61a2b96e335170db0e1f86e
SHA1 (patch-src_SocketArray.cpp) = 393bb901cf090b543a16da27f16c1bc99db8f155
diff --git a/www/dansguardian/patches/patch-configs_dansguardian.conf.in b/www/dansguardian/patches/patch-configs_dansguardian.conf.in
new file mode 100644
index 00000000000..13b8210f64a
--- /dev/null
+++ b/www/dansguardian/patches/patch-configs_dansguardian.conf.in
@@ -0,0 +1,26 @@
+$NetBSD: patch-configs_dansguardian.conf.in,v 1.1 2015/09/03 11:55:40 sborrill Exp $
+
+maxuploadsize is a filtergroup setting
+
+--- configs/dansguardian.conf.in.orig 2015-09-03 12:12:29.000000000 +0100
++++ configs/dansguardian.conf.in 2015-09-03 12:13:31.000000000 +0100
+@@ -330,19 +330,6 @@
+
+
+
+-# POST protection (web upload and forms)
+-# does not block forms without any file upload, i.e. this is just for
+-# blocking or limiting uploads
+-# measured in kibibytes after MIME encoding and header bumph
+-# use 0 for a complete block
+-# use higher (e.g. 512 = 512Kbytes) for limiting
+-# use -1 for no blocking
+-#maxuploadsize = 512
+-#maxuploadsize = 0
+-maxuploadsize = -1
+-
+-
+-
+ # Max content filter size
+ # Sometimes web servers label binary files as text which can be very
+ # large which causes a huge drain on memory and cpu resources.
diff --git a/www/dansguardian/patches/patch-configs_dansguardianf1.conf.in b/www/dansguardian/patches/patch-configs_dansguardianf1.conf.in
new file mode 100644
index 00000000000..e38ec832b9c
--- /dev/null
+++ b/www/dansguardian/patches/patch-configs_dansguardianf1.conf.in
@@ -0,0 +1,24 @@
+$NetBSD: patch-configs_dansguardianf1.conf.in,v 1.1 2015/09/03 11:55:40 sborrill Exp $
+
+maxuploadsize is a filtergroup setting
+
+--- configs/dansguardianf1.conf.in.orig 2015-09-03 12:12:36.000000000 +0100
++++ configs/dansguardianf1.conf.in 2015-09-03 12:13:30.000000000 +0100
+@@ -102,6 +102,17 @@
+ # 50 is for young children, 100 for old children, 160 for young adults.
+ naughtynesslimit = 50
+
++# POST protection (web upload and forms)
++# does not block forms without any file upload, i.e. this is just for
++# blocking or limiting uploads
++# measured in kibibytes after MIME encoding and header bumph
++# use 0 for a complete block
++# use higher (e.g. 512 = 512Kbytes) for limiting
++# use -1 for no blocking
++#maxuploadsize = 512
++#maxuploadsize = 0
++maxuploadsize = -1
++
+ # Search term blocking
+ # Search terms can be extracted from search URLs and filtered using the
+ # bannedphraselist, weightedphraselist and exceptionphraselist, with a separate
diff --git a/www/dansguardian/patches/patch-src_ConnectionHandler.cpp b/www/dansguardian/patches/patch-src_ConnectionHandler.cpp
new file mode 100644
index 00000000000..a1fba6d4413
--- /dev/null
+++ b/www/dansguardian/patches/patch-src_ConnectionHandler.cpp
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_ConnectionHandler.cpp,v 1.1 2015/09/03 11:55:40 sborrill Exp $
+maxuploadsize is a filtergroup setting
+
+--- src/ConnectionHandler.cpp.orig 2015-09-03 12:05:59.000000000 +0100
++++ src/ConnectionHandler.cpp 2015-09-03 12:06:56.000000000 +0100
+@@ -1598,14 +1598,14 @@
+ // Check for POST upload size blocking, unless request is an exception
+ // MIME type test is just an approximation, but probably good enough
+ if (!isbypass && !isexception
+- && ((o.max_upload_size >= 0) && (cl > o.max_upload_size))
++ && ((o.fg[filtergroup]->max_upload_size >= 0) && (cl > o.fg[filtergroup]->max_upload_size))
+ && multipart)
+ {
+ #ifdef DGDEBUG
+ std::cout << dbgPeerPort << " -Detected POST upload violation by Content-Length header - discarding rest of POST data..." << std::endl;
+ #endif
+ header.discard(&peerconn);
+- checkme.whatIsNaughty = o.max_upload_size == 0 ? o.language_list.getTranslation(700) : o.language_list.getTranslation(701);
++ checkme.whatIsNaughty = o.fg[filtergroup]->max_upload_size == 0 ? o.language_list.getTranslation(700) : o.language_list.getTranslation(701);
+ // Web upload is banned.
+ checkme.whatIsNaughtyLog = checkme.whatIsNaughty;
+ checkme.whatIsNaughtyCategories = "Web upload";
diff --git a/www/dansguardian/patches/patch-src_FOptionContainer.cpp b/www/dansguardian/patches/patch-src_FOptionContainer.cpp
new file mode 100644
index 00000000000..80b17462b73
--- /dev/null
+++ b/www/dansguardian/patches/patch-src_FOptionContainer.cpp
@@ -0,0 +1,36 @@
+$NetBSD: patch-src_FOptionContainer.cpp,v 1.1 2015/09/03 11:55:40 sborrill Exp $
+
+maxuploadsize is NOT dependent upon SMTP
+
+--- src/FOptionContainer.cpp.orig 2015-09-03 12:08:34.000000000 +0100
++++ src/FOptionContainer.cpp 2015-09-03 12:09:05.000000000 +0100
+@@ -304,14 +304,6 @@
+ violationbody="";
+
+ threshold = findoptionI("threshold");
+- // TODO: Implement a "findoptionO" and a version of
+- // reality check which uses off_t, for large file support?
+- max_upload_size = findoptionI("maxuploadsize");
+- if (!realitycheck(max_upload_size, -1, 0, "maxuploadsize")) {
+- return false;
+- } // check its a reasonable value
+- max_upload_size *= 1024;
+-
+ avadmin = findoptionS("avadmin");
+ if (avadmin.length()==0) {
+ if (notifyav==1) {
+@@ -358,6 +350,14 @@
+ }
+ #endif
+
++ // TODO: Implement a "findoptionO" and a version of
++ // reality check which uses off_t, for large file support?
++ max_upload_size = findoptionI("maxuploadsize");
++ if (!realitycheck(max_upload_size, -1, 0, "maxuploadsize")) {
++ return false;
++ } // check its a reasonable value
++ max_upload_size *= 1024;
++
+ // override default reporting level
+ String temp_reporting_level(findoptionS("reportinglevel"));
+ if (temp_reporting_level != "") {
diff --git a/www/dansguardian/patches/patch-src_FOptionContainer.hpp b/www/dansguardian/patches/patch-src_FOptionContainer.hpp
new file mode 100644
index 00000000000..4f622914347
--- /dev/null
+++ b/www/dansguardian/patches/patch-src_FOptionContainer.hpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_FOptionContainer.hpp,v 1.1 2015/09/03 11:55:40 sborrill Exp $
+
+maxuploadsize is a filtergroup settings
+
+--- /usr/obj/pkgsrc/www/dansguardian/work.builder7/dansguardian-2.12.0.3/src/FOptionContainer.hpp.orig 2015-09-03 12:20:34.000000000 +0100
++++ /usr/obj/pkgsrc/www/dansguardian/work.builder7/dansguardian-2.12.0.3/src/FOptionContainer.hpp 2015-09-03 12:20:46.000000000 +0100
+@@ -36,6 +36,7 @@
+ int weighted_phrase_mode;
+ int group_mode;
+ int embedded_url_weight;
++ int max_upload_size;
+ int naughtyness_limit;
+ int searchterm_limit;
+ bool createlistcachefiles;