[gdm] Trap errors for XAddHosts
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] Trap errors for XAddHosts
- Date: Wed, 16 Jun 2010 22:49:04 +0000 (UTC)
commit efc2fc61e70d7ab43d356d8b227c7ecda4f7a10c
Author: William Jon McCann <jmccann redhat com>
Date: Wed Jun 16 17:50:48 2010 -0400
Trap errors for XAddHosts
Apparently this can fail on older systems.
https://bugzilla.gnome.org/show_bug.cgi?id=599683
daemon/gdm-slave.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
index b7a0c0c..139c5cf 100644
--- a/daemon/gdm-slave.c
+++ b/daemon/gdm-slave.c
@@ -512,8 +512,14 @@ gdm_slave_connect_to_x11_display (GdmSlave *slave)
* display independent of current hostname
*/
gdm_slave_setup_xhost_auth (host_entries, si_entries);
+
+ gdm_error_trap_push ();
XAddHosts (slave->priv->server_display, host_entries,
G_N_ELEMENTS (host_entries));
+ XSync (slave->priv->server_display, False);
+ if (gdm_error_trap_pop ()) {
+ g_warning ("Failed to give slave programs access to the display. Trying to proceed.");
+ }
gdm_slave_set_windowpath (slave);
} else {
@@ -854,8 +860,14 @@ gdm_slave_add_user_authorization (GdmSlave *slave,
* user session is starting.
*/
gdm_slave_setup_xhost_auth (host_entries, si_entries);
+ gdm_error_trap_push ();
XRemoveHosts (slave->priv->server_display, host_entries,
G_N_ELEMENTS (host_entries));
+ XSync (slave->priv->server_display, False);
+ if (gdm_error_trap_pop ()) {
+ g_warning ("Failed to remove slave program access to the display. Trying to proceed.");
+ }
+
return res;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]