🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #48825

Re: Authenticating with perl hooks

#48825
From: Tim Pennick
Date: Fri, 20 Oct 2000 00:00
81 lines
4587 bytes
On 19 Oct 2000 11:54:08 -0700, Russ Allbery <rra@stanford.edu> wrote:
>Tim Pennick <tpennick@extra.axion.bt.co.uk> writes:
>
>> Sorry Russ, I AM using 2.3.
>
>Ah!  Then in that case this should be easier.
>
>> Maybe its the references to nnrp.access that threw you of the scent.
>
>Yup.
>
>> This is the file that the example nnrpd_auth.pl file uses, and so I have
>> re-instated it, as (if I understand correctly), readers.conf is disabled
>> when you switch on NNRP_PERLAUTH in inn.conf.
>
>Nothing looks at nnrp.access in 2.3 no matter what you do.
>
>I believe that if you turn in nnrpperlauth, your Perl authentication stuff
>is the *only* thing that's used.  That means that any IP-based
>restrictions or the like you need to handle in your authenticate function.

The example nnrpd_auth.pl file which I've been using, and which I thought came
with inn-2.3.0, explicitly opens two files, an nnrp.access file and a
users.cdb file, so I thought this was as good a strategy as any to follow.  If
you do an authenticate with 'connect', the nnrp.access file is checked, and if
you do an authenticate with type attribute set to 'authenticate' then the
users.cdb file is read.

My plan is that most newsgroups will match one of the patterns listed in
nnrp.access and will be available following the first run uf 'authenticate'.
However if the user then tries to access a group that isn't matched by any of
the entries in this file, the attempt will cause nnrpd to call authenticate
again with the 'authenticate' attribute type.  Users.cdb will contain user,
password and access list information.

HOwever, all this is jumping the gun a bit.

>I don't use the nnrp Perl authentication stuff, so I could be wrong, but
>that was my understanding.
>
>> Whatever happens within the 'authenticate' function, (assuming perl
>> authentication is switched on and readers.conf is therefore ignored) if
>> the authenticate function responds with "200 1 1 * 0" to a call which
>> passed the 'connect' rather than 'authenticate' type attribute, the
>> client should have full access to the groups carried by the server.
>
>That's correct.
>
>> I can't get this bit working as no groups are visible at all.
>
>Okay, I can't see what could possibly be going wrong here.  Could you post
>this section of your authenticate sub?
I've tried cutting it down to the bare minimum:
The following two lines are the first lines in the 'authenticate' sub.

@results = ("200","1","1","*","0");
return @results;

This returns a code 200 to the client, with a posting OK message, but sending
'list active' yields no newsgroups, although if I switch off nnrp_perlauth in
inn.conf, "list active" retrieves my active file.

I've been having a look at the code in .../inn-2.3.0/nnrpd/perl.c and
.../nnrpd.c, and it looks as though there isn't a direct relationship between
what my authenticate function returns as the first element of its returned
array, and the code the server sends the client, but this might be a red
herring.

I wonder if anyone else is using perl authentication with INN2.3.0, and if so,
whether they could post (or send me) an example of how they got it to work.  I
was trying to use this method because I thought it would be a smipler way to
maintain the access lists, than using readers.conf.  If there's a better way
of doing it, I'd be extatic to hear it.

Regards to all,

Tim Pennick
>-- 
>Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

Technical Details
Message-ID: <slrn8v0s0m.6hr.tpennick@extra.axion.bt.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <slrn8uouuj.5vv.tpennick@extra.axion.bt.co.uk> <yl1yxfxtym.fsf@windlord.stanford.edu> <slrn8uriqb.5to.tpennick@extra.axion.bt.co.uk> <ylem1em3jk.fsf@windlord.stanford.edu> <slrn8uu2r6.405.tpennick@extra.axion.bt.co.uk> <ylr95cpsq7.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <slrn8v0s0m.6hr.tpennick@extra.axion.bt.co.uk>
Subject: Re: Authenticating with perl hooks
Date: Fri, 20 Oct 2000 00:00:00 +0000
From: tpennick@extra.axion.bt.co.uk (Tim Pennick)
References: <slrn8uouuj.5vv.tpennick@extra.axion.bt.co.uk> <yl1yxfxtym.fsf@windlord.stanford.edu> <slrn8uriqb.5to.tpennick@extra.axion.bt.co.uk> <ylem1em3jk.fsf@windlord.stanford.edu> <slrn8uu2r6.405.tpennick@extra.axion.bt.co.uk> <ylr95cpsq7.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 683842961
X-Complaints-To: postmaster@axion.bt.co.uk
X-Trace: news2.axion.bt.co.uk 972058369 18678 132.146.88.22 (20 Oct 2000 16:12:49 GMT)
Organization: BT
User-Agent: slrn/0.9.6.3 (SunOS)
Reply-To: Tim Pennick <tpennick@axion.bt.co.uk>
NNTP-Posting-Date: Fri, 20 Oct 2000 16:12:49 +0000 (UTC)
Newsgroups: news.software.nntp