]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Kristian Gunstone fixed a problem where overwriting an uploaded file with
authorDan Fandrich <dan@coneharvesters.com>
Wed, 9 May 2007 18:24:27 +0000 (18:24 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 9 May 2007 18:24:27 +0000 (18:24 +0000)
sftp didn't truncate it first, which would corrupt the file if the new
file was shorter than the old.

CHANGES
RELEASE-NOTES
lib/ssh.c

diff --git a/CHANGES b/CHANGES
index f8b55e73afbee7acfbb28f9af2edb0ba214c258d..f41bce449e7bd484375b466b71d4e5f25351f81c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,10 @@
                              \___|\___/|_| \_\_____|
 
                                   Changelog
+Dan F (9 May 2007)
+- Kristian Gunstone fixed a problem where overwriting an uploaded file with
+  sftp didn't truncate it first, which would corrupt the file if the new
+  file was shorter than the old.
 
 Dan F (8 May 2007)
 - Added FTPS test cases 406 and 407
index bb94edfc033fe47d2d6ac032e4b6c7d17746ff54..26e199e2d2c053d243ccda48125090b5b3ab6afe 100644 (file)
@@ -15,6 +15,7 @@ This release includes the following changes:
  o deprecated curl_multi_socket()
  o uses less memory in non-pipelined use cases
  o CURLOPT_HTTP200ALIASES matched transfers assume HTTP 1.0 compliance
+ o more than one test harness can run at the same time without conflict
 
 This release includes the following bugfixes:
 
@@ -32,12 +33,14 @@ This release includes the following bugfixes:
  o compilation on VMS 64-bit mode
  o SCP/SFTP downloads could hang on the last bytes of a transfer
  o curl_easy_duphandle() crash
- o curl -V / curl_verion*() works even when GnuTLS is used on a system without
+ o curl -V / curl_version*() works even when GnuTLS is used on a system without
    a good random source
  o curl_multi_socket() not "noticing" newly added handles
  o lack of Content-Length and chunked encoding now requires HTTP 1.1 as well
    to be treated as without response body
  o connection cache growth in multi handles
+ o better handling of out of memory conditions
+ o overwriting an uploaded file with sftp now truncates it first
 
 This release includes the following known bugs:
 
@@ -62,6 +65,6 @@ advice from friends like these:
  Song Ma, Dan Fandrich, Yang Tse, Jay Austin, Robert Iakobashvil,
  James Housley, Daniel Black, Steve Little, Sonia Subramanian, Peter O'Gorman,
  Frank Hempel, Michael Wallner, Jeff Pohlmeyer, Tobias Rundström,
- Anders Gustafsson, James Bursa
+ Anders Gustafsson, James Bursa, Kristian Gunstone
 
         Thanks! (and sorry if I forgot to mention someone)
index 402f6ea158ad6fbb5674a24b8bbabe0137b2c316..cf847ae4e653c445488d70b9904986a9762d7d3c 100644 (file)
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -723,7 +723,7 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
      */
     sftp->sftp_handle =
       libssh2_sftp_open(sftp->sftp_session, sftp->path,
-                        LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT,
+                        LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
                         LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
                         LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
     if (!sftp->sftp_handle) {