[gdm] gdm-dbus-util: don't try to generate abstract socket address ourselves



commit f6d6a664e1591d0485c52907caf5f4d0b612b504
Author: Ray Strode <rstrode redhat com>
Date:   Tue Oct 16 10:53:08 2012 -0400

    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

 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 ef6a127..b71da7f 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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]