Blame SOURCES/0001-manager-don-t-kill-timed-login-session-immediately-a.patch

81f0aa
From ecd37ba6d56a49dd896613f68d1e1754633b9f0c Mon Sep 17 00:00:00 2001
81f0aa
From: Ray Strode <rstrode@redhat.com>
81f0aa
Date: Wed, 6 Feb 2019 16:14:52 -0500
81f0aa
Subject: [PATCH 1/4] manager: don't kill timed login session immediately after
81f0aa
 it starts
81f0aa
81f0aa
At the moment GDM is misidentifying timed login sessions as if
81f0aa
they are automatic login sessions.  That leads to their displays
81f0aa
getting killed sometimes shortly after log in.
81f0aa
81f0aa
This commit corrects the check, so that timed login sessions aren't
81f0aa
treated as autologin sessions.
81f0aa
---
81f0aa
 daemon/gdm-manager.c | 3 ++-
81f0aa
 1 file changed, 2 insertions(+), 1 deletion(-)
81f0aa
81f0aa
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
81f0aa
index 2118c5834..b2d0578f5 100644
81f0aa
--- a/daemon/gdm-manager.c
81f0aa
+++ b/daemon/gdm-manager.c
81f0aa
@@ -1841,61 +1841,62 @@ on_start_user_session (StartUserSessionOperation *operation)
81f0aa
                                 NULL);
81f0aa
         } else {
81f0aa
                 uid_t allowed_uid;
81f0aa
 
81f0aa
                 g_object_ref (display);
81f0aa
                 if (doing_initial_setup) {
81f0aa
                         g_debug ("GdmManager: closing down initial setup display");
81f0aa
                         gdm_display_stop_greeter_session (display);
81f0aa
                         gdm_display_unmanage (display);
81f0aa
                         gdm_display_finish (display);
81f0aa
 
81f0aa
                         /* We can't start the user session until the finished display
81f0aa
                          * starts to respawn (since starting an X server and bringing
81f0aa
                          * one down at the same time is a no go)
81f0aa
                          */
81f0aa
                         g_assert (self->priv->initial_login_operation == NULL);
81f0aa
                         self->priv->initial_login_operation = operation;
81f0aa
                         starting_user_session_right_away = FALSE;
81f0aa
                 } else {
81f0aa
                         g_debug ("GdmManager: session has its display server, reusing our server for another login screen");
81f0aa
                 }
81f0aa
 
81f0aa
                 /* The user session is going to follow the session worker
81f0aa
                  * into the new display. Untie it from this display and
81f0aa
                  * create a new session for a future user login. */
81f0aa
                 allowed_uid = gdm_session_get_allowed_user (operation->session);
81f0aa
                 g_object_set_data (G_OBJECT (display), "gdm-user-session", NULL);
81f0aa
                 g_object_set_data (G_OBJECT (operation->session), "gdm-display", NULL);
81f0aa
                 create_user_session_for_display (operation->manager, display, allowed_uid);
81f0aa
 
81f0aa
-                if (g_strcmp0 (operation->service_name, "gdm-autologin") == 0) {
81f0aa
+                if ((g_strcmp0 (operation->service_name, "gdm-autologin") == 0) &&
81f0aa
+                    !gdm_session_client_is_connected (operation->session)) {
81f0aa
                         gboolean was_initial = FALSE;
81f0aa
 
81f0aa
                         g_object_get (G_OBJECT (display), "is-initial", &was_initial, NULL);
81f0aa
 
81f0aa
                         /* remove the unused prepared greeter display since we're not going
81f0aa
                          * to have a greeter */
81f0aa
                         gdm_display_store_remove (self->priv->display_store, display);
81f0aa
                         g_object_unref (display);
81f0aa
 
81f0aa
                         should_be_initial = was_initial;
81f0aa
                 }
81f0aa
 
81f0aa
                 /* Give the user session a new display object for bookkeeping purposes */
81f0aa
                 create_display_for_user_session (operation->manager,
81f0aa
                                                  operation->session,
81f0aa
                                                  session_id,
81f0aa
                                                  should_be_initial);
81f0aa
         }
81f0aa
 
81f0aa
         if (starting_user_session_right_away) {
81f0aa
                 start_user_session (operation->manager, operation);
81f0aa
         }
81f0aa
 
81f0aa
  out:
81f0aa
         return G_SOURCE_REMOVE;
81f0aa
 }
81f0aa
 
81f0aa
 static void
81f0aa
 queue_start_user_session (GdmManager *manager,
81f0aa
                           GdmSession *session,
81f0aa
-- 
81f0aa
2.21.0
81f0aa