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

From: "Salowey, Joe" <[email-masked]>
Date: Thu, 5 Jan 2006 17:29:20 -0800

Hi Tom,

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 

> -----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: Fri, 6 Jan 2006 12:54:41 +0100

<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

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:-)

---

From: "Tom Petch" <[email-masked]>
Date: Tue, 10 Jan 2006 16:48:57 +0100

----- 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

> hier-part =  "//" authority path-abempty
Assuming that the SSH URI is sorted, back to the SFTP one.  Yes that ABNF is
fine but I am not sure about the following paragraph in the I-D, on two counts.

a) The Generic Syntax for URI [RFC3986] says
  "If a URI contains an authority component, then the path component
   must either be empty or begin with a slash ("/") character.  "
which is what <path-abempty> achieves.  The I-D goes on to say that
if a path starts with a / then it is relative to the root of the file system,
otherwise it is relative to the user's home or default directory.  But the
Generic Syntax requires the path to start with a / or be empty, so you can never
have a path relative to the user's home directory except for an empty one:-)

b) In this section, the I-D says that / is a reserved character - I agree - and
that it must be encoded - disagree.   In URI, reserved is not used in the way I
would like to see it used -  it means that sometimes the character must be
encoded, other times not:-{
  " If data for a URI component would conflict with a reserved
     character's purpose as a delimiter, then the conflicting data must be
     percent-encoded before the URI is formed."
The initial / of <path-abempty> is a delimiter between authority and path and so
must be just that, / not %2F.
So are you allowing
   sftp://example.com/%2Fetc/protocols
for absolute paths as opposed to
   sftp://example.com/mylocalfile.txt
for relative ones?

I am unclear.

(The end of <path-abempty> will be signalled by the end of the URI or the
characters ? or # and so / is not a delimiter for that purpose and can appear as
such as many times as it likes unencoded within such a path).

Tom Petch

<snip>