curl-library
Re: libssh2 scp working?
Date: Mon, 16 Oct 2006 10:51:56 -0500
In the last episode (Oct 16), Daniel Stenberg said:
> On Mon, 16 Oct 2006, James Housley wrote:
[ http://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-ssh-uri#section-4.4 ]
> >Seems to state all paths are absolute.
>
> Indeed, those paragraphs prove me wrong.
Well, it "RECOMMENDS" that paths be absolute. I would guess that the
recommendation is so the style matches http:// style uris, where
everything's absolute by default.
> I don't like how they make you have to depend on the remote server
> implementing ~-globbing to be able to reach a user's home dir, nor do I
> like how they've decided to not work like FTP URIs work. ;-(
I think that document is describing the URL parser in whatever client
interface is processing it (i.e. curl), since the SFTP protocol itself
doesn't even support wildcards at all, and ~ is just another filename
character. The sftp command handles wildcards in sftp-glob.c, for
example. So James would have to check the first characters after the
first slash in the uri:
If it's "~/", strip the "~/" and send the rest as-is to the SFTP server.
Else, prepend a "/" so the sftp server treats it as an absolute path.
http://tools.ietf.org/html/draft-ietf-secsh-filexfer#section-6 says all
paths are relative to your homedir unless they start with "/".
SFTP is really a simple filesystem protocol, with its ability to open a
file with both read and write access and do random access I/O from that
point on.
-- Dan Nelson dnelson_at_allantgroup.comReceived on 2006-10-16