Bug 5493 - [review] sa-compile not correctly parsing escaped backslashes
Summary: [review] sa-compile not correctly parsing escaped backslashes
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: sa-compile (show other bugs)
Version: 3.2.0
Hardware: All Linux
: P5 major
Target Milestone: 3.2.4
Assignee: SpamAssassin Developer Mailing List
URL: http://www.disco-zombie.net/SARULES/X...
Whiteboard: ready to commit for 3.2
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-02 14:18 UTC by mrgus
Modified: 2007-12-16 13:21 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
fix patch None Justin Mason [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description mrgus 2007-06-02 14:18:50 UTC
sa-compile, when extracting the regex's into the scanner*.re files, seems to
interpret backslahses as either '\"' or '\""'.

Here's the example I used on the sa-users mailing list...

Original rule's regex:

/(?:fr(?:o|0|\(\))(?:n|\|\\\|)[t7]p[a\@4]g[e3]\s\d+)/i

Scanner.re result:

"fro|\""|"            {RET("__XM_Sft_Ms_Fp_L33T");}

It produces the above output, instead of "fro|\|".

This comes from the file in the URL field of this ticket. Do an sa-compile with
the file in your spamassassin config, and you'll see this and a few more
examples of the same thing. I've even tried escaping it with the hex code for a
backlash, but I get the same results. :-/ Always either '\"' or '\""'.
Comment 1 Justin Mason 2007-08-19 15:07:29 UTC
thanks, this is fixed by the patch to follow, which I've just applied to
trunk:

: jm 144...; svn commit -m "bug 5493: sa-compile would not correctly deal with escap
ed backslashes, fix" sa-compile.raw
Sending        sa-compile.raw
Transmitting file data .
Committed revision 567486.
Comment 2 Justin Mason 2007-08-19 15:07:55 UTC
Created attachment 4100 [details]
fix
Comment 3 Justin Mason 2007-09-26 03:23:52 UTC
marking major; sa-compile should not die on valid input
Comment 4 snowcrash+apache 2007-10-30 15:53:45 UTC
bump ...
Comment 5 Daryl C. W. O'Shea 2007-11-06 12:06:30 UTC
+1
Comment 6 Sidney Markowitz 2007-12-16 01:38:35 UTC
+1
Comment 7 Justin Mason 2007-12-16 13:21:26 UTC
now in 3.2.x: r604707