River Tarnell | 14 Feb 2012 21:54

nnrpd requires auth_init() for an auth hook, contrary to the documentation

Hi,

The documentation (doc/hook-perl) for nnrpd auth hook says:

	If a Perl function auth_init() is defined by that file, it is 
	called immediately after the file is loaded.

And later:

	Provided the file loads without errors, auth_init() (if present) 
	runs without fatal errors, and a Perl function authenticate() is 
	defined, authenticate() will then be called

This suggests that auth_init() is optional, but it actually isn't.  When 
it's not defined, the auth hook will fail:

200 isis.rt.uk.eu.org InterNetNews NNRP server INN 2.5.2 ready (posting ok)
authinfo user test
381 Enter password
authinfo pass test
400 Internal error (3).  Goodbye!

I'm not sure if this is a code or documentation error, but it seems more 
sensible to not require an auth_init function, as most hooks probably 
won't need it.

Regards,
--

-- 
        -- river.                      | Free Usenet: http://news.rt.uk.eu.org/
Non-Reciprocal Laws of Expectations:   | PGP: 2B9CE6F2
(Continue reading)

Julien ÉLIE | 12 Jun 2012 23:12
Favicon

Re: nnrpd requires auth_init() for an auth hook, contrary to the documentation

Hi River,

> The documentation (doc/hook-perl) for nnrpd auth hook says:
>
> 	If a Perl function auth_init() is defined by that file, it is
> 	called immediately after the file is loaded.
>
> And later:
>
> 	Provided the file loads without errors, auth_init() (if present)
> 	runs without fatal errors, and a Perl function authenticate() is
> 	defined, authenticate() will then be called
>
> This suggests that auth_init() is optional, but it actually isn't.  When
> it's not defined, the auth hook will fail:
>
> 200 isis.rt.uk.eu.org InterNetNews NNRP server INN 2.5.2 ready (posting ok)
> authinfo user test
> 381 Enter password
> authinfo pass test
> 400 Internal error (3).  Goodbye!
>
> I'm not sure if this is a code or documentation error, but it seems more
> sensible to not require an auth_init function, as most hooks probably
> won't need it.

You're totally right that a discrepancy exists between the code and its 
documentation.
auth_init() is now correctly optional.  Starting from INN 2.5.3.

(Continue reading)


Gmane