aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-05-09 18:24:27 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-05-09 18:24:27 +0000
commit41ba7666f0d67617462c717ef0a859c3347dd3b3 (patch)
treef7778e245450e125de916362ffb89c67fd7fefc1
parent4367e0513acedbc645c6b1a09946da7bd4167b78 (diff)
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.
-rw-r--r--CHANGES4
-rw-r--r--RELEASE-NOTES7
-rw-r--r--lib/ssh.c2
3 files changed, 10 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index f8b55e73a..f41bce449 100644
--- 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
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index bb94edfc0..26e199e2d 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -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)
diff --git a/lib/ssh.c b/lib/ssh.c
index 402f6ea15..cf847ae4e 100644
--- 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) {