cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Sending arbitrary SFTP commands?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 15 Mar 2007 23:48:13 +0100 (CET)

On Thu, 15 Mar 2007, Nick Zitzmann wrote:

>> Uhm, I'm not really that into the SFTP details, but don't the numerical
>> codes have any names that we can use instead?
>
> Sort of. The commands themselves are numerical, but the SFTP specification
> at <http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt> lists a
> bunch of #defines of all these codes.

Weird style for an RFC I'd say... but anyway, that's some names at least.

BTW, that spec is now at version 13:

http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13

> To complicate things further, they are for SFTP version 3 and they're
> probably different for earlier versions of SFTP.

Since the names aren't really set in the standard then anyway, we can just go
with a set we think are fine. Or possibly we just use the defined numbers
instead to skip the translation to numbers in libcurl.

> 1. Where's the appropriate place to store these codes in the easy options
> (preferably without creating more options)?

If we want to re-use an existing option I figure CURLOPT_QUOTE would fit, but
then we really need to pass in strings for the commands.

> 2. Can programs send these codes directly to the server via libssh2, or are
> we forced to use its built-in functions? I haven't looked at the project,
> but I suspect the latter...

We must use their functions to perform the commands, or we come up with a more
conveniant way we think libssh2 should offer this functionality with, and I
can push for that way in the libssh2 project (me being a committer and all
there).

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-03-16