(RADIATOR) Modifying User-Password in a hook function

Roy Badami roy.badami at globalgraphics.com
Fri Aug 27 11:15:42 CDT 2004


I'm want to modify the User-Password field in a hook function, before
proxying to another RADIUS server.  (For reasons not worth going into
I want to prefix a password with a letter 'p' if it doesn't already
begin with someone.)

I'm using the AuthHook reproduced below, called from an AuthBy
INTERNAL clause, and it seems to work fine, but I just wanted to check
if this was the correct way to modify the password.

sub
{
    my $p = $_[0];
    my $pass = $p->get_attr('User-Password');
    if (!($pass =~ /^p/)) {
        $pass = "p$pass";
        $p->changeAttrByNum($Radius::Radius::USER_PASSWORD, $pass);
        $p->{DecodedPassword} = $pass;
    }
    $pass =~ /^p\d{6,8}$/ ? $main::IGNORE : $main::REJECT;
}

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