expansion of %{client:shortname}
hi, I know there have been discussions of this in the past - but I was doing some stuff today and came across something related thats already been mentioned but still appears to be absent if I use %{client:shortname} and my clients.conf contains shortname = blahblah then i get a string expansion in unlang of "blahblah" = good (and, in fact I can add any random line to the client stanza and it will work as per email from Alan some months back) = good however, If my clients are in SQL (postgresql or MySQL) then the expansion doesnt work, %{client:shortname} expands to "" 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...) many thanks alan
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.
participants (2)
-
Alan Buxey -
Alan DeKok