possible freeze change: at-spi2-core login race



Hi,

Basically since GDM uses a11y, and on many GNOME installs GDM shares
an X server with the initial login, the AT_SPI_BUS environment
variable can be incorrectly picked up by the user login process.  This
patch ensures it gets cleared from the GDM session.

Needs approval from mgorse.
From 20cbfa97e6da761f4a8798a62ade00dc2a219365 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters verbum org>
Date: Thu, 24 Mar 2011 13:30:51 -0400
Subject: [PATCH] Clear AT_SPI_BUS property on launcher exit

Clear the X property if our bus is gone; in the case where e.g.
GDM is launching a login on an X server it was using before,
we don't want early login processes to pick up the stale address.
---
 bus/at-spi-bus-launcher.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index 37ad60f..0d6b4b7 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -385,6 +385,23 @@ main (int    argc,
 
   if (_global_app->a11y_bus_pid > 0)
     kill (_global_app->a11y_bus_pid, SIGTERM);
+
+  /* Clear the X property if our bus is gone; in the case where e.g. 
+   * GDM is launching a login on an X server it was using before,
+   * we don't want early login processes to pick up the stale address.
+   */
+  {
+    Display *display = XOpenDisplay (NULL);
+    if (display)
+      {
+        Atom bus_address_atom = XInternAtom (display, "AT_SPI_BUS", False);
+        XDeleteProperty (display,
+                         XDefaultRootWindow (display),
+                         bus_address_atom);
+      }
+    XFlush (display);
+    XCloseDisplay (display);
+  }
     
   if (_global_app->a11y_launch_error_message)
     {
-- 
1.7.4.1



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