[gvfs/gnome-3-10] gvfsdaemon: properly remove socket_dir
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/gnome-3-10] gvfsdaemon: properly remove socket_dir
- Date: Thu, 23 Jan 2014 14:16:12 +0000 (UTC)
commit 21239e01037c6375518e3dbbd8548634b6e500ac
Author: Antoine Jacoutot <ajacoutot gnome org>
Date: Thu Jan 23 14:40:32 2014 +0100
gvfsdaemon: properly remove socket_dir
When not using abstract sockets, gvfs tries to rmdir the socket
directory but it still contains the socket so the call fails.
We now make sure to remove the socket first.
https://bugzilla.gnome.org/show_bug.cgi?id=720482
daemon/gvfsdaemon.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/daemon/gvfsdaemon.c b/daemon/gvfsdaemon.c
index 9a9cb00..3018e34 100644
--- a/daemon/gvfsdaemon.c
+++ b/daemon/gvfsdaemon.c
@@ -598,12 +598,18 @@ static void
new_connection_data_free (void *memory)
{
NewConnectionData *data = memory;
+ gchar *socket;
/* Remove the socket and dir after connected */
- if (data->socket_dir)
- rmdir (data->socket_dir);
+ if (data->socket_dir)
+ {
+ socket = g_strdup_printf ("%s/socket", data->socket_dir);
+ g_unlink (socket);
+ g_free (socket);
+ rmdir (data->socket_dir);
+ g_free (data->socket_dir);
+ }
- g_free (data->socket_dir);
g_free (data);
}
@@ -900,13 +906,8 @@ handle_get_connection (GVfsDBusDaemon *object,
return TRUE;
error_out:
- g_free (data);
+ new_connection_data_free (data);
g_free (address1);
- if (socket_dir)
- {
- rmdir (socket_dir);
- g_free (socket_dir);
- }
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]