🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
5 messages
5 total messages Started by Julien ÉLIE Mon, 01 Sep 2008 20:45
Syntax or permissions first?
#79394
Author: Julien ÉLIE
Date: Mon, 01 Sep 2008 20:45
37 lines
1884 bytes
Hi,

I wonder which one between the syntax of a whole command or the permissions to use
the base command comes first.

If I cannot use BODY (no read access):

CAPABILITIES
VERSION 2
READER
AUTHINFO
..

I believe READER is advertised even though read access is forbidden right now.
Is it right?

Then:

BODY with three arguments
501 Syntax error

or

BODY with three arguments
480 Authentication required

?

That is to say, is the base command checked for permissions to use it before
trying to understand what the client wants?
I think so (thus 501) but better be sure.

-- 
Julien ÉLIE

« Un clavier azerty en vaut deux. » 
Re: Syntax or permissions first?
#79395
Author: Russ Allbery
Date: Tue, 02 Sep 2008 21:57
35 lines
2076 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> I wonder which one between the syntax of a whole command or the
> permissions to use the base command comes first.

I would do syntax first.  I think that's what clients would generally
expect.

> If I cannot use BODY (no read access):
>
> CAPABILITIES
> VERSION 2
> READER
> AUTHINFO
> .
>
> I believe READER is advertised even though read access is forbidden
> right now.  Is it right?

READER should only be advertised if the client can use reader commands.
If they don't have read access to any group, I wouldn't advertise READER,
unless I'm missing some subtlety about what commands are included in that.

> Then:
>
> BODY with three arguments
> 501 Syntax error

This is the correct response regardless, I'd say.

-- 
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: Syntax or permissions first?
#79396
Author: Julien ÉLIE
Date: Wed, 03 Sep 2008 06:04
53 lines
3119 bytes
Hi Russ,

>> I wonder which one between the syntax of a whole command or the
>> permissions to use the base command comes first.
>
> I would do syntax first.  I think that's what clients would generally
> expect.

All right.
It is also what I think it better to do; I will see what I can do
for nnrpd because authentication and/or treating each argument is
as often as not done before the overall syntaxical reading.


>> If I cannot use BODY (no read access):
>>
>> CAPABILITIES
>> VERSION 2
>> READER
>> AUTHINFO
>> .

-> Read AUTHINFO USER of course (AUTHINFO alone is not right in the
   case I suggested), and also 101 before the answer!  My mistake.


> READER should only be advertised if the client can use reader commands.
> If they don't have read access to any group, I wouldn't advertise READER,
> unless I'm missing some subtlety about what commands are included in that.

The problem is that DATE is included in READER commands and it is allowed :)
(In fact, that was especially for that reason why I asked.)

But I also read:

   o  Reading mode, after a successful MODE READER command (see Section
      5.3).
      *  It MUST NOT advertise the MODE-READER capability.
      *  It MUST advertise the READER capability.
      *  It MAY NOT advertise the IHAVE capability, even if it was
         advertising it in transit mode.

So I understand that READER is mandatory when we are in MODE READER
(thus nnrpd), be that as accessible commands may.

The READER capability seems different than the other as for the
availability of commands.

-- 
Julien ÉLIE

« Quoi de plus inhumain qu'un sacrifice humain ? » (Alphonse Allais) 
Re: Syntax or permissions first?
#79402
Author: Russ Allbery
Date: Wed, 03 Sep 2008 20:18
54 lines
3710 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

>> READER should only be advertised if the client can use reader commands.
>> If they don't have read access to any group, I wouldn't advertise
>> READER, unless I'm missing some subtlety about what commands are
>> included in that.
>
> The problem is that DATE is included in READER commands and it is
> allowed :)  (In fact, that was especially for that reason why I asked.)

Oh, huh.

I'm not sure this is something we talked about (although DATE as part of
READER rings a vague bell -- as I recall, that was done because the only
real protocol function of DATE is for NEWNEWS and NEWGROUPS).

I'm not sure that we spent a lot of time talking about capabilities in
conjunction with authentication.  The impression I left with was as I'd
said, that capabilities should change based on what the client is
permitted to do based on their current authentication status and other
state, but I'm not sure how strong of a requirement that is for the weird
authentication states that one can end up with.  Most of the language in
the standard talks about what the server "implements" rather than what the
client is permitted to do, which to me implies that you can advertise
capabilities that are implemented but are off-limits to the current
authenticated user.  You don't want to, since it deceives the client, but
it may in some cases not be easy to avoid.

> But I also read:
>
>   o  Reading mode, after a successful MODE READER command (see Section
>      5.3).
>      *  It MUST NOT advertise the MODE-READER capability.
>      *  It MUST advertise the READER capability.
>      *  It MAY NOT advertise the IHAVE capability, even if it was
>         advertising it in transit mode.
>
> So I understand that READER is mandatory when we are in MODE READER
> (thus nnrpd), be that as accessible commands may.
>
> The READER capability seems different than the other as for the
> availability of commands.

Yes, that may well be the case.  Specifically, I don't think we considered
the possibility of a POST-only permission structure after MODE READER, and
the standard right now rules out nnrpd after MODE READER allowing only
POST and no reader commands via capabilities.  I think in that case we
have to advertise READER and just reject the commands that read things.

-- 
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: Syntax or permissions first?
#79403
Author: Julien ÉLIE
Date: Wed, 03 Sep 2008 20:43
17 lines
1969 bytes
Hello Russ,

> The impression I left with was as I'd said, that capabilities should change
> based on what the client is permitted to do based on their current
> authentication status and other state

Thanks.  It sounds the most natural behaviour to have.
The most "user-friendly" one too, as you say in other words.

Therefore, I believe we should stick to it when RFC is not clear.

-- 
Julien ÉLIE

« La vie est un sommeil, l'amour en est le rêve et vous aurez vécu
  si vous avez aimé. » (Alfred de Musset) 
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