diff options
author | Ray Strode <rstrode@redhat.com> | 2012-10-16 10:53:08 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2012-10-16 10:54:34 -0400 |
commit | f6d6a664e1591d0485c52907caf5f4d0b612b504 (patch) | |
tree | 11bca767e4979feab3251831919d6591ec653a59 /daemon | |
parent | 0b5e101580761d060343b484b78caf5923b38dc6 (diff) | |
download | gdm-f6d6a664e1591d0485c52907caf5f4d0b612b504.tar.gz |
gdm-dbus-util: don't try to generate abstract socket address ourselves
GDM currently goes through gymnastics to generate the dbus socket
address for peer-to-peer connections. GDBus already has magic for
figuring out when to use abstract sockets and when not to, so this
code is extraneous.
This commit drops it.
https://bugzilla.gnome.org/show_bug.cgi?id=685935
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gdm-dbus-util.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/daemon/gdm-dbus-util.c b/daemon/gdm-dbus-util.c index ef6a127d..b71da7fd 100644 --- a/daemon/gdm-dbus-util.c +++ b/daemon/gdm-dbus-util.c @@ -71,53 +71,22 @@ handle_connection (GDBusServer *server, return FALSE; } -/* Note: Use abstract sockets like dbus does by default on Linux. Abstract - * sockets are only available on Linux. - */ -static char * -generate_address (void) -{ - char *path; - - if (g_unix_socket_address_abstract_names_supported ()) { - int i; - char tmp[9]; - - for (i = 0; i < 8; i++) { - if (g_random_int_range (0, 2) == 0) { - tmp[i] = g_random_int_range ('a', 'z' + 1); - } else { - tmp[i] = g_random_int_range ('A', 'Z' + 1); - } - } - tmp[8] = '\0'; - - path = g_strdup_printf ("unix:abstract=/tmp/gdm-greeter-%s", tmp); - } else { - path = g_strdup ("unix:tmpdir=/tmp"); - } - - return path; -} - GDBusServer * gdm_dbus_setup_private_server (GDBusAuthObserver *observer, GError **error) { - char *address, *guid; + char *guid; const char *client_address; GDBusServer *server; - address = generate_address (); guid = g_dbus_generate_guid (); - server = g_dbus_server_new_sync (address, + server = g_dbus_server_new_sync ("unix:tmpdir=/tmp", G_DBUS_SERVER_FLAGS_NONE, guid, observer, NULL, error); - g_free (address); client_address = g_dbus_server_get_client_address (server); |