summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2015-04-02 10:01:32 -0400
committerRay Strode <rstrode@redhat.com>2015-04-02 15:21:21 -0400
commit507aefdf561d864d604fac7a7a96c59306ca09f0 (patch)
tree3045937d81c373beb2da17c59f19e69300655d7b
parente5a0e92f59e256edc6489f2234fbe54c25ba9743 (diff)
downloadgdm-507aefdf561d864d604fac7a7a96c59306ca09f0.tar.gz
manager: set display name on session object at registration time
When the X server used at login time registers with GDM, GDM tries to write a wtmp session record for it. Now that the X server is started in the session, we don't know the display name of the X server up front and so don't have the display name attached to the session object. The wtmp record writing code relies on getting the display name from the session object, and so it fails. We do know the display name at registration time, from the details passed to the registration function. This commit makes sure to attach the display name to the session object as soon as the display is registered before writing the wtmp record. https://bugzilla.gnome.org/show_bug.cgi?id=747169
-rw-r--r--daemon/gdm-manager.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 4190e119..66cc882c 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -1103,6 +1103,10 @@ gdm_manager_handle_register_display (GdmDBusManager *manager,
GDBusConnection *connection;
GdmDisplay *display = NULL;
GdmSession *session;
+ GVariantIter iter;
+ char *key = NULL;
+ char *value = NULL;
+ const char *x11_display_name = NULL;
g_debug ("GdmManager: trying to register new display");
@@ -1119,11 +1123,20 @@ gdm_manager_handle_register_display (GdmDBusManager *manager,
return TRUE;
}
+ g_variant_iter_init (&iter, details);
+ while (g_variant_iter_loop (&iter, "{ss}", &key, &value)) {
+ if (g_strcmp0 (key, "x11-display-name") == 0)
+ x11_display_name = value;
+ }
+
session = get_user_session_for_display (self, display);
if (session != NULL) {
GPid pid;
+ if (x11_display_name != NULL)
+ g_object_set (G_OBJECT (session), "display-name", x11_display_name, NULL);
+
pid = gdm_session_get_pid (session);
if (pid > 0) {