diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-02-16 11:26:12 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-02-16 11:26:12 +0000 |
commit | 7178c101038bec7391070ab3a231f4c1cd7edbb8 (patch) | |
tree | ebb639e6dfead8ebbe04d22a68de6e6e0b2a2652 /daemon/gvfsbackendsftp.c | |
parent | 6543cd5ebf6d8532fe52cbb2a8a51cc882b170ce (diff) | |
download | gvfs-7178c101038bec7391070ab3a231f4c1cd7edbb8.tar.gz |
Return G_IO_ERROR_CANT_CREATE_BACKUP in the below case instead of not
2009-02-16 Alexander Larsson <alexl@redhat.com>
* daemon/gvfsbackendsftp.c (replace_create_temp_reply):
Return G_IO_ERROR_CANT_CREATE_BACKUP in the below case instead
of not copying the ownership.
svn path=/trunk/; revision=2224
Diffstat (limited to 'daemon/gvfsbackendsftp.c')
-rw-r--r-- | daemon/gvfsbackendsftp.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c index 2bbb4ee0..d59c1418 100644 --- a/daemon/gvfsbackendsftp.c +++ b/daemon/gvfsbackendsftp.c @@ -2781,18 +2781,26 @@ replace_create_temp_reply (GVfsBackendSftp *backend, replace_create_temp (backend, op_job); } else if (data->set_ownership && - error->code == G_IO_ERROR_PERMISSION_DENIED && - !op_job->make_backup) + error->code == G_IO_ERROR_PERMISSION_DENIED) { + g_error_free (error); + /* This was probably due to the fact that the ownership could not be set properly. In this case we change our strategy altogether and simply open/truncate the original file. This is not as secure as the atomit tempfile/move approach, but at least ownership doesn't change */ - /* We only do this if make_backup is FALSE, as this version breaks - the backup code. Would like to handle the backup case too by - backing up before truncating... */ - replace_truncate_original (backend, job); + if (!op_job->make_backup) + replace_truncate_original (backend, job); + else + { + /* We only do this if make_backup is FALSE, as this version breaks + the backup code. Would like to handle the backup case too by + backing up before truncating, but for now error out... */ + g_vfs_job_failed (job, G_IO_ERROR, + G_IO_ERROR_CANT_CREATE_BACKUP, + _("backups not supported yet")); + } } else { |