rlm_detail header not expanding \t

Matthew Newton mcn4 at leicester.ac.uk
Sun Sep 13 00:36:00 CEST 2015


[moving to -devel to save boring everyone]

On Sat, Sep 12, 2015 at 09:58:03AM -0400, Alan DeKok wrote:
> On Sep 9, 2015, at 5:22 PM, Matthew Newton <mcn4 at leicester.ac.uk> wrote:
> > Thanks - better than before, but not what I was expecting. Now "\"
> > is always literal: "%t\t...", '%t\t...' with correct_escapes set
> > to either true or false always outputs:
> > 
> >  Wed Sep  9 22:17:14 2015\t127.0.0.1
> > 
> > But at least it's consistent :)
> 
>   The solution is probably to smash \t, \n, etc. to their
>   respective characters.  The location to do so would be in the
>   same place I put that last patch.

Hmm. I'm not so sure? -

The \t, \n etc are there to indicate that particular char in the
user-given string. Once it's made it into the server from the
config file it should be represented by its binary character.
Otherwise e.g. a string that comes from LDAP or a database could
contain "\t" in it, which would be expanded by xlat. That seems to
be asking for trouble.

The usual perl expectation (and granted this is not directly
relevant, but it's still a common convention) is that "-quoted
strings are expanded, but '-quoted strings are not.

So

  header = "%t\thello"

would be read in to the server as "%t<tabchar>hello", whereas

  header = '%t\thello'

I'd expect to be read in as a literal "%t\thello".

I think the \-expansion should really belong in the config parser?

Cheers,

Matthew


-- 
Matthew Newton, Ph.D. <mcn4 at le.ac.uk>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>


More information about the Freeradius-Devel mailing list