Freeradius not unescaping \ and "

Murray Long murray at skyrove.com
Tue Sep 7 13:05:25 CEST 2010


That switch statement has no condition for *cp == "\\".  Which is what
I have added. (Please see patch attached to my previous message)


On Tue, Sep 7, 2010 at 12:37 PM, Alan DeKok <aland at deployingradius.com> wrote:
> Murray Long wrote:
>> When passing variables to the perl module,
>> "void fr_print_string(const char *in, size_t inlen, char *out, size_t outlen)"
>> Escapes all special characters (including '\')
>
>  Yes.
>
>> When variables are returned from perl,
>> VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value)
>> unescapes special characters, but ignores "\\"
>
>  ? I'm not sure how you conclude that.  The code in the v2.1.x branch
> handles escaping of '\\' for "string" attributes.  See pairparsevalue(),
> the "while" loop:
>
>   while (*cp && (length < (sizeof(vp->vp_strvalue) - 1))) {
>        char c = *cp++;
>
>        if (c == '\\') {
>                switch (*cp) {
>                        ...
>                        case '\'':
>                                c = '\'';
>                                cp++;
>                                break;
>                        ...
>
>> I've patched the pairparsevalue function to handle an escaped
>> backslash, which has solved my problems.  However this is my first
>> time looking at freeradius source, so have no idea what knock-on
>> effects this will have, so please could someone review this for me.
>
>  What code did you change?
>
>  Alan DeKok.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>




More information about the Freeradius-Users mailing list