From 41ba7666f0d67617462c717ef0a859c3347dd3b3 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 9 May 2007 18:24:27 +0000 Subject: 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. --- lib/ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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) { -- cgit v1.2.3