🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Julien ÉLIE Wed, 24 Dec 2008 11:28
Initial greeting on mode-switching servers
#79928
Author: Julien ÉLIE
Date: Wed, 24 Dec 2008 11:28
33 lines
2551 bytes
Hi,

According to RFC 3977, section 5.1.2, for the initial greeting:

   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.

According to RFC 3977, section 5.3.2, for the response to MODE READER:

   If the server is mode-switching, it switches from is transit mode to
   its reader mode, indicating this by changing the capability list
   accordingly.  It MUST then return a 200 or 201 response with the same
   meaning as for the initial greeting (as described in Section 5.1.1).
   Note that the response need not be the same as that presented during
   the initial greeting.


I understand that for a mode-switching server, we can receive 200 at the
initial greeting, and 201 when switching to the reader mode.
Is it right?  Because section 5.1.2 states that the server MUST present
a 201 greeting code if POST is not allowed, be it mode-switching or not.

Therefore, during the same connection, we can receive both 200 and 201 (?).

-- 
Julien ÉLIE

« Pourquoi les programmeurs confondent-ils Halloween et Noël ?
  Parce que OCT 31 == DEC 25. » 
Re: Initial greeting on mode-switching servers
#79931
Author: Russ Allbery
Date: Wed, 24 Dec 2008 22:28
42 lines
3155 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> According to RFC 3977, section 5.1.2, for the initial greeting:
>
>   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.
>
> According to RFC 3977, section 5.3.2, for the response to MODE READER:
>
>   If the server is mode-switching, it switches from is transit mode to
>   its reader mode, indicating this by changing the capability list
>   accordingly.  It MUST then return a 200 or 201 response with the same
>   meaning as for the initial greeting (as described in Section 5.1.1).
>   Note that the response need not be the same as that presented during
>   the initial greeting.
>
> I understand that for a mode-switching server, we can receive 200 at the
> initial greeting, and 201 when switching to the reader mode.
> Is it right?  Because section 5.1.2 states that the server MUST present
> a 201 greeting code if POST is not allowed, be it mode-switching or not.
>
> Therefore, during the same connection, we can receive both 200 and 201 (?).

I think this is a variation of a similar issue to the one that we
discussed earlier (although I can't find a reference for sure).  If the
server isn't sure whether the client will be able to post or not, it has
to return 200.  In the case of INN, this is true unless noreaders is set,
since innd has no idea what nnrpd may enforce in the way of permissions.
So I think innd has to return 201 if noreaders is set and 200 otherwise.

It remains to be seen if returning 201 will cause remote clients to think
that IHAVE is not permitted.  I hope not.  If so, we may have a deeper
problem.

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

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Initial greeting on mode-switching servers
#79930
Author: Julien ÉLIE
Date: Wed, 24 Dec 2008 23:36
52 lines
3312 bytes
Hi Russ,

> I think this is a variation of a similar issue to the one that we
> discussed earlier (although I can't find a reference for sure).

Yes, it is a variation.  We spoke about how AUTHINFO and dynamic filters
may have an impact upon 200/201.
The problem here was the fact that the client could receive both 200 and 201
during the same connection.  innd sends 200 and in response to MODE READER,
nnrpd sends 201.  It looks as though innd were violating that MUST:
"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."

The mention "Note that the response need not be the same as that presented
during the initial greeting." is weird with the previous MUST.


> If the
> server isn't sure whether the client will be able to post or not, it has
> to return 200.

It is what we did with nnrpd:  200 is sent if the user can post or (can
authenticate and at least one access realm to which he has access contains
a Perl or Python access script, or a Python dynamic script, or a list
of newsgroups in post: or newsgroups:).


> So I think innd has to return 201 if noreaders is set and 200 otherwise.

All right.
Easier than nnrpd :)


> It remains to be seen if returning 201 will cause remote clients to think
> that IHAVE is not permitted.  I hope not.  If so, we may have a deeper
> problem.

Remote clients should use CAPABILITIES :->

I do not know whether they think that.  I hope they directly try the command
and see if they obtain the expected answer.
(By the way, I have just checked for innfeed and its behaviour is similar
between 200 and 201.)

-- 
Julien ÉLIE

« Cinq millions et demi de conducteurs français
  ont une mauvaise vue. Heureusement, leur nombre diminue
  de jour en jour. » (Coluche)
Re: Initial greeting on mode-switching servers
#79932
Author: Russ Allbery
Date: Wed, 24 Dec 2008 23:55
34 lines
2801 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> The problem here was the fact that the client could receive both 200 and
> 201 during the same connection.  innd sends 200 and in response to MODE
> READER, nnrpd sends 201.  It looks as though innd were violating that
> MUST:  "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."

> The mention "Note that the response need not be the same as that
> presented during the initial greeting." is weird with the previous MUST.

Yeah.  The intention was to make this situation okay, so that you can give
the client a 200 response and then a 201 (or for that matter a 201 and
then a 200, but I bet that would confuse some clients).

>> It remains to be seen if returning 201 will cause remote clients to
>> think that IHAVE is not permitted.  I hope not.  If so, we may have a
>> deeper problem.
>
> Remote clients should use CAPABILITIES :->
>
> I do not know whether they think that.  I hope they directly try the
> command and see if they obtain the expected answer.  (By the way, I have
> just checked for innfeed and its behaviour is similar between 200 and
> 201.)

I'd say try it and then see if anyone runs into trouble.

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

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
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