libcurl hangs when sftp destination run out of space

Bug #1056141 reported by Elbandi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curl (Ubuntu)
Fix Committed
Undecided
Unassigned

Bug Description

my libcurl is compiled with scp/sftp support. when sftp destination is roun out of space, libcurl hangs, and try send more data forever. The error is in lib/ssh.c at Curl_scp_send and Curl_sftp_send function:
The libssh2_sftp_write returns number of bytes written or negative on failure. (http://www.libssh2.org/libssh2_sftp_write.html), the libssh2_channel_write function do the same.

But this curl_scp_send and Curl_sftp_send sould return the number of written bytes or -1.
(the check is in Curl_write function). So if the libssh2 functions returns negative error number, curl hope everytings is ok -> try forever.

The little fix is attached for curl 7.19 (lucid)

Tags: patch
Revision history for this message
Elbandi (ea333) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "curl_ssh_hang_fix.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Elbandi (ea333) wrote :

ops, wrong patch attached.

So, only Curl_scp_send and Curl_sftp_send need the check, recv's functions error handled good in sendf.c

Revision history for this message
Alessandro Ghedini (ghedo) wrote :

This appears to have been fixed upstream in curl 7.28.1 (for sftp too).

Changed in curl (Ubuntu):
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.