summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2014-03-25 08:32:25 +0000
committerRoss Lagerwall <rosslagerwall@gmail.com>2014-04-11 17:50:04 +0100
commita3d3074363cd271c94dd10606d7a9953625632da (patch)
tree9a7abf484bc1629ddbe58c1a35b5b401dcb9c472 /client
parenta29366193100de48df416c07f96daf7b84ee8f30 (diff)
downloadgvfs-a3d3074363cd271c94dd10606d7a9953625632da.tar.gz
client: Return NULL if set_display_name() fails
Return NULL as per the documentation rather than returning the original file. This prevents errors like the following, where "Permission Denied" should be displayed: $ gvfs-rename smb://localhost/tmp/cat dog Rename successful. New uri: smb://localhost/tmp/cat (gvfs-rename:1385): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed https://bugzilla.gnome.org/show_bug.cgi?id=727007
Diffstat (limited to 'client')
-rw-r--r--client/gdaemonfile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 445c9195..c3f82843 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -2381,6 +2381,8 @@ g_daemon_file_set_display_name (GFile *file,
if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
_g_dbus_send_cancelled_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (proxy)));
_g_propagate_error_stripped (error, local_error);
+
+ file = NULL;
}
g_free (path);