[RADIATOR] [RFC] configurable hooks

Mike McCauley mikem at open.com.au
Thu Feb 7 15:19:34 CST 2013


Hello,

On Thursday, February 07, 2013 04:29:56 PM Alexander Hartmaier wrote:
> On 2013-02-07 16:13, Heikki Vatiainen wrote:
> > 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.
> 
> Will do that, thanks!
> 
> >> - 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.
> 
> Is that documented somewhere? Couldn't find it the docs.

The documentation of hook processing has been enlarged to cover this and other 
topics in the Reference manual for the next release.

Thanks.

Cheers.

> 
> >> 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
> 
> %D doesn't work, but my problem arised when I changed the StartupHook
> from a single line to multiple lines without terminating them with \.
> Works now but it would be great if Radiator logged such an error.
> 
> Cheers, Alex
> 
> 
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"
> * T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
> Handelsgericht Wien, FN 79340b
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"
> * Notice: This e-mail contains information that is confidential and may be
> privileged. If you are not the intended recipient, please notify the sender
> and then delete this e-mail immediately.
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"
> * _______________________________________________
> radiator mailing list
> radiator at open.com.au
> http://www.open.com.au/mailman/listinfo/radiator
-- 
Mike McCauley                               mikem at open.com.au
Open System Consultants Pty. Ltd
9 Bulbul Place Currumbin Waters QLD 4223 Australia   http://www.open.com.au
Phone +61 7 5598-7474                       Fax   +61 7 5598-7070

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