(RADIATOR) Can't set certain attributes from PostAuthHook

Hugh Irvine hugh at open.com.au
Sun Oct 14 20:40:24 CDT 2001


Hello Jo -

On Saturday 13 October 2001 20:43, needle-mls at world-online.no wrote:
> On Sat, Oct 13, 2001 at 01:18:30PM +1000, Hugh Irvine wrote:
> | Hello Jo -
> |
> | You really don't need a PostAuthHook to do this, just an AddToReply.
>
> I guess I had simplified the explanation of the PostAuthHook a little
> too much. :-) I do believe I need the PostAuthHook, because it not
> only authenticates the user, it checks whether the user should be
> assigned a static IP or not and acts on that, it verifies that the
> number the user is calling from isn't blacklisted, it sends log data
> to another sql backend, and I haven't even begun to talk about the
> future plans we have for this hook. :-)
> The hook works, it authenticates users, assigns static ip's if
> required, logs to the sql backend and everything is hunky dory except
> for the 3 attributes I can't set in the reply, no matter how hard I
> try.
>

You can do pretty much everything you describe above with the standard 
configuration file, however if you use a hook that's fine too.

If you want to add attributes in a PostAuthHook, you would do this:

sub
{
    my $p = ${$_[0]};
    my $rp = ${$_[1]};
    my $result = ${$_[2]};
 
    if ($result == $main::ACCEPT)
    {
        $rp->add_attr('Service-Type', 'Framed-User');
        $rp->add_attr('Framed-Protocol', 'PPP');
    }
    return;
}

BTW - you should be using the standard dictionary file supplied with Radiator 
(the file called 'dictionary' in the distribution). The attributes shown 
above must be defined in the dictionary (which is just a text file).

There are also some example hooks in the file called "goodies/hooks.txt" in 
the Radiator distribution.

regards

Hugh


-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
===
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