dbus/tools dbus-launch-x11.c,1.3,1.4

Thiago J. Macieira thiago at kemper.freedesktop.org
Thu Oct 26 10:34:51 PDT 2006


Update of /cvs/dbus/dbus/tools
In directory kemper:/tmp/cvs-serv14296/tools

Modified Files:
	dbus-launch-x11.c 
Log Message:
	* tools/dbus-launch-x11.c (get_session_file, init_x_atoms):
        check if get_machine_uuid() returns NULL before proceeding any
        further: we can't init the X atoms or create a session file
        name if there is no machine ID.
	This solves a crash reported by some users if
        --exit-with-session was used without --autolaunch=<machine-id>


Index: dbus-launch-x11.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-launch-x11.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dbus-launch-x11.c	1 Oct 2006 20:05:39 -0000	1.3
+++ dbus-launch-x11.c	26 Oct 2006 17:34:49 -0000	1.4
@@ -98,6 +98,10 @@
   char *result;
   char *p;
 
+  machine = get_machine_uuid ();
+  if (machine == NULL)
+    return NULL;
+
   display = xstrdup (getenv ("DISPLAY"));
   if (display == NULL)
     {
@@ -143,8 +147,6 @@
         *p = '_';
     }
   
-  machine = get_machine_uuid ();
-
   home = get_homedir ();
   
   result = malloc (strlen (home) + strlen (prefix) + strlen (machine) +
@@ -237,6 +239,10 @@
   if (init)
     return TRUE;
 
+  machine = get_machine_uuid ();
+  if (machine == NULL)
+    return FALSE;
+
   user = getpwuid (getuid ());
   if (user == NULL)
     {
@@ -245,8 +251,6 @@
     }
   user_name = xstrdup(user->pw_name);
 
-  machine = get_machine_uuid ();
-
   atom_name = malloc (strlen (machine) + strlen (user_name) + 2 +
                       MAX (strlen (selection_prefix),
                            MAX (strlen (address_prefix),



More information about the dbus-commit mailing list