Mimic lower_user in FR2

Thor Spruyt thor.spruyt at telenet.be
Thu Sep 24 14:53:17 CEST 2009


Hi,

Since lower_user doesn't exist anymore in FR2, I was thinking of doing the following in FR2 to mimic the behaviour, which seems to be working correctly:

In "hints" file:

DEFAULT User-Name !~ /^$/
        User-Name := `%{exec:/opt/tolower %{User-Name}}`,
        Fall-Through = Yes

DEFAULT Stripped-User-Name !~ /^$/
        Stripped-User-Name := `%{exec:/opt/tolower %{Stripped-User-Name}}`,
        Fall-Through = Yes


Content of "/opt/tolower":

#!/bin/sh

echo -n "$1" | tr '[A-Z]' '[a-z]'


Is there any reason why I should not do this or why it's not recommended?
The servers on which I want to do this is not heavily loaded (<1req/s).

Regards,
Thor.






More information about the Freeradius-Users mailing list