(RADIATOR) Attributes that I change in 1 handler, has changed value in another handler
Hugh Irvine
hugh at open.com.au
Tue Jul 17 18:32:32 CDT 2007
Hello Giovanni -
If you run radiusd with trace 5 you will see the full hex dumps of
the incoming RADIUS requests, together with the decoded packet.
And yes, the best way to understand how Radiator works is to first of
all read the RADIUS RFC's ("doc/rfc2865.txt" and "doc/rfc2866.txt"),
then read the code in "radiusd" itself, then "Radius/Client.pm", then
"Radius/Handler.pm", then "Radius/AuthGeneric.pm". You should also
read "Radius/RDict.pm", "Radius/AttrVal.pm" and "Radius/
Configurable.pm" as well as "Radius/Radius.pm".
hope that helps
regards
Hugh
On 17 Jul 2007, at 23:47, gdelvalle at btl.net wrote:
> Thanks Hugh,
> I have a quick follow up question. Where can i see the general
> structure of the Incoming request packet and the defined
> functions for this object? Should I go and have a look in
> the Radius.pm or is there a batter way?
>
> Thanks
>
>
> Giovanni
> ---------Included Message----------
>> Date: 16-Jul-2007 17:43:27 -0600
>> From: "Hugh Irvine" <hugh at open.com.au>
>> To: <gdelvalle at btl.net>
>> Cc: <radiator at open.com.au>
>> Subject: Re: (RADIATOR) Attributes that I change in 1 handler,
> has changed value in another handler
>>
>>
>> Hello Giovanni -
>>
>> You should use the changeUserName() routine for this
>>
>> ${$_[0]}->changeUserName($username);
>>
>> see the code in "Radius/Radius.pm->sub changeUserName()".
>>
>> regards
>>
>> Hugh
>>
>>
>> On 17 Jul 2007, at 00:10, gdelvalle at btl.net wrote:
>>
>>>
>>>
>>> Hello All,
>>> Here is my problem in a nutshell-
>>>
>>> I want to add/change an attribute in a prehandler hook (
>>> example- I want to strip a username joe at example.com and change
>>> it to joe at realm1.com). Then this should cause radiator to send
>>> that request to my Realm1.com handler. My assumption correct?
>>>
>>> problems I have -
>>> 1) when I change an attribute it looks like it only persists for
>>> the life of that subroutine that is the handler. I'd like when a
>>> preauthhandler picks up the request the change I made from the
>>> previous handler is still there. This is an excerpt from the
>>> subroutine that is to change the attribute.
>>> 2) If the changed attribute doesnt stick then it wont go to the
>>> right handler.
>>>
>>>
>>>
>>> $username = $username."\@Realm1.com";
>>> ${$_[0]}->change_attr('User-Name', $username);
>>>
>>> ###############################
>>> sub
>>> {
>>>
>>> # I used to use assign the reference to a local variable but i
>>> thought this would cause the change not to be present in the
>>> next handler. Atrue or false
>>> #my p = ${$_[0]};
>>>
>>> #if this isnt an access request we dont want to run the
>>> procedure any further
>>> my $code = ${$_[0]}->code();
>>> return unless $code eq 'Access-Request';
>>>
>>> my $nasaddress =
>>> ${$_[0]}->getAttrByNum($Radius::Radius::NAS_IP_ADDRESS);
>>> return unless $nasaddress eq '127.0.0.1';
>>>
>>> #Pulling some values from request structure that was passed
>>> to to sub routine as a reference.
>>>
>>> my $username =
>>> ${$_[0]}->getAttrByNum($Radius::Radius::USER_NAME);
>>> my $nasport =
> ${$_[0]}->getAttrByNum($Radius::Radius::NAS_PORT);
>>>
>>> my $timestamp = localtime time;
>>>
>>>
>>> $username = $username."\@Realm1.com";
>>> ${$_[0]}->change_attr('User-Name', $username);
>>>
>>> }
>>> ############################################
>>>
>>>
>>> Any Ideas.
>>>
>>> Regards,
>>> Giovanni
>>>
>>>
>>> --
>>> Archive at http://www.open.com.au/archives/radiator/
>>> Announcements on radiator-announce at open.com.au
>>> To unsubscribe, email 'majordomo at open.com.au' with
>>> 'unsubscribe radiator' in the body of the message.
>>
>>
>>
>> NB:
>>
>> Have you read the reference manual ("doc/ref.html")?
>> Have you searched the mailing list archive
> (www.open.com.au/archives/
>> radiator)?
>> Have you had a quick look on Google (www.google.com)?
>> Have you included a copy of your configuration file (no secrets),
>> together with a trace 4 debug showing what is happening?
>> Have you checked the RadiusExpert wiki:
>> http://www.open.com.au/wiki/index.php/Main_Page
>>
>> --
>> Radiator: the most portable, flexible and configurable RADIUS server
>> anywhere. Available on *NIX, *BSD, Windows, MacOS X.
>> Includes support for reliable RADIUS transport (RadSec),
>> and DIAMETER translation agent.
>> -
>> Nets: internetwork inventory and management - graphical, extensible,
>> flexible with hardware, software, platform and database
> independence.
>> -
>> CATool: Private Certificate Authority for Unix and Unix-like
> systems.
>>
>>
>>
>>
> ---------End of Included Message----------
>
NB:
Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive (www.open.com.au/archives/
radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?
Have you checked the RadiusExpert wiki:
http://www.open.com.au/wiki/index.php/Main_Page
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
Includes support for reliable RADIUS transport (RadSec),
and DIAMETER translation agent.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.
--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list