gvfs/gvfs-1.3.5-mkdir-exists-error.patch

33 lines
1.2 KiB
Diff

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