You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2019/07/07 09:31:49 UTC
svn commit: r1862681 - in /spamassassin:
branches/3.4/lib/Mail/SpamAssassin/Conf.pm
trunk/lib/Mail/SpamAssassin/Conf.pm
Author: hege
Date: Sun Jul 7 09:31:49 2019
New Revision: 1862681
URL: http://svn.apache.org/viewvc?rev=1862681&view=rev
Log:
Tighten up addrlist parameter checks
Modified:
spamassassin/branches/3.4/lib/Mail/SpamAssassin/Conf.pm
spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
Modified: spamassassin/branches/3.4/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/lib/Mail/SpamAssassin/Conf.pm?rev=1862681&r1=1862680&r2=1862681&view=diff
==============================================================================
--- spamassassin/branches/3.4/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/branches/3.4/lib/Mail/SpamAssassin/Conf.pm Sun Jul 7 09:31:49 2019
@@ -689,13 +689,13 @@ but the names 'BLACK' and 'WHITE' are ot
code => sub {
my($conf, $key, $value, $line) = @_;
local($1,$2);
- if ($value !~ /^ \( (.*?) \) \s+ (.*) \z/sx) {
+ if ($value !~ /^ \( (.+?) \) \s+ (.+) \z/sx) {
return $MISSING_REQUIRED_VALUE;
}
my $listname = $1; # corresponds to arg in check_uri_host_in_wblist()
# note: must not factor out dereferencing, as otherwise
# subhashes would spring up in a copy and be lost
- foreach my $host ( split(' ', lc $2) ) {
+ foreach my $host ( split(/\s+/, lc $2) ) {
my $v = $host =~ s/^!// ? 0 : 1;
$conf->{uri_host_lists}{$listname}{$host} = $v;
}
@@ -727,11 +727,11 @@ name and has no meaning here.
code => sub {
my($conf, $key, $value, $line) = @_;
local($1,$2);
- if ($value !~ /^ (?: \( (.*?) \) \s+ )? (.*) \z/sx) {
+ if ($value !~ /^ (?: \( (.+?) \) \s+ )? (.+) \z/sx) {
return $MISSING_REQUIRED_VALUE;
}
my @listnames = defined $1 ? $1 : keys %{$conf->{uri_host_lists}};
- my @args = split(' ', lc $2);
+ my @args = split(/\s+/, lc $2);
foreach my $listname (@listnames) {
foreach my $host (@args) {
my $v = $host =~ s/^!// ? 0 : 1;
@@ -783,7 +783,7 @@ e.g.
code => sub {
my($conf, $key, $value, $line) = @_;
local($1,$2);
- if ($value !~ /^ \( (.*?) \) \s+ (.*) \z/sx) {
+ if ($value !~ /^ \( (.+?) \) \s+ (.+) \z/sx) {
return $MISSING_REQUIRED_VALUE;
}
my $listname = $1; # corresponds to arg in check_uri_host_in_wblist()
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm?rev=1862681&r1=1862680&r2=1862681&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Sun Jul 7 09:31:49 2019
@@ -688,13 +688,13 @@ but the names 'BLACK' and 'WHITE' are ot
code => sub {
my($conf, $key, $value, $line) = @_;
local($1,$2);
- if ($value !~ /^ \( (.*?) \) \s+ (.*) \z/sx) {
+ if ($value !~ /^ \( (.+?) \) \s+ (.+) \z/sx) {
return $MISSING_REQUIRED_VALUE;
}
my $listname = $1; # corresponds to arg in check_uri_host_in_wblist()
# note: must not factor out dereferencing, as otherwise
# subhashes would spring up in a copy and be lost
- foreach my $host ( split(' ', lc $2) ) {
+ foreach my $host ( split(/\s+/, lc $2) ) {
my $v = $host =~ s/^!// ? 0 : 1;
$conf->{uri_host_lists}{$listname}{$host} = $v;
}
@@ -726,11 +726,11 @@ name and has no meaning here.
code => sub {
my($conf, $key, $value, $line) = @_;
local($1,$2);
- if ($value !~ /^ (?: \( (.*?) \) \s+ )? (.*) \z/sx) {
+ if ($value !~ /^ (?: \( (.+?) \) \s+ )? (.+) \z/sx) {
return $MISSING_REQUIRED_VALUE;
}
my @listnames = defined $1 ? $1 : keys %{$conf->{uri_host_lists}};
- my @args = split(' ', lc $2);
+ my @args = split(/\s+/, lc $2);
foreach my $listname (@listnames) {
foreach my $host (@args) {
my $v = $host =~ s/^!// ? 0 : 1;
@@ -782,7 +782,7 @@ e.g.
code => sub {
my($conf, $key, $value, $line) = @_;
local($1,$2);
- if ($value !~ /^ \( (.*?) \) \s+ (.*) \z/sx) {
+ if ($value !~ /^ \( (.+?) \) \s+ (.+) \z/sx) {
return $MISSING_REQUIRED_VALUE;
}
my $listname = $1; # corresponds to arg in check_uri_host_in_wblist()