Commit 36712432 authored by Natanael Copa's avatar Natanael Copa

main/dansguardian: upgrade to 2.12.0.3

ref #1629
parent d9ba721d
# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dansguardian
pkgver=2.10.1.1
pkgrel=9
pkgver=2.12.0.3
pkgrel=0
pkgdesc="Web content filter"
url="http://dansguardian.org"
arch="all"
license="GPL"
depends="logrotate"
makedepends="zlib-dev pcre-dev pkgconfig libiconv-dev"
install="$pkgname.pre-install $pkgname.post-install"
install="$pkgname.pre-install"
subpackages="$pkgname-doc"
source="http://dansguardian.org/downloads/2/Stable/$pkgname-$pkgver.tar.gz
pkgusers="dansguar"
pkggroups="dansguar"
source="http://downloads.sourceforge.net/project/dansguardian/dansguardian-$pkgver.tar.bz2
dansguardian.initd
dansguardian.logrotate
ftp-credential.patch
dansguardian-2.10.1.1-gcc44.patch
gcc4.6.patch"
build() {
cd "$srcdir/$pkgname-$pkgver"
patch -p1 -i ../ftp-credential.patch || return 1
patch -p1 -i ../dansguardian-2.10.1.1-gcc44.patch || return 1
patch -p1 -i ../gcc4.6.patch || return 1
dansguardian-2.10.1.1-pcre830.patch
"
_builddir="$srcdir"/dansguardian-$pkgver
prepare() {
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
# do not block "microsoft...clustimg=..." and similar
sed -e 's:\.\*:.{1,10}:g' configs/lists/bannedregexpurllist
sed -i -e 's:\.\*:.{1,10}:g' configs/lists/bannedregexpurllist
}
build() {
cd "$_builddir"
./configure --prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
......@@ -37,15 +45,30 @@ build() {
--with-piddir=/var/run/ \
--enable-ntlm
make || return 1
make DESTDIR="$pkgdir" install
}
install -D -m 755 ../dansguardian.initd "$pkgdir"/etc/init.d/dansguardian
install -D -m 644 ../dansguardian.logrotate "$pkgdir"/etc/logrotate.d/dansguardian
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
install -D -m 755 "$srcdir"/dansguardian.initd \
"$pkgdir"/etc/init.d/dansguardian || return 1
install -D -m 644 "$srcdir"/dansguardian.logrotate \
"$pkgdir"/etc/logrotate.d/dansguardian || return 1
install -d -o dansguar -g dansguar "$pkgdir"/var/log/dansguardian
}
md5sums="0987a1c9bfbdf398118386f10279611a dansguardian-2.10.1.1.tar.gz
md5sums="2a88d0392cd28eaec02b7ee727b2e253 dansguardian-2.12.0.3.tar.bz2
feaa8582f8c0251a4bff76b5e05c9369 dansguardian.initd
85b6de01c9508e8ceff5ebb55752f8d3 dansguardian.logrotate
475c46026e8553181d293d5a4feaf6d9 ftp-credential.patch
2c78b5c7346b8fcb3dee352e0c53cb5a dansguardian-2.10.1.1-gcc44.patch
858ea94750a9b32e7715f3da8ef4ae3c gcc4.6.patch"
594ca48a3753684151c2012ee371d15b dansguardian-2.10.1.1-pcre830.patch"
sha256sums="c74e9a32b97f9a9a056fced3da23fe48fca2bc6aa9af670afe9a53dc819414f5 dansguardian-2.12.0.3.tar.bz2
8f4cc18fe5b9f6db1148dbb24c8fa9a3e7832fba63ba1b87a0ea92b1ab093171 dansguardian.initd
d105f5084dcd6ef87ec7bc7c1bc94cb875cdc9c0405bba5f6e2585c300e43b0c dansguardian.logrotate
1eba74871d5ffbb574d49eb0857cb9d43b292c1a27578736e0e883d58b2a7bb4 ftp-credential.patch
8686b5d845642ff74f4706559c770f027de38dd12982dd0a6573d946bb85aa87 dansguardian-2.10.1.1-pcre830.patch"
sha512sums="37155ef4f1a6dd6bdd87f79c7199b77de49746e4bff0631c239a569c21bf26240cbc9eae5a2436653bfc3d170a664710af9d80c4cfac3082a0620caeaac6740b dansguardian-2.12.0.3.tar.bz2
d35100d255014e04f84d174e593a5a3a61687a3416e23c1112c201b2adeeb98ed5456da250693054e42b9b6bb5288b99b7498832be014005202199ac89dafb34 dansguardian.initd
cc23178755365a3cceff08d9eb5c26dd440648b22af15377a30d2032f71cf0bd8ed3ab59c8a671f2cc3f4cdcaebff5d6c9e412f2271b00ac6ce1be5178a32087 dansguardian.logrotate
07b62441363534f39a1400389c702bbd5a53317526a18b3fc929f00bd854706c56b891d7fecb4151e200448f8ba012729e712e9cfdbbd683a3d2634fdc095bd1 ftp-credential.patch
d3d9af038ff5a91d1f9dc6cf4175b0da2a791386ca624f4a639338ed189a274eba720e9771986e7ded517e2623185e8b61ef3689414197c47a6ae3220be99d57 dansguardian-2.10.1.1-pcre830.patch"
diff -Nru dansguardian-2.10.1.1.orig/src/ConnectionHandler.cpp dansguardian-2.10.1.1/src/ConnectionHandler.cpp
--- dansguardian-2.10.1.1.orig/src/ConnectionHandler.cpp 2009-02-25 12:36:22.000000000 +0100
+++ dansguardian-2.10.1.1/src/ConnectionHandler.cpp 2009-07-05 01:15:52.000000000 +0200
@@ -44,6 +44,7 @@
#include <istream>
#ifdef ENABLE_ORIG_IP
+#include <limits.h>
#include <linux/types.h>
#include <linux/netfilter_ipv4.h>
#endif
diff -Nru dansguardian-2.10.1.1.orig/src/downloadmanagers/fancy.cpp dansguardian-2.10.1.1/src/downloadmanagers/fancy.cpp
--- dansguardian-2.10.1.1.orig/src/downloadmanagers/fancy.cpp 2008-11-18 12:27:04.000000000 +0100
+++ dansguardian-2.10.1.1/src/downloadmanagers/fancy.cpp 2009-07-05 01:15:12.000000000 +0200
@@ -26,6 +26,7 @@
#include "../HTMLTemplate.hpp"
#include "../ConnectionHandler.hpp"
+#include <stdio.h>
#include <syslog.h>
#include <sys/time.h>
#include <sys/types.h>
diff -Nru dansguardian-2.10.1.1.orig/src/String.cpp dansguardian-2.10.1.1/src/String.cpp
--- dansguardian-2.10.1.1.orig/src/String.cpp 2009-01-16 11:44:28.000000000 +0100
+++ dansguardian-2.10.1.1/src/String.cpp 2009-07-05 01:15:12.000000000 +0200
@@ -164,9 +164,9 @@
return 0;
off_t t = 0;
if (sizeof(off_t) == 4)
- sscanf(this->c_str(), "%d", &t);
+ sscanf(this->c_str(), "%d", (long *)&t);
else if (sizeof(off_t) == 8)
- sscanf(this->c_str(), "%lld", &t);
+ sscanf(this->c_str(), "%lld", (long long*)&t);
return t;
}
#! /bin/sh /usr/share/dpatch/dpatch-run
## 80_fix_libcre3_max_sub_expression_allocation.dpatch by Russell Coker
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: libpcre3 sets reg.re_nsub to an exreme large value and dansguardian
## DP: tries to allocate memory for all records which lets malloc fail.
## DP: this patch limits the allocation to 1024 records. (#667664)
@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' pkg-dansguardian~/src/RegExp.cpp pkg-dansguardian/src/RegExp.cpp
--- pkg-dansguardian~/src/RegExp.cpp 2011-10-29 14:16:31.000000000 +0200
+++ pkg-dansguardian/src/RegExp.cpp 2012-06-23 11:02:48.821473711 +0200
@@ -161,14 +161,17 @@
offsets.clear();
lengths.clear();
imatched = false;
- regmatch_t *pmatch = new regmatch_t[reg.re_nsub + 1]; // to hold result
+ int num_sub_expressions = MAX_SUB_EXPRESSIONS;
+ if(reg.re_nsub < num_sub_expressions)
+ num_sub_expressions = reg.re_nsub;
+ regmatch_t *pmatch = new regmatch_t[num_sub_expressions + 1]; // to hold result
if (!pmatch) { // if it failed
delete[]pmatch;
imatched = false;
return false;
// exception?
}
- if (regexec(&reg, pos, reg.re_nsub + 1, pmatch, 0)) { // run regex
+ if (regexec(&reg, pos, num_sub_expressions + 1, pmatch, 0)) { // run regex
delete[]pmatch;
imatched = false;
// #ifdef DGDEBUG
@@ -182,7 +185,7 @@
int error = 0;
while (error == 0) {
largestoffset = 0;
- for (i = 0; i <= (signed) reg.re_nsub; i++) {
+ for (i = 0; i <= (signed) num_sub_expressions; i++) {
if (pmatch[i].rm_so != -1) {
matchlen = pmatch[i].rm_eo - pmatch[i].rm_so;
submatch = new char[matchlen + 1];
@@ -199,7 +202,7 @@
}
if (largestoffset > 0) {
pos += largestoffset;
- error = regexec(&reg, pos, reg.re_nsub + 1, pmatch, REG_NOTBOL);
+ error = regexec(&reg, pos, num_sub_expressions + 1, pmatch, REG_NOTBOL);
} else {
error = -1;
}
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' pkg-dansguardian~/src/RegExp.hpp pkg-dansguardian/src/RegExp.hpp
--- pkg-dansguardian~/src/RegExp.hpp 2011-10-29 14:16:31.000000000 +0200
+++ pkg-dansguardian/src/RegExp.hpp 2012-06-23 11:02:48.821473711 +0200
@@ -22,6 +22,7 @@
#ifndef __HPP_REGEXP
#define __HPP_REGEXP
+#define MAX_SUB_EXPRESSIONS 1024
// INCLUDES
#!/bin/sh
adduser -h /var/log/dansguardian -s /bin/false -D dansguar 2>/dev/null
exit 0
addgroup -S dansguar 2>/dev/null
adduser -S -D -H \
-h /var/log/dansguardian \
-s /sbin/nologin \
-G dansguar \
dansguar 2>/dev/null || true
#! /bin/sh /usr/share/dpatch/dpatch-run
## 70-gcc4.6.dpatch by Daniel T Chen <crimsun@ubuntu.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix FTBFS by including cstddef for size_t
@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' dansguardian-2.10.1.1~/src/authplugins/ntlm.cpp dansguardian-2.10.1.1/src/authplugins/ntlm.cpp
--- dansguardian-2.10.1.1~/src/authplugins/ntlm.cpp 2008-11-18 06:27:04.000000000 -0500
+++ dansguardian-2.10.1.1/src/authplugins/ntlm.cpp 2011-08-25 16:37:38.000000000 -0400
@@ -27,6 +27,8 @@
#include "../FDTunnel.hpp"
#include "../OptionContainer.hpp"
+#include <cstddef>
+
#include <syslog.h>
#include <iconv.h>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment