diff options
author | Ondrej Holy <oholy@redhat.com> | 2020-10-05 11:55:11 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2020-12-01 09:21:56 +0000 |
commit | 44f256758bbd7a898414779f3456ac9320428025 (patch) | |
tree | aec64053996abd36c65f1b6cbcc574c30f8c8c27 /daemon | |
parent | 6af03154d8ca46bf91281cd30f84a2b9ede08689 (diff) | |
download | gvfs-44f256758bbd7a898414779f3456ac9320428025.tar.gz |
ftp: Prevent source file removal in case of transfer failure
When moving file from FTP to local filesystem, the remote file is removed
regradless of transfer failure. This is pretty bad as it might lead to data
loss. Let's delete the remote file only if the transfer suceeded.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gvfsbackendftp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c index 1f2f23ad..16716e04 100644 --- a/daemon/gvfsbackendftp.c +++ b/daemon/gvfsbackendftp.c @@ -1706,7 +1706,7 @@ do_pull (GVfsBackend * backend, g_vfs_ftp_task_receive (&task, 0, NULL); g_object_unref (output); - if (remove_source) + if (!g_vfs_ftp_task_is_in_error (&task) && remove_source) { g_vfs_ftp_task_send (&task, G_VFS_FTP_PASS_500, |