cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems with SFTP upload

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 17 Oct 2008 12:54:44 +0200 (CEST)

On Fri, 17 Oct 2008, Andreas Wurf wrote:

Reply CC'ed to the libssh2-devel list, original mail found here:
http://curl.haxx.se/mail/lib-2008-10/0229.html

This seems more like a libssh2 problem than libcurl so I think follow-ups
should rather be taken on the libssh2 list.

> data[0] contains SSH_FXP_STATUS, so the if-block is entered.
> sftp->last_errno is set to zero, since this is the value from
> data[5]-data[8].

A zero in SSH_FXP_STATUS would correpond to SSH_FX_OK which according to the
"spec" section 9.1 [*] means: "The value SSH_FX_OK indicates success, and all
other values indicate failure.".

Of course, in this context I don't see how it can signal success with
SSH_FXP_STATUS since section 8.1.1 says the response to SSH_FXP_OPEN should be
"SSH_FXP_HANDLE (if the operation is successful)".

> So, in essence, the following appears to happen: The client requests the
> file to be created on the server using libssh2_sftp_open_ex(). The server
> creates the file with 0 bytes size. Instead of returning a handle to the
> file, it sends a SH_FXP_STATUS with the result code 0 (Success). What the
> heck is this? Could this even be a problem related to the server?

Could there be a problem with the outgoing request perhaps?

Since repeating the problem seems to be a bit hard, it of course will take
some persistence and imagination to hunt down this problem! I assume you can
SFTP files to it using other clients so we can pretty much rule out the server
side?

[*] = http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-9.1

-- 
  / daniel.haxx.se
Received on 2008-10-17