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

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