Lower case to Upper case in Calling-Station-Id at policy.conf

Hilton Guaraldi guaraldi at gmail.com
Mon Sep 21 00:21:17 CEST 2009


Well,

I guess this is not the correct workaround, but, I did:

1- In policy.conf a function mac-phase which returns MAC with hyphens.
As soon as possible I will do this in example.pl file...

2- In example.pl a small sintaxe to UPPER case the Calling-Station-Id like this,
$RAD_REQUEST{'Calling-Station-Id'} =
uc($RAD_REQUEST{'Calling-Station-Id'}); in the sub authorize and sub
preacct.

3- I commented the line 30 of example.pl, i.e., #use Data::Dumper; no
more problems with my perl installation. Here I doubt of the
effects...

4- I inserted in MySQL radcheck table the MAC 00-18-E7-41-AD-C2 for
user guaraldi like this:
    guaraldi      Calling-Station-Id     ==  00-18-E7-41-AD-C2

5- I inserted the mac-phase function and the perl module in authorize
section at the beginning like this:

authorize {
                mac-phase
                perl
                ...
                sql
                ...
              }

6- I inserted the perl module in preacct section after preprocess line
like this:

preacct {
             preprocess
             perl
             ...
            }

7- I did chmod 0770 example.pl . Here I guess it is not necessary...But I did...

8- Running radiusd -X give  me no problem... Radiusd UP!

9- XP client authentication with EAP-PEAP with login guaraldi,
password 123mudar and MAC 0018e741adc2 from AP2,...,AP6 or
00-18-E7-41-AD-C2 from AP1  done!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
All of my AP's working....

10- Cheers :-)

Hilton Guaraldi
IPRJ/UERJ - http://www.iprj.uerj.br
LABTRAN




2009/9/19 Hilton Guaraldi <guaraldi at gmail.com>:
> Hi,
> It´s me again...
> I updated to 2.1.6.
>
> Example.pl with $RAD_REQUEST{'Calling-Station-Id'} =
> uc($RAD_REQUEST{'Calling-Station-Id'}); line in sub authorize.
> Perl module under authorize in default file like this:
>
> authorize {
>       preprocess
>       ...
>       sql
>       ...
>       perl        ---->  After SQL?
>       ...
> }
>
> When I start the command radiusd -X a new problem again.....   :-(
> I guess I am getting crazy :-), but I have a lot of patience...
>
> Can't load '/usr/lib/perl5/5.10.0/i586-linux-thread-multi/auto/Data/Dumper/Dumper.so'
> for module Data::Dumper:
> /usr/lib/perl5/5.10.0/i586-linux-thread-multi/auto/Data/Dumper/Dumper.so:
> undefined symbol: Perl_sv_cmp at
> /usr/lib/perl5/5.10.0/i586-linux-thread-multi/XSLoader.pm line 64.
>  at /usr/lib/perl5/5.10.0/i586-linux-thread-multi/Data/Dumper.pm line 36
> Compilation failed in require at /etc/raddb/example.pl line 30.
> BEGIN failed--compilation aborted at /etc/raddb/example.pl line 30.
> rlm_perl: perl_parse failed: /etc/raddb/example.pl not found or has
> syntax errors.
> /etc/raddb/modules/perl[7]: Instantiation failed for module "perl"
> /etc/raddb/sites-enabled/default[187]: Failed to find module "perl".
> /etc/raddb/sites-enabled/default[62]: Errors parsing authorize section.
> Errors initializing modules
>
>
> A little piece of example.pl with line 30...
>
> use strict;
> # use ...
> # This is very important ! Without this script will not get the filled
> hashesh from main.
> use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);
>
> use Data::Dumper;             <------------ Here is the line 30...
>
> # This is hash wich hold original request from radius
> #my %RAD_REQUEST;
> # In this hash you add values that will be returned to NAS.
> #my %RAD_REPLY;
> #This is for check items
> #my %RAD_CHECK;
>
>
> How can I resolve this new problem?
>
> Guaraldi
>
>
>
> 2009/9/18 Ivan Kalik <tnt at kalik.net>:
>> You should upgrade to current version. Many improvements were made to perl
>> module since 2.1.1.
>>
>> You can add perl to modules directory in 2.1.1. You have example on the wiki:
>>
>> http://wiki.freeradius.org/Rlm_perl
>>
>> Ivan Kalik
>> Kalik Informatika ISP
>>
>>> Thanks Saraev,
>>> Again, a new problem emerged...     :-(
>>>
>>> In /etc/raddb/modules I do not see perl module...    :-(
>>>
>>> I am running opensuse 11.1 and freeradius 2.1.1-1.27 from opensuse
>>> repository.
>>>
>>> Is there a way to get this problem solved, i.e. , perl module missing
>>> in modules subdirectory?
>>> Is there a way to supply it?
>>>
>>> Guaraldi
>>>
>>>
>>> 2009/9/18 Stefan Saraev <seo at link.bg>:
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> that _should_ work for you:
>>>>
>>>> - -- cut --
>>>> use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);
>>>> sub authorize {
>>>>   $RAD_REQUEST{'Calling-Station-Id'} =
>>>> uc($RAD_REQUEST{'Calling-Station-Id'});
>>>> }
>>>>
>>>> sub preacct {
>>>>   $RAD_REQUEST{'Calling-Station-Id'} =
>>>> uc($RAD_REQUEST{'Calling-Station-Id'});
>>>> }
>>>> - -- cut --
>>>>
>>>> and add "perl" in preacct { } section after preprocess in radiusd.conf
>>>>
>>>>
>>>> - -----------------
>>>> Regards
>>>> Stefan Saraev
>>>> Link+ Ltd.
>>>> +359 899 19 15 34
>>>>
>>>>
>>>>
>>>> - ----- Original Message -----
>>>> From: Hilton Guaraldi
>>>> [mailto:guaraldi at gmail.com]
>>>> To: FreeRadius users mailing list
>>>> [mailto:freeradius-users at lists.freeradius.org]
>>>> Sent: Fri, 18 Sep 2009
>>>> 20:12:34 +0300
>>>> Subject: Re: Lower case to Upper case in Calling-Station-Id
>>>> at policy.conf
>>>>
>>>> -----BEGIN PGP SIGNATURE-----
>>>> Version: GnuPG v1.4.9 (GNU/Linux)
>>>>
>>>> iEYEARECAAYFAkqz14AACgkQRAN48r0+OnqSKQCghcDigoyUZFXMTvsLDFJ6lMMg
>>>> +fwAoIyDW+Ik5UVhoGih0AOIHOGqZBrv
>>>> =2IlH
>>>> -----END PGP SIGNATURE-----
>>>>
>>>>
>>>>> Ok...
>>>>>
>>>>> I tried $RAD_REQUEST{'Calling-Station-Id'} =
>>>>> uc($RAD_REQUEST{'Calling-Station-Id'}).
>>>>> I guess in the sub authorize of example.pl ..............The only file
>>>>> I saw sub authorize in...
>>>>> If I am wrong, please help me what is the correct file!
>>>>>
>>>>> Running radiusd -X nothing happens in MAC address. If it is
>>>>> 00-18-e7-41-ad-c2, it remains the same, not 00-18-E7-41-AD-C2, :-(
>>>>>
>>>>> Must I "include" example.pl to radius in order to do
>>>>> $RAD_REQUEST{'Calling-Station-Id'} =
>>>>> uc($RAD_REQUEST{'Calling-Station-Id'}) work?
>>>>>
>>>>> Guaraldi
>>>>>
>>>>>
>>>>> 2009/9/18 Alexander Clouter <alex at digriz.org.uk>:
>>>>> > Hi,
>>>>> >
>>>>> > Hilton Guaraldi <guaraldi at gmail.com> wrote:
>>>>> >>
>>>>> >> How can I use uc function below in order to change lower case to
>>>>> upper
>>>>> case?
>>>>> >>
>>>>> >> Ex. 00-18-e7-41-ad-c2    --->  00-18-E7-41-AD-C2
>>>>> >>
>>>>> >> In the policy.conf:
>>>>> >>
>>>>> > When I last nosied through the source code there is no way.  I
>>>>> normally
>>>>> > make sure all the polies are case insensitive *in* FreeRADIUS and
>>>>> when
>>>>> > things get spat out to my SQL server I slip 'lower(...)' around the
>>>>> MAC
>>>>> > addresses going in that direction.
>>>>> >
>>>>> > The only other way is to have a Perl script doing the work for you,
>>>>> but
>>>>> > as you can use case insensitive regex to replace string matching, I
>>>>> > would say it is not worth it.
>>>>> >
>>>>> > Cheers
>>>>> >
>>>>> > --
>>>>> > Alexander Clouter
>>>>> > .sigmonster says: Idleness is the holiday of fools.
>>>>> >
>>>>> > -
>>>>> > List info/subscribe/unsubscribe? See
>>>>> http://www.freeradius.org/list/users.html
>>>>> >
>>>>> -
>>>>> List info/subscribe/unsubscribe? See
>>>>> http://www.freeradius.org/list/users.html
>>>>>
>>>>
>>>> -
>>>> List info/subscribe/unsubscribe? See
>>>> http://www.freeradius.org/list/users.html
>>>>
>>>
>>
>>
>>
>




More information about the Freeradius-Users mailing list