From 8f335eb30438bf249f6bedccc861f37122edd5d7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 9 Nov 2021 04:51:00 -0500 Subject: [PATCH] import spamassassin-3.4.4-4.el8 --- SOURCES/spamassassin-check_header.patch | 45 +++++++++++++++++++++++++ SPECS/spamassassin.spec | 8 +++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 SOURCES/spamassassin-check_header.patch diff --git a/SOURCES/spamassassin-check_header.patch b/SOURCES/spamassassin-check_header.patch new file mode 100644 index 0000000..c35396a --- /dev/null +++ b/SOURCES/spamassassin-check_header.patch @@ -0,0 +1,45 @@ +--- lib/Mail/SpamAssassin/Conf/Parser.pm (revision 1873634) ++++ lib/Mail/SpamAssassin/Conf/Parser.pm (working copy) +@@ -1244,9 +1244,9 @@ + # no re "strict"; # since perl 5.21.8: Ranges of ASCII printables... + if ($text =~ /^exists:(.*)/) { + my $hdr = $1; +- # never evaled, so can be quite generous with the name + # check :addr etc header options +- if ($hdr !~ /^[^:\s]+:?$/) { ++ # $hdr used in eval text, validate carefully ++ if ($hdr !~ /^[\w.-]+:?$/) { + $self->lint_warn("config: invalid head test $name header: $hdr"); + return; + } +@@ -1254,7 +1254,8 @@ + $conf->{test_opt_header}->{$name} = $hdr; + $conf->{test_opt_exists}->{$name} = 1; + } else { +- if ($text !~ /^([^:\s]+(?:\:|(?:\:[a-z]+){1,2})?)\s*([=!]~)\s*(.+)$/) { ++ # $hdr used in eval text, validate carefully ++ if ($text !~ /^([\w.-]+(?:\:|(?:\:[a-z]+){1,2})?)\s*([=!]~)\s*(.+)$/) { + $self->lint_warn("config: invalid head test $name: $text"); + return; + } +--- lib/Mail/SpamAssassin/Plugin/Check.pm (revision 1873634) ++++ lib/Mail/SpamAssassin/Plugin/Check.pm (working copy) +@@ -716,7 +716,7 @@ + } + + my $def = $conf->{test_opt_unset}->{$rulename}; +- push(@{ $ordered{$hdrname . (!defined $def ? '' : "\t".$def)} }, ++ push(@{ $ordered{$hdrname . (!defined $def ? '' : "\t$rulename")} }, + $rulename); + + return if ($opts{doing_user_rules} && +@@ -740,7 +740,8 @@ + my($hdrname, $def) = split(/\t/, $k, 2); + $self->push_evalstr_prefix($pms, ' + $hval = $self->get(q{'.$hdrname.'}, ' . +- (!defined($def) ? 'undef' : 'q{'.$def.'}') . '); ++ (!defined($def) ? 'undef' : ++ '$self->{conf}->{test_opt_unset}->{q{'.$def.'}}') . '); + '); + foreach my $rulename (@{$v}) { + my $tc_ref = $testcode{$rulename}; diff --git a/SPECS/spamassassin.spec b/SPECS/spamassassin.spec index 9b22160..86ecc71 100644 --- a/SPECS/spamassassin.spec +++ b/SPECS/spamassassin.spec @@ -60,7 +60,7 @@ Summary: Spam filter for email which can be invoked from mail delivery agents Name: spamassassin Version: 3.4.4 #Release: 0.8.%%{prerev}%%{?dist} -Release: 3%{?dist} +Release: 4%{?dist} License: ASL 2.0 Group: Applications/Internet URL: https://spamassassin.apache.org/ @@ -102,7 +102,7 @@ Patch5: spamassassin-disable_tests_for_deleted_modules.patch # Patches 100+ are SVN backports (DO NOT REUSE!) Patch100: spamassassin-cert_update.patch - +Patch101: spamassassin-check_header.patch # end of patches Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) @@ -248,6 +248,7 @@ rm -f lib/Mail/SpamAssassin/Plugin/ResourceLimits.pm # Patches 100+ are SVN backports (DO NOT REUSE!) %patch100 -p1 +%patch101 -p0 # end of patches echo "RHEL=%{?rhel} FEDORA=%{?fedora}" @@ -434,6 +435,9 @@ exit 0 %endif %changelog +* Thu Jul 29 2021 Pavel Zhukov - 3.4.4-4.el4 +- Fix header parsing + * Tue Oct 6 2020 Pavel Zhukov - 3.4.4-3 - Add tests BRs