bug in token.c ?

Phil Mayers p.mayers at imperial.ac.uk
Mon Jul 25 14:06:57 CEST 2011


On 25/07/11 09:45, Oliver Schröder wrote:

> This piece of code removes all backslashes from the input string, which
> gives incorrect results when parsing strings for regular expressions
> with excaped characters. At a first glance, the fix is easy:

No. You have to double-escape everything. This is common (e.g. Exim does 
the same thing with it's config file) if tedious.

If you want the following regexp:

\d+\.

...you need to write:

\\d+\\.

...in the FreeRADIUS config.


 From what I can see, you're suggesting that:

\X

...where X is not specifically handled should leave the "\" unchanged. 
Maybe, maybe not - I've seen string parsers that do both. There is no 
"right" answer. FreeRADIUS expects backslashes to precede known escapes 
or be themselves backslashed.



More information about the Freeradius-Devel mailing list