[gdm] manager: update session-id property when reusing display



commit 5de378f3339e9b8b965c9db21e2de143fd63ba39
Author: Ray Strode <rstrode redhat com>
Date:   Thu May 4 15:34:33 2017 -0400

    manager: update session-id property when reusing display
    
    If a display starts out its life as a greeter display, and then
    gets reused for the user session, we need to update the session-id
    property on the display to match its new session.
    
    This is important so the reauthentication mechanism is able to
    match the session with existing display and run in the proper context.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782182

 daemon/gdm-manager.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index b9b230a..994886f 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -1789,6 +1789,7 @@ on_start_user_session (StartUserSessionOperation *operation)
         gboolean doing_initial_setup = FALSE;
         gboolean starting_user_session_right_away = TRUE;
         GdmDisplay *display;
+        const char *session_id;
 
         g_debug ("GdmManager: start or jump to session");
 
@@ -1813,14 +1814,19 @@ on_start_user_session (StartUserSessionOperation *operation)
 
         g_object_get (G_OBJECT (display), "doing-initial-setup", &doing_initial_setup, NULL);
 
+        session_id = gdm_session_get_conversation_session_id (operation->session,
+                                                              operation->service_name);
+
         if (gdm_session_get_display_mode (operation->session) == GDM_SESSION_DISPLAY_MODE_REUSE_VT) {
                 /* In this case, the greeter's display is morphing into
                  * the user session display. Kill the greeter on this session
                  * and let the user session follow the same display. */
                 gdm_display_stop_greeter_session (display);
-                g_object_set (G_OBJECT (display), "session-class", "user", NULL);
+                g_object_set (G_OBJECT (display),
+                                "session-class", "user",
+                                "session-id", session_id,
+                                NULL);
         } else {
-                const char *session_id;
                 uid_t allowed_uid;
 
                 g_object_ref (display);
@@ -1857,8 +1863,6 @@ on_start_user_session (StartUserSessionOperation *operation)
                 }
 
                 /* Give the user session a new display object for bookkeeping purposes */
-                session_id = gdm_session_get_conversation_session_id (operation->session,
-                                                                      operation->service_name);
                 create_display_for_user_session (operation->manager,
                                                  operation->session,
                                                  session_id);


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