Lower case - Solved
Michel Bulgado
michel at casa.co.cu
Wed Jun 10 17:53:42 CEST 2009
On Tue, 2009-06-09 at 16:09 -0700, Chris wrote:
> On Jun 9, 2009, at 3:52 PM, Ivan Kalik wrote:
>
> >> I migrated my freeradius version 1.1.3-1.4.el5 that came with CentOS
> >> 5.3 to version 2.1.6-2.
> >>
> >> I am looking for an option that I had in my previous configuration
> >> and
> >> does not find it on this new, maybe it is removed. the fact is that
> >> many
> >> of my users sometimes tend to write the username with the first
> >> letter
> >> in upper or miniscule.
> >
> > That works just for pap requests. Use lc perl function to rewrite
> > username/pass in perl module.
> >
> > Ivan Kalik
> > Kalik Informatika ISP
> >
> > -
> > List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>
> Here's what I'm using:
>
> perl_tolower.pm:
>
>
> use strict;
> use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);
> #
> # This the remapping of return values
> #
> use constant RLM_MODULE_REJECT=> 0;# /* immediately
> reject the request */
> use constant RLM_MODULE_FAIL=> 1;# /* module failed,
> don't reply */
> use constant RLM_MODULE_OK=> 2;# /* the module is
> OK, continue */
> use constant RLM_MODULE_HANDLED=> 3;# /* the module
> handled the request, so stop. */
> use constant RLM_MODULE_INVALID=> 4;# /* the module
> considers therequest invalid. */
> use constant RLM_MODULE_USERLOCK=> 5;# /* reject the
> request (useris locked out) */
> use constant RLM_MODULE_NOTFOUND=> 6;# /* user not found
> */
> use constant RLM_MODULE_NOOP=> 7;# /* module succeeded
> withoutdoing anything */
> use constant RLM_MODULE_UPDATED=> 8;# /* OK (pairs
> modified) */
> use constant RLM_MODULE_NUMCODES=> 9;# /* How many
> return codes there are */
>
> sub authorize {
> $RAD_REQUEST{'User-Name'} = lc($RAD_REQUEST{'User-Name'});
> return RLM_MODULE_OK;
> }
>
> sub preacct {
> $RAD_REQUEST{'User-Name'} = lc($RAD_REQUEST{'User-Name'});
> return RLM_MODULE_OK;
> }
>
> sub xlat {
> return RLM_MODULE_OK;
> }
>
> radiusd.conf:
>
> modules {
> perl {
> module = /usr/local/etc/raddb/perl/perl_tolower.pm
> }
> ...
> }
>
> Enable perl modules in authorize and preacct. I think order matters
> here, so you probably want them near the top...
>
> sites-enabled/default:
>
> authorize {
> perl
> }
>
> preacct {
> perl
> }
Thanks Chris
I solved the problem with users who write their login in uppercase and
lower case
Michel
More information about the Freeradius-Users
mailing list