- Fix Nautilus can't create "untitled folder" on sftp mounts (#512611)

This commit is contained in:
Tomas Bzatek 2009-08-17 14:32:02 +00:00
parent 67f542bc16
commit fc966cdb52
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 3fe8a3b48eb45392db2489434fb1b3682ccdc5ab Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Mon, 17 Aug 2009 15:40:52 +0200
Subject: [PATCH] sftp: return proper error when directory exists
Nautilus depends on properly reported errors when an operation fails.
In this case, user was not able to create new directory on sftp share
when "untitled folder" already existed.
So let's mask sftp's universal SSH_FX_FAILURE error for SSH_FXP_MKDIR.
Specification says: "An error will be returned if a file or directory
with the specified path already exists."
---
daemon/gvfsbackendsftp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index f810b31..cf33eaf 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -4350,7 +4350,7 @@ make_directory_reply (GVfsBackendSftp *backend,
gpointer user_data)
{
if (reply_type == SSH_FXP_STATUS)
- result_from_status (job, reply, -1, -1);
+ result_from_status (job, reply, G_IO_ERROR_EXISTS, -1);
else
g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Invalid reply received"));
--
1.6.4

View File

@ -1,7 +1,7 @@
Summary: Backends for the gio framework in GLib
Name: gvfs
Version: 1.3.4
Release: 6%{?dist}
Release: 7%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
@ -42,6 +42,9 @@ Patch4: gvfs-1.3.4-dont-strip-mount-prefix-for-local-paths.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=590730
Patch5: gvfs-1.3.5-gdaemonmount-root-path.patch
Patch6: gvfs-1.3.5-mountspec-prefix-ensure-ending-path-separator.patch
# nautilus can't create "unamed folder X" if it exist on the target via sftp
# https://bugzilla.redhat.com/show_bug.cgi?id=512611
Patch7: gvfs-1.3.5-mkdir-exists-error.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=497631
Patch8: gvfs-1.2.2-dnssd-deadlock.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=504339
@ -143,6 +146,7 @@ and iPod Touches to applications using gvfs.
%patch4 -p1 -b .mount-prefix
%patch5 -p1 -b .root-path
%patch6 -p1 -b .prefix-slash
%patch7 -p1 -b .sftp-mkdir
%patch8 -p1 -b .dnssd-deadlock
%patch9 -p1 -b .sftp-timeout
%patch10 -p1 -b .afc
@ -299,6 +303,9 @@ update-desktop-database &> /dev/null ||:
%{_datadir}/gvfs/remote-volume-monitors/afc.monitor
%changelog
* Mon Aug 17 2009 Tomas Bzatek <tbzatek@redhat.com> - 1.3.4-7
- Fix Nautilus can't create "untitled folder" on sftp mounts (#512611)
* Fri Aug 14 2009 Bastien Nocera <bnocera@redhat.com> 1.3.4-6
- Update AFC patch