(RADIATOR) Attributes that I change in 1 handler, has changed value in another handler

Hugh Irvine hugh at open.com.au
Mon Jul 16 18:34:15 CDT 2007


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.


--
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