diff options
author | Paweł Hajdan <phajdan.jr@gentoo.org> | 2012-09-16 10:31:07 +0000 |
---|---|---|
committer | Paweł Hajdan <phajdan.jr@gentoo.org> | 2012-09-16 10:31:07 +0000 |
commit | 74f96b33ba700009cfddce68aa107f6a0bd1643c (patch) | |
tree | 685005561b9cbb18395c396e275436b4868b1dec /net-proxy/dansguardian | |
parent | x86 stable, see bug 433603 (diff) | |
download | historical-74f96b33ba700009cfddce68aa107f6a0bd1643c.tar.gz historical-74f96b33ba700009cfddce68aa107f6a0bd1643c.tar.bz2 historical-74f96b33ba700009cfddce68aa107f6a0bd1643c.zip |
Fix dansguardian being unusable after upgrade to pcre-8.30, bug #417679 by Tomas Mozes. Patch from Debian, http://bugs.debian.org/667664 .
Package-Manager: portage-2.1.11.9/cvs/Linux i686
Diffstat (limited to 'net-proxy/dansguardian')
-rw-r--r-- | net-proxy/dansguardian/ChangeLog | 9 | ||||
-rw-r--r-- | net-proxy/dansguardian/Manifest | 34 | ||||
-rw-r--r-- | net-proxy/dansguardian/dansguardian-2.10.1.1-r2.ebuild | 130 | ||||
-rw-r--r-- | net-proxy/dansguardian/files/dansguardian-2.10.1.1-pcre830.patch | 61 |
4 files changed, 222 insertions, 12 deletions
diff --git a/net-proxy/dansguardian/ChangeLog b/net-proxy/dansguardian/ChangeLog index 395394dd5cf1..326bd40840e2 100644 --- a/net-proxy/dansguardian/ChangeLog +++ b/net-proxy/dansguardian/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-proxy/dansguardian # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/dansguardian/ChangeLog,v 1.52 2012/05/03 04:35:53 jdhore Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/dansguardian/ChangeLog,v 1.53 2012/09/16 10:31:07 phajdan.jr Exp $ + +*dansguardian-2.10.1.1-r2 (16 Sep 2012) + + 16 Sep 2012; Pawel Hajdan jr <phajdan.jr@gentoo.org> + +dansguardian-2.10.1.1-r2.ebuild, +files/dansguardian-2.10.1.1-pcre830.patch: + Fix dansguardian being unusable after upgrade to pcre-8.30, bug #417679 by + Tomas Mozes. Patch from Debian, http://bugs.debian.org/667664 . 03 May 2012; Jeff Horelick <jdhore@gentoo.org> dansguardian-2.10.0.3.ebuild, dansguardian-2.10.1.1.ebuild, dansguardian-2.10.1.1-r1.ebuild: diff --git a/net-proxy/dansguardian/Manifest b/net-proxy/dansguardian/Manifest index c2ce236e1e89..f94f1ed4bc02 100644 --- a/net-proxy/dansguardian/Manifest +++ b/net-proxy/dansguardian/Manifest @@ -1,11 +1,23 @@ -AUX dansguardian-2.10.0.3-gcc44.patch 1027 RMD160 a3bab6abef184cdb45bc8de57896084847823078 SHA1 ab7c60dbe683c37935d80f31356a72baa4c5eba9 SHA256 0faa881ab43930c377a134029024c4880094b197a71abcd83351378e27a3e612 -AUX dansguardian-2.10.1.1-gcc44.patch 1472 RMD160 1eb663dcf2e075b81c7d9855d5634377764e82fc SHA1 c95b4b945420b70108d4f07640b348185e8d836a SHA256 7e2069ea67428bc3b81b4e5d0d6ea942810927b600fbd09fb15843e257aff0c0 -AUX dansguardian.init 826 RMD160 99f250a3e37b0650a1665923c976ee9e7cdd32c2 SHA1 0f31190c6b4d110044624063e68bede96eb3e873 SHA256 af4252ed5126e7ff1e289107eae1feb5165030077a93e855c575249eb121edb0 -AUX dansguardian.logrotate 188 RMD160 c2c433f4209518a83725382f8952141a34d58d25 SHA1 ac914a9a4606d2de3297056ba2f06474f4ed31ba SHA256 124775c1a6dd20652e7b7511bb484c654ac63cc0c0a2baf2357d8ce7086867a2 -DIST dansguardian-2.10.0.3.tar.gz 512695 RMD160 437c7996776d491939685ca9024a4a74851d8a0e SHA1 da473d7989da363e21fb347b1a398bd7d2489d51 SHA256 419be86f472ad0a69a8a15857a646271ac9739d29bd836be9159f2d955e5b963 -DIST dansguardian-2.10.1.1.tar.gz 516800 RMD160 dc15ca9779a5084c5e4248545c730f25fff241a3 SHA1 ff3012e01130b2269582c21c3eeb4ea013dc9679 SHA256 c245d58cf37f79f8a8e50b684d62b797a9f6ce1bb775e140969002dff7e11f92 -EBUILD dansguardian-2.10.0.3.ebuild 3212 RMD160 d94f9e102788df9c8cdb6dd10e6780da0bc0ceeb SHA1 bc7b3e988f46144878dfb6292bf3e1af86e64aad SHA256 bdf127e30786651c447087d0bdf31f18731cf2d3c993df169c600b8cbb535cea -EBUILD dansguardian-2.10.1.1-r1.ebuild 3690 RMD160 ea5ce59c731cec657093f4bbc45840529e3e3cb5 SHA1 c649fbcaddb42ba91446d9b6627b9afeb4aa10b1 SHA256 5524a741a4374333c6fb8714b0f2a0712402ba699e17a7246c27924f97f8bffc -EBUILD dansguardian-2.10.1.1.ebuild 3254 RMD160 434421a7736ee96c8e8e6f261fcc003f8259eddb SHA1 4d2f80ca4c4965d1f256c07e79c8607c5f4e4845 SHA256 706e17fade848ea78b89fdb282bdbff11d490c2f7c83d06383893d8e2e2d8679 -MISC ChangeLog 15790 RMD160 8273233aa35d4baeb120b864b7e8037730e3fde0 SHA1 980a441c305c76fad7259ece496919bf8c4b53ce SHA256 31bfedf2bdcfb2511ee443f47a882d799842e676d371bd4332eae701382e6b71 -MISC metadata.xml 724 RMD160 d04fa5762b6b6fa0e0ed1a112412f3a264289e65 SHA1 e45489153e18f40f7e2a5117799069e71b7bce30 SHA256 81f37aeb683cda10ee3786c455ca121138ed63dea31af9ceea8d967ed02f3b03 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +AUX dansguardian-2.10.0.3-gcc44.patch 1027 SHA256 0faa881ab43930c377a134029024c4880094b197a71abcd83351378e27a3e612 SHA512 0d384dd0fc1e8930deaeadf4aa1067d259f4925c384be0833a8a84bf9685572ac5e9674f225c164a1adbf8fa8365bdb9f24ff0d8ddc490cb1f670ad4be5b4b2c WHIRLPOOL 4229c518a2cc7901bd03a95adf55f58199514445eaa4504031f7abf1844439333c6584de0f891971880b1f655a5e81593882e0f401df5daa66ab1bcdb1568a2b +AUX dansguardian-2.10.1.1-gcc44.patch 1472 SHA256 7e2069ea67428bc3b81b4e5d0d6ea942810927b600fbd09fb15843e257aff0c0 SHA512 083f534df290d51c956d35496678e076abbf42f30ed02a46019e64d0de09d08025b42f72587450b2662af94ab3d630d4264964bd9d2995c9629f22b26b910175 WHIRLPOOL 5c9d5f2728fa15376ccbb590f24667e982bbdc2cba3f99b0db652c9c0d2ebc204986e54c0975684491525fd13175a4e76cf9fb83169f3106a7049419fcacaf87 +AUX dansguardian-2.10.1.1-pcre830.patch 2468 SHA256 8686b5d845642ff74f4706559c770f027de38dd12982dd0a6573d946bb85aa87 SHA512 d3d9af038ff5a91d1f9dc6cf4175b0da2a791386ca624f4a639338ed189a274eba720e9771986e7ded517e2623185e8b61ef3689414197c47a6ae3220be99d57 WHIRLPOOL 8a34209bc5663b693787972197d1842f80a81d02e8309224c4c913f7bfdd4371a2f10e3311d4ac3f8692954c058d00880c487b08991720cb831b5155547db943 +AUX dansguardian.init 826 SHA256 af4252ed5126e7ff1e289107eae1feb5165030077a93e855c575249eb121edb0 SHA512 8f074fa25f94b13c126da68273ba163c700afcc6a2ff9042e609c2c3f8dd6cb0741922e92a4722e89a7a6d54822e3e021de64db0c5db53fd4c7c061035e7e438 WHIRLPOOL 657ec02f3831dbf323aad566f983da1b7ddc429510a409469e7dc155ba6430d7d98fb38d976eb130fa6538fdeb8ea29f4720a13bd3ab25e1f8389526dad37b03 +AUX dansguardian.logrotate 188 SHA256 124775c1a6dd20652e7b7511bb484c654ac63cc0c0a2baf2357d8ce7086867a2 SHA512 ec272a14f88cd1939272e4a689602b784236bf2fb25d1d7fd720f4d998028d7e1d6ba520d7044e1fef14838caa18ec19224d1cfbe04318b14316fe507e9d13dc WHIRLPOOL 547f10ea51af68a29355adc6acd1122817f1ca1335566588dd2acb71fc444a40cbb3cacf9ee6ead4ed29a0e35d91eb8ff91d20423644b2d72fe8f30db8ec5d18 +DIST dansguardian-2.10.0.3.tar.gz 512695 SHA256 419be86f472ad0a69a8a15857a646271ac9739d29bd836be9159f2d955e5b963 +DIST dansguardian-2.10.1.1.tar.gz 516800 SHA256 c245d58cf37f79f8a8e50b684d62b797a9f6ce1bb775e140969002dff7e11f92 +EBUILD dansguardian-2.10.0.3.ebuild 3212 SHA256 bdf127e30786651c447087d0bdf31f18731cf2d3c993df169c600b8cbb535cea SHA512 848af2ac1c818ef936a06f7206324820b5664420daae4844d692e95878fbda7da22ffc2ea6148934f726d3eec584846c9a452b7aab8399c0ae5593ee5c00b6f5 WHIRLPOOL 476689a7471816f319f96e7ed5d5cf2ffc8be780ed30a057242d819518caaf731c9092d3d1ff35ab367ec1c4fdd7a11908dad4b8e41ebeb7884a798ff294a5d4 +EBUILD dansguardian-2.10.1.1-r1.ebuild 3690 SHA256 5524a741a4374333c6fb8714b0f2a0712402ba699e17a7246c27924f97f8bffc SHA512 4151a9c892dba63d22b00ba59e90e1e2387d1bab246004fbe7f953c335b15f2dc66e34c68e93dda9dcc7dd9b3497be6522db652dd84a4adcc54d5b32a52f0b41 WHIRLPOOL b1a67402f19f65ce4dee926311e7ef2a5e80588a345e8e04930caeaf6b3a1fb09db08f53595cc708976d6d91292c32e31595976a0e043fa0999bee560daf8432 +EBUILD dansguardian-2.10.1.1-r2.ebuild 3735 SHA256 c1d7c0b60609ad5e88b132c0731961e1876aa95b54fd5efb94c64dc54779d47f SHA512 5289a73344d1dd2a23e39413511e6e9c68b1f6dafd58eba3180d9e8a473ca155ce516df390a56c6062874ef710b6a0e0767ee9a57419b39d22f38f97e64b26cc WHIRLPOOL aa01b2bcb4a1f300fcdc13bef621002a0c5b489fa33a2a34dfdbef713ab925b655ca831ea016a2ae69819099ca49259318dc04b468dc25f32a26e3478baafda1 +EBUILD dansguardian-2.10.1.1.ebuild 3254 SHA256 706e17fade848ea78b89fdb282bdbff11d490c2f7c83d06383893d8e2e2d8679 SHA512 ccc9c066916994119bc20a432a81854e4baaae8d2aab12a8079629e74c850f1e9ab296f722e89f4bb6eedbda4c69c3e83b9fd403c2e50e4647bf617c18f61ce5 WHIRLPOOL b6be026ac2426a7ceb9e66beb80d3fa272b690ea3be877d8fc39030186eb12912100400d33d9862b131a02c544d31d02a184665ab340bb5d4e7caeb85a42677c +MISC ChangeLog 16114 SHA256 d2b9d9bd09d6b917456c56db5d32452a9be67f08fb2f238b390ca1fd0c087d70 SHA512 1b9e693865a85919829da73a35703f519496da3780a770d4b5f26e73312bd6106ac0ac8455d83cedadbe11b3237d791d9a6bfd82a4ae0a21de03ba874ddf274a WHIRLPOOL 945ae2035329e3f03b682406c0984d8641ad6fc12a9decee895504b394d3d4a54206591004d79c00d753fb5e2e5b35f0615c2d5359b10cf5b9e096bb99664c11 +MISC metadata.xml 724 SHA256 81f37aeb683cda10ee3786c455ca121138ed63dea31af9ceea8d967ed02f3b03 SHA512 e628f90bc4529e0b6509d041cadb13423f1ff035e7e15a8ca98d87c16a020710f0fd05a7f71fc9641c782c4f418883ad859f029e782e82a303bb8422383cb07c WHIRLPOOL 0ca691bed176cd9891e8cdbcc0a0f09e06bcbd6c8adfa16aa33b2b624c5e884750873a03d8501e6740d996ce1206b0b6665b6c007db04f4f601c331eda4019ed +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.19 (GNU/Linux) + +iEYEAREIAAYFAlBVqnsACgkQuUQtlDBCeQJydQCfY0563jcfwqT/DayoGaTXJEfq +ZDoAmwcoVMHGzrElUaQ+8QVJSMGbOZLL +=x7EP +-----END PGP SIGNATURE----- diff --git a/net-proxy/dansguardian/dansguardian-2.10.1.1-r2.ebuild b/net-proxy/dansguardian/dansguardian-2.10.1.1-r2.ebuild new file mode 100644 index 000000000000..bdd1b25cdb48 --- /dev/null +++ b/net-proxy/dansguardian/dansguardian-2.10.1.1-r2.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/dansguardian/dansguardian-2.10.1.1-r2.ebuild,v 1.1 2012/09/16 10:31:07 phajdan.jr Exp $ + +EAPI="2" + +inherit eutils + +DESCRIPTION="Web content filtering via proxy" +HOMEPAGE="http://dansguardian.org" +SRC_URI="http://dansguardian.org/downloads/2/Stable/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="clamav kaspersky debug ntlm pcre" + +RDEPEND="sys-libs/zlib + pcre? ( dev-libs/libpcre ) + clamav? ( >=app-antivirus/clamav-0.93 )" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +pkg_setup() { + if has_version "<${CATEGORY}/${PN}-2.9" ; then + ewarn "This version introduces brand new USE flags:" + ewarn " clamav kaspersky ntlm pcre" + echo + + local f="${ROOT}/etc/dansguardian" + f=${f//\/\///} + if [ -d "${f}" ] ; then + eerror "The structure of ${f} has changed in this version!" + eerror "For avoiding confusion, you must either move or delete the old ${f}," + eerror "then continue with the upgrade:" + eerror " mv '${f}' '${f}.old'" + eerror " emerge --resume" + die "Obsolete config files detected" + fi + fi + + if ! use clamav; then + enewgroup dansguardian + enewuser dansguardian -1 -1 /dev/null dansguardian + fi +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-gcc44.patch + epatch "${FILESDIR}"/${P}-pcre830.patch +} + +src_configure() { + local myconf="--with-logdir=/var/log/dansguardian + --with-piddir=/var/run + --docdir=/usr/share/doc/${PF} + --htmldir=/usr/share/doc/${PF}/html + $(use_enable pcre) + $(use_enable ntlm) + --enable-orig-ip + --enable-fancydm + --enable-email" + if use clamav; then + # readd --enable-clamav in the next version if it works with >=clamav-0.95 (#264820) + myconf="${myconf} --enable-clamd + --with-proxyuser=clamav + --with-proxygroup=clamav" + else + myconf="${myconf} + --with-proxyuser=dansguardian + --with-proxygroup=dansguardian" + fi + if use kaspersky; then + myconf="${myconf} --enable-kavd" + fi + if use debug; then + myconf="${myconf} --with-dgdebug=on" + fi + + econf ${myconf} || die "configure failed" +} + +src_compile() { + emake OPTIMISE="${CFLAGS}" || die "emake failed" +} + +src_install() { + emake "DESTDIR=${D}" install || die "emake install failed" + + # Move html documents to html dir + mkdir "${D}"/usr/share/doc/${PF}/html \ + && mv "${D}"/usr/share/doc/${PF}/*.html "${D}"/usr/share/doc/${PF}/html \ + || die "no html docs found in docdir" + + # Copying init script + newinitd "${FILESDIR}/dansguardian.init" dansguardian + + if use clamav; then + sed -r -i -e 's/[ \t]+use dns/& clamd/' "${D}/etc/init.d/dansguardian" + sed -r -i -e 's/^#( *contentscanner *=.*clamdscan[.]conf.*)/\1/' "${D}/etc/dansguardian/dansguardian.conf" + sed -r -i -e 's/^#( *clamdudsfile *=.*)/\1/' "${D}/etc/dansguardian/contentscanners/clamdscan.conf" + elif use kaspersky; then + sed -r -i -e 's/^#( *contentscanner *=.*kavdscan[.]conf.*)/\1/' "${D}/etc/dansguardian/dansguardian.conf" + fi + + # Copying logrotation file + insinto /etc/logrotate.d + newins "${FILESDIR}/dansguardian.logrotate" dansguardian + + keepdir /var/log/dansguardian + fperms o-rwx /var/log/dansguardian +} + +pkg_postinst() { + local runas="dansguardian:dansguardian" + if use clamav ; then + runas="clamav:clamav" + else + elog "dansguardian runs as a dedicated user now" + elog "You may need to remove old ipc files or adjust their ownership." + elog "By default, those files are /tmp/.dguardianipc" + elog "and /tmp/.dguardianurlipc" + fi + einfo "The dansguardian daemon will run by default as ${runas}" + + if [ -d "${ROOT}/var/log/dansguardian" ] ; then + chown -R ${runas} "${ROOT}/var/log/dansguardian" + chmod o-rwx "${ROOT}/var/log/dansguardian" + fi +} diff --git a/net-proxy/dansguardian/files/dansguardian-2.10.1.1-pcre830.patch b/net-proxy/dansguardian/files/dansguardian-2.10.1.1-pcre830.patch new file mode 100644 index 000000000000..0f96c3a9e2d9 --- /dev/null +++ b/net-proxy/dansguardian/files/dansguardian-2.10.1.1-pcre830.patch @@ -0,0 +1,61 @@ +#! /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(®, pos, reg.re_nsub + 1, pmatch, 0)) { // run regex ++ if (regexec(®, 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(®, pos, reg.re_nsub + 1, pmatch, REG_NOTBOL); ++ error = regexec(®, 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 + |