Thread View: news.software.nntp
2 messages
2 total messages
Started by Szymon Sokół
Fri, 21 Jan 2005 11:28
perl_auth and perl_access vs. old nnrpperlauth
Author: Szymon Sokół
Date: Fri, 21 Jan 2005 11:28
Date: Fri, 21 Jan 2005 11:28
54 lines
4295 bytes
4295 bytes
I just upgraded my INN. It was a rather big jump - from 2.3.1 to 2.4.1.
Then I noticed that the good old nnrpdperlauth is gone and a new
mechanism, namely perl_auth and perl_access in readers.conf, is offered
instead. It took me some time to understand the documentation
(doc/hook-perl and the samples/nnrpd* scripts), and frankly, I am still
unsure if I understand it. The trouble is:
In the old nnrpdperlauth scheme, a script (usually that would be
bin/filter/nnrpd_auth.pl) was called every time someone connected or
authenticated to the nnrpd. There was a function authenticate() which
was called in both cases, and the value of $attributes{type} was used to
tell it whether it is "connect" or "authenticate" call. The return
value in both cases was a list composed of NNTP status code, read/post
status and the wildcard pattern for accessible groups. Thus, it was easy
to configure the server so that upon connection from some clients it
would grant access to groups, but from some other IPs a 480 code ("Auth
needed") would be issued instead, and only after the successful
authentication the access would be granted.
I tried to achieve the same using perl_auth and perl_access. I put the
following in my readers.conf:
auth "global" {
hosts: "*"
default: "anonymous_user"
perl_auth: "/usr/local/news/bin/nnrpd_auth.pl"
perl_access: "/usr/local/news/bin/nnrpd_access.pl"
}
then I tried to create nnrpd_auth.pl and nnrpd_access.pl that would do
what I wanted them to, and there I ran into the trouble. The single
authenticate() function is no more - instead, the perl_auth script
should provide an authenticate() function and perl_access script should
provide an access() function. However, the perl_auth script is called
only upon authentication, while perl_access is called immediately upon
connection and *there is no way of telling* (correct me if I am wrong!)
in the access() function that for this particular client IP authentication
is required. I can either grant permissions by including appropriate
values in the result hash (like read=>"*", post=>"*") or deny permission
by returning values like "!*", in which case following "group <groupname>"
commands will be answered with "411 No such group" and there is no
chance to change the permissions after authentication.
There must be a way of forcing users coming from "untrusted" IPs to
authenticate before granting them access to groups. But how? I certainly
do not want to list all those "trusted" IPs in the hosts: stanza - the
whole purpose of using nnrpd_access.pl is that the list is so long I
prefer to have it in the nnrp.access file, as it used to be. Any
suggestions?
--
Szymon Sokół (SS4004,SS316-RIPE) -- Network Manager B
Computer Center, University of Mining and Metallurgy, Cracow, Poland. O
http://2510053385/~szymon/ PGP key id: RSA: 0x61094A7D, DSS: 0xF9289982 F
Free speech includes the right not to listen, if not interested -- Heinlein H
Re: perl_auth and perl_access vs. old nnrpperlauth
Author: Szymon Sokół
Date: Fri, 21 Jan 2005 16:11
Date: Fri, 21 Jan 2005 16:11
17 lines
2271 bytes
2271 bytes
Szymon Sokół <szymon@bastard.operator.from.hell.pl> wrote: > I just upgraded my INN. It was a rather big jump - from 2.3.1 to 2.4.1. Update: after noticing the answer from Russ Allbery about 2.4.2 being the current version, I moved up to 2.4.2, but of course the problem was still there. Finally I decided to dump "perl_access" and use "res" in readers.conf instead, with a script reading nnrp.access and returning one of the names (like "readonly" or "readpost") that I can use as identity in normal, static "access" statements - fortunately I do not need too many of them, so it is acceptable solution. -- Szymon Sokół (SS4004,SS316-RIPE) -- Network Manager B Computer Center, University of Mining and Metallurgy, Cracow, Poland. O http://2510053385/~szymon/ PGP key id: RSA: 0x61094A7D, DSS: 0xF9289982 F Free speech includes the right not to listen, if not interested -- Heinlein H
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads