expansion of %{client:shortname}

Alan DeKok aland at deployingradius.com
Tue May 24 16:38:01 CEST 2011


Alan Buxey wrote:
> however, If my clients are in SQL (postgresql or MySQL) then the
> expansion doesnt work, 
> 
> %{client:shortname} expands to ""

  Yup...

> what work needs to be done, or area of code explored for this expansion
> to work when the clients are in SQL?  (i see from the startup in 
> debg mode that the shortnames in the SQL are all read and noted...)

  1) move xlat_client from src/main/mainconfig.c to src/main/client.c

  2) hack it so that if "cf_pair_find" returns NULL, then

  3) walk through the "client_config" CONF_PARSER structure, to find
     a named which matches

  4) if the name matches, the matching entry contains the offset in
     the RADCLIENT structure of the data which is needed.

  For now, doing it only for STRING_PTR may be sufficient.

  A more generic way to do this would be to add a function to
src/main/conffile.c which would do most of this work.

  Alan DeKok.



More information about the Freeradius-Devel mailing list