Forcing lowercase User-Name with rlm_perl
Krzysztof Olędzki
krzysztof.oledzki at axelspringer.pl
Sat May 17 15:31:56 CEST 2008
On 2008-05-17 02:09, Chris wrote:
> I basically want User-Name to be forced to lowercase for the duration
> of the request.
>
> I have done the following:
>
> modules {
> perl {
> module = my_perl_module.pm
> }
> }
>
> authorize {
> preprocess
> perl
> ...
> }
>
> Pertinent contents of my_perl_module.pm:
>
> sub authorize {
> $RAD_REQUEST{'User-Name'} =~ tr/A-Z/a-z/;
> return RLM_MODULE_OK;
> }
>
>
> This seems to do what I want. Is it the correct way to accomplish
> this task?
lc EXPR
lc Returns a lowercased version of EXPR. This is the internal
function implementing the "\L" escape in double-quoted strings.
Respects current LC_CTYPE locale if "use locale" in force. See
perllocale and perlunicode for more details about locale and
Unicode support.
If EXPR is omitted, uses $_.
Best regards,
Krzysztof Olędzki
More information about the Freeradius-Users
mailing list