How to rewrite the sql_user_name

Gunther freeradius at caribsms.com
Thu Jun 8 23:22:02 CEST 2006


I am trying to rewrite the username (sql_user_name) to always add the realm
to the username. I am getting different 'User-Name' and 'Realm' from
different NAS units.
My db storage format is: user at domain
One unit is sending it in this way already (user at domain), the other unit
from a
different vendor can send the domain in the 'Realm' part:
User-Name = user
Realm = domain

How can I rewrite the User-Name that I always get it in my preferred db
format?

I tried:
sql_user_name = "%{%{Realm:+%{User-Name}@%{Realm}}:-%{User-Name}}"

But it seems that the conditional sh syntax :+ does not work, only :-
And I do not exactly know if this nested approach could work anyhow.

Any hints?





More information about the Freeradius-Users mailing list