summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2020-10-05 11:55:11 +0200
committerOndrej Holy <oholy@redhat.com>2020-12-01 09:21:56 +0000
commit44f256758bbd7a898414779f3456ac9320428025 (patch)
treeaec64053996abd36c65f1b6cbcc574c30f8c8c27 /daemon
parent6af03154d8ca46bf91281cd30f84a2b9ede08689 (diff)
downloadgvfs-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.c2
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,