Thread View: news.software.nntp
9 messages
9 total messages
Started by Mateusz Viste
Sun, 31 May 2009 10:16
Implementation question
Author: Mateusz Viste
Date: Sun, 31 May 2009 10:16
Date: Sun, 31 May 2009 10:16
40 lines
2591 bytes
2591 bytes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there! I'm currently writing my own NNTP server, and I got my way to authentication now, which gave me an implementation problem I'm not sure how to deal with... Say, that my server is holding two groups: auth.test.test and noauth.test.test. The first one requires authentication to read articles, the second not. Now, I am posting (crossposting) an article to both of these groups, without being authenticated. The article's ID is <test@test123>. What shall be the response of the server? Should it accept the message for the group without required authentication, and silently drop it for the other one? Anyway, let's say that the article got his way to both groups. Later, I would like to read this article. I am connecting to the server (without any authentication) and I send the command "ARTICLE <test@test123>". What should be the server's answer? Best regards, Mateusz Viste - -- You'll find my public OpenPGP key at http://www.viste-family.net/mateusz/pub_key -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iQEcBAEBAgAGBQJKIlkHAAoJEC30Ty9xnkvbkIUH/3QztjaZTepMHxGGthHfGhnJ ITeVcGnwwHr/yYVyADE/KkCxAqSYmkYBswkqa+IZ7097A0IDK0w9UZeX44X9DNXZ FdtER0mB5B3DG+mVRQlY7xT3/YhgOlB054LwCKStiB6KeaAVFBGH58WsiES2uGHY 64fhcf0SlVRsCsAgOL5oULLWxwJuWAfR42G2FSgC7aqkS3hii39qiAU4wZHQk/+W Fcrd2aCjaxh7GByNxu9OFmJbycS6Hm4J31eH9uv+BQM69aekwi9VrJDQdb0E/N+2 x1bNDZGGmFLS5auOezbaBLDvCIX596oD8k0dRFPH26jcVOtPvd8EKqWMEoJM6u4= =E10A -----END PGP SIGNATURE-----
Re: Implementation question
Author: Julien ÉLIE
Date: Sun, 31 May 2009 12:15
Date: Sun, 31 May 2009 12:15
172 lines
6142 bytes
6142 bytes
Hi Mateusz,
> I'm currently writing my own NNTP server, and I got my way to authentication
> now, which gave me an implementation problem I'm not sure how to deal
> with...
Interesting questions.
I have an idea about how it should be done but well, better test it!
> Say, that my server is holding two groups: auth.test.test and
> noauth.test.test. The first one requires authentication to read articles,
> the second not.
>
> Now, I am posting (crossposting) an article to both of these groups, without
> being authenticated. The article's ID is <test@test123>.
> What shall be the response of the server?
441.
I assume you mean that you are authorized to *post* to noauth.test.test
and not auth.test.test. (?)
noauth.test.test == trigofacile.test
auth.test.test == trigofacile.test2
access "users" {
read: "*,!trigofacile.test2"
post: "trigofacile.test"
}
% telnet news.trigofacile.com 119
Trying 91.121.26.68...
Connected to news.trigofacile.com.
Escape character is '^]'.
200 news.trigofacile.com InterNetNews NNRP server INN 2.5.0 (20090521 prerelease) ready (posting ok)
CAPABILITIES
101 Capability list:
VERSION 2
IMPLEMENTATION INN 2.5.0 (20090521 prerelease)
AUTHINFO USER SASL
HDR
IHAVE
LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
NEWNEWS
OVER
POST
READER
SASL GSSAPI OTP PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5
STARTTLS
..
LIST ACTIVE trigo*
215 Newsgroups in form "group high low flags"
trigofacile.test 0000000218 0000000006 y
trigofacile.support 0000000013 0000000001 y
trigofacile.test.vide 0000000001 0000000002 y
trigofacile.alias 0000000000 0000000001 y
..
POST
340 Ok, recommended message-ID <gvtqlm$u9i$1@news.trigofacile.com>
From: =?ISO-8859-15?Q?Julien_=C9LIE?= <iulius@nom-de-mon-site.com.invalid>
Newsgroups: trigofacile.test,trigofacile.test2
Subject: test
Message-ID: <gvtqlm$u9i$1@news.trigofacile.com>
test
..
441 You are not allowed to post to trigofacile.test2
** Note that LIST ACTIVE does not return trigofacile.test2 (no reading permission).
Just to be sure, I also tried with IHAVE:
IHAVE <gvtqlm$u9i$1@news.trigofacile.com>
335 Send it; end with <CR-LF>.<CR-LF>
From: =?ISO-8859-15?Q?Julien_=C9LIE?= <iulius@nom-de-mon-site.com.invalid>
Newsgroups: trigofacile.test,trigofacile.test2
Subject: test
Message-ID: <gvtqlm$u9i$1@news.trigofacile.com>
Date: Sun, 31 May 2009 13:58:18 +0200
Path: test
test
..
437 You are not allowed to post to trigofacile.test2
That's pretty good!
> Should it accept the message for
> the group without required authentication, and silently drop it for the
> other one?
No! On no account should you do that. You have to reject the post.
You should not modify the Newsgroups: header. And you should not just
post it to one of the two groups.
The user has to check himself what's wrong (maybe he forgot to authenticate
and he will, so you should not silently drop his articles -- the user
has to know what happens to his article).
> Anyway, let's say that the article got his way to both groups. Later, I
> would like to read this article.
> I am connecting to the server (without any authentication) and I send the
> command "ARTICLE <test@test123>". What should be the server's answer?
As you could have seen it in noauth.test.test, you can display it.
ARTICLE will show it.
STAT <test@test123>
223 0 <test@test123> status
In case you had not access to noauth.test.test, it would have been different:
STAT <test@test123>
480 Read access denied for this article
I hope it is clear.
Oh, another thing for your implementation. For this second test, I had:
% telnet news.trigofacile.com 119
Trying 91.121.26.68...
Connected to news.trigofacile.com.
Escape character is '^]'.
200 news.trigofacile.com InterNetNews NNRP server INN 2.5.0 (20090521 prerelease) ready (no posting)
CAPABILITIES
101 Capability list:
VERSION 2
IMPLEMENTATION INN 2.5.0 (20090521 prerelease)
AUTHINFO USER SASL
HDR
LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
NEWNEWS
OVER
READER
SASL GSSAPI OTP PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5
STARTTLS
..
Note that the initial greeting is 200 with the comment "no posting" whereas
it was 200 with the comment "posting ok" the first time.
So the initial greeting is *not* as simple as:
IF WriteAccess = 1 THEN
PRINT "200 " + Banner + CRLF; ' Write access ok
ELSE
PRINT "201 " + Banner + CRLF; ' Write access not ok
END IF
We have put in INN the 200 answer for
(the user can post)
OR
[(the user can authenticate) AND (one authentication block for him will
allow postings)].
--
Julien ÉLIE
« Le meilleur moyen de faire tourner la tête à une femme,
c'est de lui dire qu'elle a un joli profil. » (Sacha Guitry)
Re: Implementation question
Author: Mateusz Viste
Date: Sun, 31 May 2009 17:33
Date: Sun, 31 May 2009 17:33
77 lines
3765 bytes
3765 bytes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 31 May 2009 14:15, Julien ÉLIE wrote: > I assume you mean that you are authorized to *post* to noauth.test.test > and not auth.test.test. (?) Yes, of course :) > No! On no account should you do that. You have to reject the post. > You should not modify the Newsgroups: header. And you should not just > post it to one of the two groups. > The user has to check himself what's wrong (maybe he forgot to > authenticate and he will, so you should not silently drop his articles -- > the user has to know what happens to his article). Okay, that's what I though as well. But wasn't sure wheter it's really "how big players do" :-) > As you could have seen it in noauth.test.test, you can display it. > ARTICLE will show it. > > STAT <test@test123> > 223 0 <test@test123> status > > In case you had not access to noauth.test.test, it would have been > different: > > STAT <test@test123> > 480 Read access denied for this article 'kay. So the rule would be "we allow to retrieve the article without authentication if it has been posted to at least one group which doesn't require authentication". Seems logic to me :) > Oh, another thing for your implementation. For this second test, I had: > (...) > Note that the initial greeting is 200 with the comment "no posting" > whereas it was 200 with the comment "posting ok" the first time. > So the initial greeting is *not* as simple as: > > IF WriteAccess = 1 THEN > PRINT "200 " + Banner + CRLF; ' Write access ok > ELSE > PRINT "201 " + Banner + CRLF; ' Write access not ok > END IF > > We have put in INN the 200 answer for > (the user can post) > OR > [(the user can authenticate) AND (one authentication block for him will > allow postings)]. Ah, then I do not understand there... My WriteAccess variable takes "1" if the whole server is not in read-only mode. Are you saying that I should use a greeting with 201 when the server is not write-protected, but no group allows posting? Best regards, Mateusz Viste - -- You'll find my public OpenPGP key at http://www.viste-family.net/mateusz/pub_key -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iQEcBAEBAgAGBQJKIr9TAAoJEC30Ty9xnkvbYYQH+wb2PMaBBwawvrO3ZaclCNuM Cbpi3Mtrqm1eQIDPtOmDlJPHtf/IWD7Zgl7wErd09uMiLTLChEx21QrEPfjFEpyk R67V6atC0cqP+9s/skl+GvSeSvRL93gWUwWaoxdhEEIa+LJlxUXTVXsxzZTBZOQs PFeA+2FYtXz+UoVXZbfCCv9g8gIh8zwSFn0YLYMn3ZMA0cJCImQ9+1owp6EZhYcc z6XNiYLU+31/6uvaycJZrFHZBXiljWb6FoeAfeHPWhIRylT4VkucsmzY6x+iJ15K lk+NnMpNA05pTFPINkMf5TgzfSezGEyYkTQo6DIh6rJEFn5sj5H+TKePII1zNuE= =XYMC -----END PGP SIGNATURE-----
Re: Implementation question
Author: Julien ÉLIE
Date: Sun, 31 May 2009 17:55
Date: Sun, 31 May 2009 17:55
51 lines
3218 bytes
3218 bytes
Hi Mateusz, >> STAT <test@test123> >> 480 Read access denied for this article > > 'kay. So the rule would be "we allow to retrieve the article without > authentication if it has been posted to at least one group which doesn't > require authentication". Seems logic to me :) Not exactly. The rule about retrieval is not related to how the article was posted. When someone posts, you check if he has posting rights on every newsgroup. When someone retrieves an article, you check if he has reading rights on at least one of the newsgroups. Well, better be clear. I assume it was exactly what you intented to do but the way it was formulated was ambiguous. >> We have put in INN the 200 answer for >> (the user can post) >> OR >> [(the user can authenticate) AND (one authentication block for him will >> allow postings)]. > > Ah, then I do not understand there... > > My WriteAccess variable takes "1" if the whole server is not in read-only > mode. > > Are you saying that I should use a greeting with 201 when the server is not > write-protected, but no group allows posting? Yes of course. If a user can NEVER post, EVEN AFTER AN AUTHENTICATION, then it is 201. 200 is for a user who can post, possibly after having authenticated. (The POST capability will show him when he can.) He might also have to use an encrypted connection (via STARTTLS) in order to be able to post. Note that you could send 201 to a user and 200 to another. But maybe you do not plan to use such different cases in BasicNews (selection of rights according to IP, encryption, logging, dynamically after each command, etc.). So the logic behind your 200/201 may be easier :) -- Julien ÉLIE « Le vrai danger, ce n'est pas quand les ordinateurs penseront comme les hommes, c'est quand les hommes penseront comme les ordinateurs. »
Re: Implementation question
Author: Antti-Juhani Kaijanaho
Date: Sun, 31 May 2009 20:46
Date: Sun, 31 May 2009 20:46
11 lines
1457 bytes
1457 bytes
Julien ÉLIE kirjoitti: > If a user can NEVER post, EVEN AFTER AN AUTHENTICATION, > then > it is 201. > 200 is for a user who can post, possibly after having authenticated. Can you point me to chapter and verse on that? I've been wondering about that recently. -- Mr. Antti-Juhani Kaijanaho, Jyväskylä, Finland
Re: Implementation question
Author: Antti-Juhani Kaijanaho
Date: Sun, 31 May 2009 20:51
Date: Sun, 31 May 2009 20:51
34 lines
2524 bytes
2524 bytes
Mateusz Viste kirjoitti: > Say, that my server is holding two groups: auth.test.test and > noauth.test.test. The first one requires authentication to read articles, > the second not. > > Now, I am posting (crossposting) an article to both of these groups, without > being authenticated. The article's ID is <test@test123>. > What shall be the response of the server? Should it accept the message for > the group without required authentication, and silently drop it for the > other one? As Julien said, you either accept it to all, or you reject it. Although - there is no protocol reason why you could not allow anonymous posting to a reading-restricted group. It's just a bad policy, I think. I was thinking about the same problem recently, while adding reading authorization support to Alue. The simplest rule I came up with (and implemented) was - never allow crossposting between restricted and unrestricted groups. Anything else opens lots of cans of worms. > Anyway, let's say that the article got his way to both groups. Later, I > would like to read this article. > I am connecting to the server (without any authentication) and I send the > command "ARTICLE <test@test123>". What should be the server's answer? I'd probably add code to make such articles disappear should they be found in the spool :) Is your NNTP server going to have a transit component, or is it strictly local groups? -- Mr. Antti-Juhani Kaijanaho, Jyväskylä, Finland
Re: Implementation question
Author: Julien ÉLIE
Date: Sun, 31 May 2009 21:07
Date: Sun, 31 May 2009 21:07
60 lines
3728 bytes
3728 bytes
Hi Antti-Juhani,
>> If a user can NEVER post, EVEN AFTER AN AUTHENTICATION, then it is 201.
>> 200 is for a user who can post, possibly after having authenticated.
>
> Can you point me to chapter and verse on that? I've been wondering about that recently.
Yep. That's a tricky part in RFC 3977.
The note is not very explicit (but intents to mean that if 201 is sent
to a client, it can wrongly believe that he will never be able to post
and, therefore, may not offer its users to post -- that is why 200
is to be sent if posting may be allowed later).
And it is shown in one of the following examples. I admit one should
be very attentive to RFC 3977 so as to understand 200/201!
(I also understood it the wrong way, until Russ explained it to me!)
5.1. Initial Connection
5.1.2. Description
There is no command presented by the client upon initial connection
to the server. The server MUST present an appropriate response code
as a greeting to the client. This response informs the client
whether service is available and whether the client is permitted to
post.
If the server will accept further commands from the client including
POST, the server MUST present a 200 greeting code. If the server
will accept further commands from the client, but the client is not
authorized to post articles using the POST command, the server MUST
present a 201 greeting code.
Note: the distinction between the 200 and 201 response codes has
turned out in practice to be insufficient; for example, some servers
do not allow posting until the client has authenticated, while other
clients assume that a 201 response means that posting will never be
possible even after authentication. Therefore, clients SHOULD use
the CAPABILITIES command (Section 5.2) rather than rely on this
response.
5.3.3. Examples
[C] MODE READER
[S] 200 Reader mode, posting permitted
[C] CAPABILITIES
[S] 101 Capability list:
[S] VERSION 2
[S] READER
[S] NEWNEWS
[S] LIST ACTIVE NEWSGROUPS
[S] STARTTLS
[S] .
--
Julien ÉLIE
« Ad iura renunciata, non datur regressus. »
Re: Implementation question
Author: Mateusz Viste
Date: Sun, 31 May 2009 21:36
Date: Sun, 31 May 2009 21:36
47 lines
3101 bytes
3101 bytes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 31 May 2009 22:51, Antti-Juhani Kaijanaho wrote: > As Julien said, you either accept it to all, or you reject it. Yep, that's absolutely clear to me now :) > Is your NNTP server going to have a transit component, or is it strictly > local groups? Nope, I do not plan any transit mode. In fact, I am writting BasicNews (that's the name of my server) because I was searching for a quite long time after a NNTP server which would allow to create local groups in an easy way, without any configuration hassle, without the need to install a bloated database engine, nor any required maintenance. I didn't found any... Or maybe I missed the good ones :) Besides that, I'm wondering about creating a HTTP interface to BasicNews, as I can't find any good NNTP -> HTTP gateway, which would support authentication... So I'll maybe reuse some code from my web server (www.grumpy-server.net). So far, testing BasicNews gives me a hard time, as I noticed that *most* NNTP clients are buggy, in a way or another. I am testing BasicNews against various clients, like KNode, PAN, Slrn, Outlook, LeafNode and some PHP gateways (NNTP -> WEB), and so far, I see only bugs and bad implementations, or bad behaviors of clients in some situations... So the first question I have to answer most of the time is "is it a bug on the server or on the client?" :-D Best regards, Mateusz Viste - -- You'll find my public OpenPGP key at http://www.viste-family.net/mateusz/pub_key -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iQEcBAEBAgAGBQJKIvhxAAoJEC30Ty9xnkvbT4sIAIoB2/OSrqELGeilOX1EP0zl VC88jFPN4c9MzBxAE9XNvA9zceu49nGSXMJnLdY7u4IK+ew2WBsF8tklq3jvLpQm srDOh2c6Iotis/YTlSQbGehIEtSMXALIrketWayWDPBlPglRnQsKZ8UtFBP8dQ2M HvxdIAVpEUkhh4B1+fYCC1Q8TOvIzy9KVi5mw+g1dvJW74ybtvnJWnFNR++JIOPY zB80Ol2Y1QQKdDhojtQxBiQ8bR9lXvGHIkSIoCuktKI0bgrk/ZFnkYG1oIass1uV 5xjn3UkEBpII2u31lYRlvYl2trMs7yWsd/6gZd+5MsFH8Vkhsmt9umrOsYM0/EY= =owLC -----END PGP SIGNATURE-----
Re: Implementation question
Author: Antti-Juhani Kaijanaho
Date: Mon, 01 Jun 2009 06:53
Date: Mon, 01 Jun 2009 06:53
17 lines
1754 bytes
1754 bytes
Mateusz Viste kirjoitti: > In fact, I am writting BasicNews > (that's the name of my server) because I was searching for a quite long > time after a NNTP server which would allow to create local groups in an > easy way, without any configuration hassle, without the need to install a > bloated database engine, nor any required maintenance. > I didn't found any... Or maybe I missed the good ones :) > > Besides that, I'm wondering about creating a HTTP interface to BasicNews, as > I can't find any good NNTP -> HTTP gateway, which would support > authentication... Sounds a bit like my Alue :) Similar (but not quite identical) goals, at least. -- Mr. Antti-Juhani Kaijanaho, Jyväskylä, Finland
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