evaluate.c & strings with "\" in them
aland at deployingradius.com
Thu Oct 11 14:28:34 CEST 2012
Phil Mayers wrote:
> This seems a bit crazy,
> but is also inconsistent with the "users"-file
> stuff in valuepair.c - this uses radius_xlat (or vp_prints_value
> directly, now) which finishes up in "vp_prints_value(..., -1) which
> means "value verbatim", so doesn't need quad-escaping.
> The fix is pretty simple:
> ...but is sadly not a backwards-compatible change.
That's fine for 3.0.
> The other thing is, do we actually need to handle "\" inside // at all,
> with the exception of escaping the regex delimiter? Or could we just
> pass "\" straight through to to the regex engine? To give you an idea of
> what I mean (with a bit of extra flags magic too):
if (*p != '/') return getregex2(...);
And have it do basic checks for sanity.
> The choice of "!" is arbitrary, could be anything, indeed, could be
> selectable sed-style by inspecting the 1st character:
> ...but letting it be something other than "/" helps avoid leaning
> toothpick syndrome.
> Thoughts welcome. Just idly playing here really.
I'ts OK. I'll do the pull. :)
More information about the Freeradius-Devel