Subject: RE: presence of authority was Re: SFTP URI issues

From: "Salowey, Joe" <[email-masked]>
Date: Sun, 8 Jan 2006 22:09:37 -0800

> -----Original Message-----
> From: Tom Petch [mailto:[email-masked]] 
> Sent: Friday, January 06, 2006 3:55 AM
> To: Salowey, Joe; [email-masked]
> Subject: Re: presence of authority was Re: SFTP URI issues
> 
> <inline>
> Tom Petch
> ----- Original Message -----
> From: "Salowey, Joe" <[email-masked]>
> To: "Tom Petch" <[email-masked]>; <[email-masked]>
> Sent: Friday, January 06, 2006 2:29 AM
> Subject: RE: presence of authority was Re: SFTP URI issues
> 
> Thanks for catching this.  In the SSH URI an authority should 
> always be
> required, but the path should be empty (or perhaps ignored if it is
> there). So I think that the hier-part should be:
> 
> hier-part = "//" authority ["/"]
> 
> For SFTP I would think that an authority would always be required as
> well but the path could be there or empty
> 
> hier-part =  "//" authority path-abempty
> 
> Make sense?
> 
> Joe
> 
> <tom>
> Not sure.  Staying with SSH for the moment, I am unclear 
> about the trailing
> ["/"] and the precise semantic of empty path.  To quote URI [RFC3986]
>    The scheme and path components are required, though the path may be
>    empty (no characters).  When authority is present, the path must
>    either be empty or begin with a slash ("/") character
> So there an empty path means no characters, but path must be 
> present:-).  Do you
> use empty in the same sense, or do you regard that lone / as 
> an empty path?  I
> am still unclear quite what it is you want to convey with the 
> ABNF and so am
> uncertain whether or not the ABNF is suitable.
> 
> I think we should follow URI whenever possible, eg in its 
> semantics of empty and
> in its insistence that a path is present even if it is empty. 
>    (I don't know
> the ABNF for 'ignore a path if present' and suspect that that 
> is better
> expressed in English:-)
>

[Joe] OK, so how about for ssh

hier-part = "//" authority path-empty

With some text in the document that states if there is a non-empty path
it MUST be ignored.

> > -----Original Message-----
> > From: Tom Petch [mailto:[email-masked]]
> > Sent: Thursday, December 29, 2005 2:20 AM
> > To: Salowey, Joe; [email-masked]
> > Subject: Re: presence of authority was Re: SFTP URI issues
> >
> > ----- Original Message -----
> > From: "Salowey, Joe" <[email-masked]>
> > To: "Tom Petch" <[email-masked]>; <[email-masked]>
> > Sent: Wednesday, December 28, 2005 9:25 PM
> > Subject: RE: presence of authority was Re: SFTP URI issues
> >
> >
> > > This ABNF is for the SSH URI which should not contain a
> > non-empty path.
> > > The deviation from the 3986 path was intended to describe
> > this.  I think
> > > the change is correct, but I could have missed something.
> > The "sftp" URI
> > > uses the path description from 3986.
> > >
> > Yes, understood.  I am being opaque:-(  I was obliquely
> > referring to the
> > addition of brackets in the SSH URI which, I believe, changes
> > the meaning from
> > RFC3986 to mean that the ssh ABNF requires authority always
> > to be present
> > whereas the URI ABNF only requires authority  to be present
> > for path-abempty,
> > not for the other variants of path.
> >
> > So when the ABNF for the SFTP URI says it uses the path
> > definition from RFC3986,
> > I am unclear what position it takes on authority, always
> > present or not.
> >
> > There is, I think, a defect in RFC3986 here, in that
> > path-abempty, which is
> > allowed to start // (two solidus), is only permitted to be
> > used when authority
> > is present - else the // that precedes authority could be
> > confused with the //
> > that starts the path-abempty.  Where RFC3986 could be
> > defective is that
> > authority is defined as, being selective,
> >
> >  authority     = host
> >    host          =  reg-name
> >     reg-name      = *( unreserved / pct-encoded / sub-delims )
> >
> > which allows authority to be zero characters, in which case
> > the // can get
> > confused with // :-)
> >
> > So, you asked if it was ok to start a path with // - my
> > reading of RFC3986 is
> > that that is what it intends to say but does not quite do so
> > ie it is ok as long
> > as authority is present and is not zero length. If the last
> > is what the ABNF for
> > the SFTP URI., or for the SSH URI,  intends to say, then I
> > think this should be
> > spelt out; but I am not clear what you are intending to say:-(
> >
> > Tom Petch
> >
> > > > -----Original Message-----
> > > > From: Tom Petch [mailto:[email-masked]]
> > > > Sent: Wednesday, December 28, 2005 3:37 AM
> > > > To: Salowey, Joe; [email-masked]
> > > > Subject: presence of authority was Re: SFTP URI issues
> > > >
> > > > Mmmm
> > > >
> > > > I should have added to my previous reply that I never find
> > > > RFC3986 easy to
> > > > understand, perhaps because it is not easy to understand:-(
> > > >
> > > > In RFC3986 is the following
> > > > hier-part     = "//" authority path-abempty
> > > >                  / path-absolute
> > > >                  / path-rootless
> > > >                  / path-empty
> > > > which means
> > > >     authority path-abempty OR
> > > >     path-absolute OR
> > > >     path-rootless OR
> > > >     path-empty
> > > > while the I-D has
> > > > hier-part     =  "//" authority ( path-empty / path-abempty )
> > > > which means
> > > >     authority path-empty OR
> > > >     authority path-abempty
> > > > Is this change intended?
> > > >
> > > > Tom Petch
> > > >
> > > >
> >
>

---

From: "Tom Petch" <[email-masked]>
Date: Mon, 9 Jan 2006 15:01:49 +0100

<see [tom2]>
----- Original Message -----
From: "Salowey, Joe" <[email-masked]>
To: "Tom Petch" <[email-masked]>; <[email-masked]>
Sent: Monday, January 09, 2006 7:09 AM
Subject: RE: presence of authority was Re: SFTP URI issues
> Thanks for catching this.  In the SSH URI an authority should always be
> Not sure.  Staying with SSH for the moment, I am unclear about the trailing
> use empty in the same sense, or do you regard that lone / as an empty path?  I
> am still unclear quite what it is you want to convey with the ABNF and so am
> I think we should follow URI whenever possible, eg in its  semantics of empty
and
> in its insistence that a path is present even if it is empty. (I don't know
> the ABNF for 'ignore a path if present' and suspect that that is better
> expressed in English:-)
>

[tom2] Yes, either that or

I see the difference being a matter of how the ABNF is used.  I understand that
implementors may use ABNF as input to a syntax checker, if which case
<path-empty> would cause a syntax failure when a to-be-ignored path is present
while <path-abempty> would allow the syntax but still cause the path to be
semantically ignored.  I am fine with either.

On a related topic, I did post the URI list to check that <host> in <hier-part>
can be empty, ie a zero length string and yes, generic URI syntax does allow
that.  It is used, for example, by smb which allows
     smb://
with nothing following.

I think you said that host should be non-empty for ssh: in which case, I would
add a line to that effect eg host MUST/SHOULD be a non-empty string.

Tom Petch