dilfridge 14/09/10 20:22:25 Added: spamassassin-3.3.2-perl518.patch Log: Backport Perl 5.18 fixes, bug 519186; EAPI bump (Portage version: 2.2.12/cvs/Linux x86_64, signed Manifest commit with key 84AD142F)
Revision Changes Path 1.1 mail-filter/spamassassin/files/spamassassin-3.3.2-perl518.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/spamassassin/files/spamassassin-3.3.2-perl518.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/spamassassin/files/spamassassin-3.3.2-perl518.patch?rev=1.1&content-type=text/plain Index: spamassassin-3.3.2-perl518.patch =================================================================== diff -ruN Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/AsyncLoop.pm Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/AsyncLoop.pm --- Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/AsyncLoop.pm 2011-06-07 01:59:17.000000000 +0200 +++ Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/AsyncLoop.pm 2014-09-10 22:16:38.795106231 +0200 @@ -360,7 +360,14 @@ } $now = time; # capture new timestamp, after possible sleep in 'select' - while (my($key,$ent) = each %$pending) { + # A callback routine may generate another DNS query, which may insert + # an entry into the %$pending hash thus invalidating the each() context. + # So, make sure that callbacks are not called while the each() context + # is open, or avoid using each(). [Bug 6937] + # + # while (my($key,$ent) = each %$pending) { + foreach my $key (keys %$pending) { + my $ent = $pending->{$key}; my $id = $ent->{id}; if (defined $ent->{poll_callback}) { # call a "poll_callback" if exists # be nice, provide fresh info to a callback routine @@ -448,7 +455,8 @@ my $pending = $self->{pending_lookups}; my $foundcnt = 0; my $now = time; - while (my($key,$ent) = each %$pending) { + foreach my $key (keys %$pending) { + my $ent = $pending->{$key}; dbg("async: aborting after %.3f s, %s: %s", $now - $ent->{start_time}, (defined $ent->{timeout_initial} && diff -ruN Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/Conf/Parser.pm Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/Conf/Parser.pm --- Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/Conf/Parser.pm 2011-06-07 01:59:17.000000000 +0200 +++ Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/Conf/Parser.pm 2014-09-10 22:16:38.796106231 +0200 @@ -1248,7 +1248,7 @@ my $safere = $re; my $mods = ''; local ($1,$2); - if ($re =~ s/^m{//) { + if ($re =~ s/^m\{//) { $re =~ s/}([a-z]*)$//; $mods = $1; } elsif ($re =~ s/^m\(//) { diff -ruN Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/DnsResolver.pm Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/DnsResolver.pm --- Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/DnsResolver.pm 2011-06-07 01:59:17.000000000 +0200 +++ Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/DnsResolver.pm 2014-09-10 22:16:38.797106231 +0200 @@ -440,10 +440,16 @@ { my $timer; # collects timestamp when variable goes out of scope if (!defined($timeout) || $timeout > 0) { $timer = $self->{main}->time_method("poll_dns_idle") } + $! = 0; ($nfound, $timeleft) = select($rout=$rin, undef, undef, $timeout); } if (!defined $nfound || $nfound < 0) { - warn "dns: select failed: $!"; + if ($!) { warn "dns: select failed: $!\n" } + else { info("dns: select interrupted") } + return; + } elsif (!$nfound) { + if (!defined $timeout) { warn("dns: select returned empty-handed\n") } + elsif ($timeout > 0) { dbg("dns: select timed out %.3f s", $timeout) } return; } diff -ruN Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/Message.pm Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/Message.pm --- Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/Message.pm 2011-06-07 01:59:17.000000000 +0200 +++ Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/Message.pm 2014-09-10 22:16:38.797106231 +0200 @@ -566,7 +566,7 @@ while (my $part = shift @toclean) { # bug 5557: windows requires tmp file be closed before it can be rm'd if (ref $part->{'raw'} eq 'GLOB') { - close($part->{'raw'}) or die "error closing input file: $!"; + close($part->{'raw'}) or warn "error closing input file: $!"; } # bug 5858: avoid memory leak with deep MIME structure diff -ruN Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/PerMsgStatus.pm Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/PerMsgStatus.pm --- Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/PerMsgStatus.pm 2011-06-07 01:59:17.000000000 +0200 +++ Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/PerMsgStatus.pm 2014-09-10 22:16:38.799106231 +0200 @@ -420,8 +420,8 @@ } } - # ignore tests with 0 score in this scoreset - next if ($scores->{$test} == 0); + # ignore tests with 0 score (or undefined) in this scoreset + next if !$scores->{$test}; # Go ahead and add points to the proper locations if (!$self->{conf}->maybe_header_only ($test)) { @@ -1252,13 +1252,12 @@ my $arg = (shift || ","); my $line = ''; foreach my $test (sort @{$self->{test_names_hit}}) { - if (!$line) { - $line .= $test . "=" . $self->{conf}->{scores}->{$test}; - } else { - $line .= $arg . $test . "=" . $self->{conf}->{scores}->{$test}; - } + my $score = $self->{conf}->{scores}->{$test}; + $score = '0' if !defined $score; + $line .= $arg if $line ne ''; + $line .= $test . "=" . $score; } - $line ? $line : 'none'; + $line ne '' ? $line : 'none'; }, PREVIEW => sub { $self->get_content_preview() }, diff -ruN Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/Util.pm Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/Util.pm --- Mail-SpamAssassin-3.3.2.orig/lib/Mail/SpamAssassin/Util.pm 2011-06-07 01:59:17.000000000 +0200 +++ Mail-SpamAssassin-3.3.2/lib/Mail/SpamAssassin/Util.pm 2014-09-10 22:16:38.801106231 +0200 @@ -1582,7 +1582,7 @@ warn "cannot remove delimiters from null regexp"; return undef; # invalid } - elsif ($re =~ s/^m{//) { # m{foo/bar} + elsif ($re =~ s/^m\{//) { # m{foo/bar} $delim = '}'; } elsif ($re =~ s/^m\(//) { # m(foo/bar)
