[RADIATOR] [RFC] configurable hooks

Heikki Vatiainen hvn at open.com.au
Thu Feb 7 09:13:20 CST 2013


On 02/05/2013 08:39 PM, Alexander Hartmaier wrote:

> I've looked into it today and have some questions:
> - is it safe to assume that the list or arguments passed to the
> ChallengeHook in my case is always ($self, $user, $p, $context)?
> If one arg is missing my added arguments would shift and populate the
> wrong variables. I was thinking about passing them by name in a hashref
> as first instead of last argument instead.

Passing your arguments first would certainly work and would guard
against the problems that might come if arguments were added or removed
from ChallengeHook.

I'd say it's a good idea to put your own arguments first.

> - is it safe to die in hook code or will that tear down the Radiator
> process? I'm asking because that's the preferred way of doing argument
> validation, e.g.
> die 'id missing'
>     unless defined $id;

It should be safe since hooks are run within eval block and if there are
errors, they are caught and ERR with 'Error in $hookname...' is logged.

> Another note, I've used %D instead of the hardcoded path which works
> just as well:
> 
> StartupHook sub { require "%D/MyHooks.pm"; }

Based on your other messages, there were issues with this which were
then solved. Is everything working for you now?

Thanks,
Heikki

-- 
Heikki Vatiainen <hvn at open.com.au>

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS,
NetWare etc.


More information about the radiator mailing list