I'm seeing a problem with stripping usernames during accounting.

Accounting is done on a separate physical server from the authentication (which works fine).

Most of our users don't include a domain so their accounting works normally. Some users do send the domain (UOB) and this breaks the accounting because the backslash doesn't seem to get escaped.

The account detail files have entries like User-Name = "UOB\\username" but when this gets inserted into the database the backslash(es) are not escaped and if the username starts with n, r or some other letters, the database sees \n, \r and inserts linebreaks and other undesirable characters.

Then selecting from the database to generate statistics returns garbage, obviously.

At the top of dialup.conf I replaced sql_user_name = "%{User-Name}" with sql_user_name = "%{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}" but Stripped-User-Name does not have a value.

I'm not interested in the domain in my accounting, so does anyone have any guidance on how to safely strip/sanitise the usernames?

Thanks,
Jonathan

--
----------------------------
Jonathan Gazeley
Systems Support Specialist
ResNet | Wireless&  VPN Team
Information Services
University of Bristol
----------------------------

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to