You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2015/01/22 20:54:29 UTC
[Bug 7123] New: Address some warnings issued by 'use re qw(strict)'
in perl 5.21.8
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
Bug ID: 7123
Summary: Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Product: Spamassassin
Version: 3.4 SVN branch
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P2
Component: Libraries
Assignee: dev@spamassassin.apache.org
Reporter: Mark.Martinec@ijs.si
Perl 5.21.8 provides some additional warnings and checks,
which are disabled by default, but can potentially point out
a genuine bug.
The perldelta tells:
"use re 'strict'"
This applies stricter syntax rules to regular expression patterns
compiled within its scope, which hopefully will alert you to typos and
other unintentional behavior that backwards-compatibility issues
prevent us from doing in normal regular expression compilations.
Because the behavior of this is subject to change in future Perl
releases as we gain experience, using this pragma will raise a category
"experimental:re_strict" warning. See 'strict' in re.
So I have temporarily inserted (and then removed) the:
use warnings 'extra';
no warnings 'experimental::re_strict';
use re 'strict';
and run 'make test' under perl 5.21.8. It showed plenty of warnings,
most of them unnecessary, but few of them pointed to a real or
potential bug:
Need exactly 3 octal digits in regex
Use \x{...} for more than two hex characters in regex
\0.." is more clearly written simply as "\." in regex
Ranges of ASCII printables should be some subset of "0-9",
"A-Z", or "a-z" in regex
For cases of unnecessary "Ranges of ASCII printables..." or the
"is more clearly written as" I have locally disabled the re strict
check (no re 'strict'), but as the re 'strict' is not recognized
by older versions of perl, these few lines are now commented out,
yet left in code as a reminder.
Found a genuine bug in PerMsgStatus.pm where a regexp specified a
too wide range or characters: [0-9a-fA-f] (instead of [0-9a-fA-F]).
Fixed the "Need exactly 3 octal digits in regex" for null characters
in Message/Metadata/Received.pm.
Added a missing 'use warnings' to plugins ASN and FreeMail,
and to sa-learn.raw, which were the only three files without
the 'use warnings'.
Avoided a potentially ambiguous \x followed by three hex digits
(a warning: "Use \x{...} for more than two hex characters in regex")
in Util.pm and in rules/25_replace.cf replace_tag A.
Adapted t/recreate.t to ignore unnecessary warnings due
to "Ranges of ASCII printables" in several rules.
Attached is a preliminary patch for inspection. I may need to
update some detail after all tests are completed.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7123] Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
Mark Martinec <Ma...@ijs.si> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|Undefined |3.4.1
--- Comment #4 from Mark Martinec <Ma...@ijs.si> ---
Bug 7123: Address some warnings issued by 'use re qw(strict)' in perl 5.21.8
Sending lib/Mail/SpamAssassin/Conf/Parser.pm
Sending lib/Mail/SpamAssassin/HTML.pm
Sending lib/Mail/SpamAssassin/Message/Metadata/Received.pm
Sending lib/Mail/SpamAssassin/Message.pm
Sending lib/Mail/SpamAssassin/PerMsgStatus.pm
Sending lib/Mail/SpamAssassin/Plugin/ASN.pm
Sending lib/Mail/SpamAssassin/Plugin/FreeMail.pm
Sending lib/Mail/SpamAssassin/Plugin/MIMEEval.pm
Sending lib/Mail/SpamAssassin/Plugin/RelayEval.pm
Sending lib/Mail/SpamAssassin/Util.pm
Sending rules/25_replace.cf
Sending sa-learn.raw
Sending spamd/spamd.raw
Sending t/recreate.t
Committed revision 1654102.
(it's not as intrusive as it may look, many of these changes are
just an added commented-out directive for documentation purpose)
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7123] Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
Kevin A. McGrail <km...@pccc.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kmcgrail@pccc.com
--- Comment #2 from Kevin A. McGrail <km...@pccc.com> ---
Very nice. I'll see if I can get 5.21.8 on a system for testing soon. KAM
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7123] Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
--- Comment #7 from Kevin A. McGrail <km...@pccc.com> ---
(In reply to Benny Pedersen from comment #6)
> is this resolving that AWL can get urls in the AWL db ?
> and that domain match where there is a @example.com key that is considered
> htttp ?
>
> at first i would like to have it solved, but i begin to like that bug :=)
>
> to be more verbose, keep tracking mailto: and http: seperate
Can you point to the specific bug?
And recommend you start testing TxRep. I think it shows good promise to
replace AWL.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7123] Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
Benny Pedersen <me...@junc.eu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |me@junc.eu
--- Comment #6 from Benny Pedersen <me...@junc.eu> ---
is this resolving that AWL can get urls in the AWL db ?
and that domain match where there is a @example.com key that is considered
htttp ?
at first i would like to have it solved, but i begin to like that bug :=)
to be more verbose, keep tracking mailto: and http: seperate
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7123] Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
Mark Martinec <Ma...@ijs.si> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #5266|0 |1
is obsolete| |
--- Comment #3 from Mark Martinec <Ma...@ijs.si> ---
Created attachment 5267
--> https://issues.apache.org/SpamAssassin/attachment.cgi?id=5267&action=edit
final patch (fixed one bug in the preliminary patch)
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7123] Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
--- Comment #1 from Mark Martinec <Ma...@ijs.si> ---
Created attachment 5266
--> https://issues.apache.org/SpamAssassin/attachment.cgi?id=5266&action=edit
preliminary patch
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7123] Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
--- Comment #8 from Benny Pedersen <me...@junc.eu> ---
no bug created, when i tried txrep it did the same fault with http protocol in
database, not very usefull to track urls there imho unless http match mta
client ip, which its seldom does
filter @ in awl / txrep should keep it mailto: only
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7123] Address some warnings issued by 'use re qw(strict)' in
perl 5.21.8
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7123
Kevin A. McGrail <km...@pccc.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Kevin A. McGrail <km...@pccc.com> ---
Looks good. Thanks for testing with the devel branch. I've got it installed
and tested with trunk as well. I swear I think you just fixed a mailto bug I
had noticed in PMS but never would have found in that re.
Regards,
KAM
--
You are receiving this mail because:
You are the assignee for the bug.