diff options
author | Bernard Cafarelli <voyageur@gentoo.org> | 2010-05-19 15:22:39 +0000 |
---|---|---|
committer | Bernard Cafarelli <voyageur@gentoo.org> | 2010-05-19 15:22:39 +0000 |
commit | e459c413852f98ca82589f453c392077a9650ae0 (patch) | |
tree | 576e2be4a5c43e1e02d76cebc12bc7df66c72764 /mail-filter | |
parent | Bump (diff) | |
download | historical-e459c413852f98ca82589f453c392077a9650ae0.tar.gz historical-e459c413852f98ca82589f453c392077a9650ae0.tar.bz2 historical-e459c413852f98ca82589f453c392077a9650ae0.zip |
Apply patch from Debian to untaint ocr helpers, bug #313633
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64
Diffstat (limited to 'mail-filter')
4 files changed, 225 insertions, 2 deletions
diff --git a/mail-filter/spamassassin-fuzzyocr/ChangeLog b/mail-filter/spamassassin-fuzzyocr/ChangeLog index 06265fcff9e5..795d44d36c14 100644 --- a/mail-filter/spamassassin-fuzzyocr/ChangeLog +++ b/mail-filter/spamassassin-fuzzyocr/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for mail-filter/spamassassin-fuzzyocr # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/ChangeLog,v 1.20 2010/04/26 21:36:42 voyageur Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/ChangeLog,v 1.21 2010/05/19 15:22:39 voyageur Exp $ + +*spamassassin-fuzzyocr-3.6.0-r1 (19 May 2010) + + 19 May 2010; Bernard Cafarelli <voyageur@gentoo.org> + +spamassassin-fuzzyocr-3.6.0-r1.ebuild, + +files/spamassassin-fuzzyocr-3.6.0-untaint_ocr_helper.patch: + Apply patch from Debian to untaint ocr helpers, bug #313633 26 Apr 2010; Bernard Cafarelli <voyageur@gentoo.org> -spamassassin-fuzzyocr-2.3b.ebuild, -spamassassin-fuzzyocr-3.5.1.ebuild, diff --git a/mail-filter/spamassassin-fuzzyocr/Manifest b/mail-filter/spamassassin-fuzzyocr/Manifest index 89d075a48bf9..93ec2f2d3db8 100644 --- a/mail-filter/spamassassin-fuzzyocr/Manifest +++ b/mail-filter/spamassassin-fuzzyocr/Manifest @@ -4,7 +4,9 @@ AUX enabletesseract.patch 656 RMD160 4b6452e84815fbe8d5b47e0cdcdc736c99cfa3dd SH AUX fuzzyocr.logrotate 318 RMD160 2cc40d67746b344bd318b0672aef5425fd09499f SHA1 575f3a5a922bab997fd993dfca3da86c02075dff SHA256 22a03bf34157324ef7a0df2c539c526b71b649e5184f40461e4b36091cd8bf54 AUX spamassassin-fuzzyocr-3.6.0-fix_falsepositives.patch 509 RMD160 360234d69504b8478d6a05a3b356a9dba412e9c9 SHA1 c60f40630d6622f93821f82052c2115d876633bd SHA256 68066c3b509d55b62877c6b02a83688a0336eaa06200d8370a6064d136839cb9 AUX spamassassin-fuzzyocr-3.6.0-fix_tmpdir.patch 2104 RMD160 68536642772122c171cb537876778f5eaad23925 SHA1 d2345babbc6eac33c8a531f31bf763eee21d03a1 SHA256 987dadbcd0e85417d363afdd9f8b78baf53b237f2ead34e54d30908cae9d0167 +AUX spamassassin-fuzzyocr-3.6.0-untaint_ocr_helper.patch 1152 RMD160 98d80b2a135f044db7e78a055b629b9d619417a4 SHA1 6e9b2c8e6b5dd22e325c956315a1fd931cfa087d SHA256 9fbfd1f6130f0f932867398ca4e4a34359da8ec93e2567e356bf82393510d63c DIST fuzzyocr-3.6.0.tar.gz 127103 RMD160 3aa1ee63ffe0996dee3b1c988a2e96bc2edbbe8c SHA1 c54a797899401b9922e5d6371a607780923192de SHA256 dd345c9500c3c3cdc33503863fe234bf3c2720c54b303e6cbc94dbe8aaf3a218 +EBUILD spamassassin-fuzzyocr-3.6.0-r1.ebuild 5456 RMD160 2b5874a021f91e3d2b33c6f8abd4227dfe664f97 SHA1 938b8fcd5902379a7eb50871bfb54ecc56d77c3e SHA256 3a76903f776c12f4f6d36833df9c384f4c02ca5940831691b9e36545724fe5dc EBUILD spamassassin-fuzzyocr-3.6.0.ebuild 5381 RMD160 e5b88a338b351a8365fb9c6d16c0fb80d9a906cc SHA1 9e3eaa9786825408e202126037fe041384dbad5e SHA256 9267a938e874c3c43944c5b91240fb480808d4b89c40c76dbdfcc39d2d59b2b6 -MISC ChangeLog 3585 RMD160 319cbc74ab6d9696b130df3672d1babf8690be0c SHA1 b7a71f824c2b64b05916e79182bf202057ad0f04 SHA256 652fabc70f32971499cb364b0331a27cb7749b806393f0c7fd5f53be76470c0d +MISC ChangeLog 3855 RMD160 c70958005701bcb420b740473ca1257c7dd1836d SHA1 7a7baec5a2d21aba13d401ec9bf54ebe6695f90a SHA256 0541edc8bcb7fa9971d87c9efc8367dc351f36842f0b89b9e94c604e4e0ccb01 MISC metadata.xml 1217 RMD160 5a5cd5bc44f18f5488d828eda16bc0ad7ac2d56e SHA1 42204cce83337d6b9cb014dc4e6bc2a28c2d1bce SHA256 ed56cf7e438a71d082cbfd6702def7697ee0c3576152249e69a032c915ca1966 diff --git a/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-untaint_ocr_helper.patch b/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-untaint_ocr_helper.patch new file mode 100644 index 000000000000..0aae0ec84ae7 --- /dev/null +++ b/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-untaint_ocr_helper.patch @@ -0,0 +1,27 @@ +Description: untaint config entries + Explicitly untainting the data from focr_bin_helper and focr_bin_<progname> + config entries to make sure Perl can execute the programs in taint mode. +Forwarded: Christian Holler <decoder@own-hero.net> +Author: Arjan Opmeer <arjan.opmeer@gmail.com> +Bug-Debian: http://bugs.debian.org/568560 +Last-Update: 2010-02-18 + +--- a/FuzzyOcr/Config.pm ++++ b/FuzzyOcr/Config.pm +@@ -577,7 +577,7 @@ sub parse_config { + return 1; + } elsif ($opts->{key} eq 'focr_bin_helper') { + my @cmd; $conf = $opts->{conf}; +- my $val = $opts->{value}; $val =~ s/[\s]*//g; ++ my $val = Mail::SpamAssassin::Util::untaint_var($opts->{value}); $val =~ s/[\s]*//g; + debuglog("focr_bin_helper: '$val'"); + foreach my $bin (split(',',$val)) { + unless (grep {m/$bin/} @bin_utils) { +@@ -618,6 +618,7 @@ sub finish_parsing_end { + delete $conf->{$b}; + } + if (defined $conf->{$b}) { ++ $conf->{$b} = Mail::SpamAssassin::Util::untaint_var($conf->{$b}); + debuglog("Using $a => $conf->{$b}"); + } else { + foreach my $p (@paths) { diff --git a/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-3.6.0-r1.ebuild b/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-3.6.0-r1.ebuild new file mode 100644 index 000000000000..91634978aff2 --- /dev/null +++ b/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-3.6.0-r1.ebuild @@ -0,0 +1,187 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-3.6.0-r1.ebuild,v 1.1 2010/05/19 15:22:39 voyageur Exp $ + +EAPI=2 +inherit perl-module eutils + +MY_P="${P#spamassassin-}" + +DESCRIPTION="SpamAssassin plugin for performing Optical Character Recognition (OCR) on attached images" +HOMEPAGE="http://fuzzyocr.own-hero.net/" +SRC_URI="http://users.own-hero.net/~decoder/fuzzyocr/${MY_P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="dbm gocr ocrad tesseract mysql logrotate amavis" + +DEPEND="dev-lang/perl + dev-perl/Tie-Cache + >=mail-filter/spamassassin-3.2.0" + +RDEPEND="${DEPEND} + gocr? ( >=app-text/gocr-0.43 ) + ocrad? ( >=app-text/ocrad-0.14 ) + tesseract? ( app-text/tesseract ) + !gocr? ( !ocrad? ( !tesseract? ( >=app-text/ocrad-0.14 ) ) ) + mysql? ( dev-perl/DBD-mysql dev-perl/DBI ) + logrotate? ( app-admin/logrotate ) + dbm? ( virtual/perl-DB_File dev-perl/MLDBM-Sync virtual/perl-Storable ) + media-libs/netpbm[jpeg,png,tiff] + media-libs/giflib + dev-perl/String-Approx + virtual/perl-Time-HiRes + media-gfx/gifsicle" +# postgres? ( dev-perl/DBD-Pg ) + +S="${WORKDIR}/${MY_P/fuzzyocr/FuzzyOcr}" + +pkg_setup() { + if ! use gocr && ! use ocrad && ! use tesseract ; then + ewarn You did not specify an OCR engine. They can be + ewarn enabled/disabled via the USE flags: + ewarn gocr ocrad tesseract + ewarn Defaulting to ocrad + fi + + # create fuzzyocr group for logging and hashing + if use dbm || use logrotate ; then + use amavis || enewgroup fuzzyocr + fi +} + +src_prepare() { + # Bug #174993 + epatch "${FILESDIR}"/${P}-fix_falsepositives.patch + # Bug #273183 + epatch "${FILESDIR}"/${P}-fix_tmpdir.patch + # Bug #313633 + epatch "${FILESDIR}"/${P}-untaint_ocr_helper.patch + + # If no ocrad USE flag, remove it from Fuzzyocr.scansets / jni + use ocrad || epatch "${FILESDIR}"/disableocrad.patch + + # If tesseract USE flag is set, enable it in Fuzzyocr.scansets /jni + use tesseract && epatch "${FILESDIR}"/enabletesseract.patch + + # If gocr USE flag is unset, enable disable gocr in Fuzzyocr.scansets /jni + use gocr || epatch "${FILESDIR}"/disablegocr.patch + + # Apply PgSQL patchset if USE postgres /juan + #use postgres && epatch "${FILESDIR}"/postgresql.patch +} + +src_install() { + # called to get ${VENDOR_LIB} + perlinfo + + local plugin_dir=${VENDOR_LIB}/Mail/SpamAssassin/Plugin + + insinto ${plugin_dir} + doins FuzzyOcr.pm + + # Replace location of .pm file in config + sed -ie "s:FuzzyOcr.pm:${plugin_dir}/FuzzyOcr.pm:" FuzzyOcr.cf + + # Enable logfile if logrotate + if use logrotate ; then + sed -ie "s:^#focr_verbose 3:focr_verbose 3:" FuzzyOcr.cf + sed -ie "s:^#focr_logfile /tmp/FuzzyOcr.log:focr_logfile /var/log/FuzzyOcr.log:" FuzzyOcr.cf + + # Create the logfile with correct permissions /jni + if [ ! -e /var/log/FuzzyOcr.log ]; then + insinto /var/log + newins /dev/null FuzzyOcr.log + if use amavis ; then + fperms 600 /var/log/FuzzyOcr.log + fowners amavis:amavis /var/log/FuzzyOcr.log + else + fperms 660 /var/log/FuzzyOcr.log + fowners root:fuzzyocr /var/log/FuzzyOcr.log + fi + fi + + diropts "" + dodir /etc/logrotate.d + insopts -m0644 + insinto /etc/logrotate.d + newins "${FILESDIR}"/fuzzyocr.logrotate FuzzyOcr + fi + + # Create needed dir for dbs and change FuzzyOcr.cf /jni + if use dbm ; then + dodir /var/lib/FuzzyOcr + keepdir /var/lib/FuzzyOcr + if use amavis ; then + fowners amavis:amavis /var/lib/FuzzyOcr + fperms 700 /var/lib/FuzzyOcr + else + fowners root:fuzzyocr /var/lib/FuzzyOcr + fperms 770 /var/lib/FuzzyOcr + fi + + sed -ie "s:^#focr_digest_db /etc/mail/spamassassin/FuzzyOcr.hashdb:#focr_digest_db /var/lib/FuzzyOcr/FuzzyOcr.hashdb:" FuzzyOcr.cf + sed -ie "s:^#focr_db_hash /etc/mail/spamassassin/FuzzyOcr.db:#focr_db_hash /var/lib/FuzzyOcr/FuzzyOcr.db:" FuzzyOcr.cf + sed -ie "s:^#focr_db_safe /etc/mail/spamassassin/FuzzyOcr.safe.db:#focr_db_safe /var/lib/FuzzyOcr/FuzzyOcr.safe.db:" FuzzyOcr.cf + + if ! use amavis ; then + insinto /var/lib/FuzzyOcr/ + + local hash_files="FuzzyOcr.hashdb FuzzyOcr.db FuzzyOcr.safe.db" + + for file in ${hash_files}; do + if [ ! -e /var/lib/FuzzyOcr/${file} ]; then + newins /dev/null ${file} + fperms 660 /var/lib/FuzzyOcr/${file} + fowners root:fuzzyocr /var/lib/FuzzyOcr/${file} + fi + done + fi + fi + + insinto /etc/mail/spamassassin/ + + doins FuzzyOcr.cf + doins FuzzyOcr.words + doins FuzzyOcr.scansets + doins FuzzyOcr.preps + insinto ${VENDOR_LIB}/FuzzyOcr + doins FuzzyOcr/* + + docinto samples + dodoc samples/* +} + +pkg_postinst() { + elog "You need to restart spamassassin (as root) before this plugin will work:" + elog "/etc/init.d/spamd restart" + echo + if use dbm || use logrotate ; then + local files="" + + if use dbm ; then + files="/var/lib/FuzzyOcr" + fi + + if use logrotate ; then + if [ -z ${files} ] ; then + files="/var/log/FuzzyOcr.log" + else + files="${files} /var/log/FuzzyOcr.log" + fi + fi + + if use amavis ; then + elog "All permissions are set for the user amavis!" + else + elog "Permissions have been set for the fuzzyocr group, to enable" + elog "logging or hashing add any required users to this group" + fi + + echo + ewarn "If you run spamassassin as another user, please make sure to" + ewarn "change permissions on" ${files/ / and } + echo + fi +} |