aboutsummaryrefslogtreecommitdiff
path: root/lib
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 /lib
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/ssh.c2
1 files changed, 1 insertions, 1 deletions
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) {