Blame SOURCES/0026-manager-don-t-set-ran_once-after-running-initial-set.patch

c90517
From cfc1dd96dee55afde7f377878905302db9cbdcf6 Mon Sep 17 00:00:00 2001
c90517
From: Ray Strode <rstrode@redhat.com>
c90517
Date: Thu, 30 Aug 2018 16:04:41 -0400
c90517
Subject: [PATCH 26/48] manager: don't set ran_once after running initial-setup
c90517
c90517
GdmManager tracks whether or not the user session has ran
c90517
once, so it won't autologin a user again after logout.
c90517
c90517
Unfortunately the initial-setup session was counting toward the
c90517
ran_once count preventing initial-setup from logging the user
c90517
in afterward.
c90517
c90517
This commit prevents ran_once from getting set in that case.
c90517
---
c90517
 daemon/gdm-manager.c | 4 +++-
c90517
 1 file changed, 3 insertions(+), 1 deletion(-)
c90517
c90517
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
c90517
index 367a731cc..c8197a043 100644
c90517
--- a/daemon/gdm-manager.c
c90517
+++ b/daemon/gdm-manager.c
c90517
@@ -1519,105 +1519,107 @@ set_up_session (GdmManager *manager,
c90517
                 operation->username = username;
c90517
 
c90517
                 g_signal_connect (user,
c90517
                                   "notify::is-loaded",
c90517
                                   G_CALLBACK (on_user_is_loaded_changed),
c90517
                                   operation);
c90517
         }
c90517
 }
c90517
 
c90517
 static void
c90517
 greeter_display_started (GdmManager *manager,
c90517
                          GdmDisplay *display)
c90517
 {
c90517
         if (manager->priv->ran_once) {
c90517
                 return;
c90517
         }
c90517
 
c90517
         maybe_start_pending_initial_login (manager, display);
c90517
 }
c90517
 
c90517
 static void
c90517
 on_display_status_changed (GdmDisplay *display,
c90517
                            GParamSpec *arg1,
c90517
                            GdmManager *manager)
c90517
 {
c90517
         int         status;
c90517
         int         display_number = -1;
c90517
         char       *session_type = NULL;
c90517
 #ifdef WITH_PLYMOUTH
c90517
         gboolean    display_is_local = FALSE;
c90517
+        gboolean    doing_initial_setup = FALSE;
c90517
         gboolean    quit_plymouth = FALSE;
c90517
 
c90517
         g_object_get (display,
c90517
                       "is-local", &display_is_local,
c90517
+                      "doing-initial-setup", &doing_initial_setup,
c90517
                       NULL);
c90517
         quit_plymouth = display_is_local && manager->priv->plymouth_is_running;
c90517
 #endif
c90517
 
c90517
         g_object_get (display,
c90517
                       "x11-display-number", &display_number,
c90517
                       "session-type", &session_type,
c90517
                       NULL);
c90517
 
c90517
         status = gdm_display_get_status (display);
c90517
 
c90517
         switch (status) {
c90517
                 case GDM_DISPLAY_PREPARED:
c90517
                 case GDM_DISPLAY_MANAGED:
c90517
                         if ((display_number == -1 && status == GDM_DISPLAY_PREPARED) ||
c90517
                             (display_number != -1 && status == GDM_DISPLAY_MANAGED)) {
c90517
                                 char *session_class;
c90517
 
c90517
                                 g_object_get (display,
c90517
                                               "session-class", &session_class,
c90517
                                               NULL);
c90517
                                 if (g_strcmp0 (session_class, "greeter") == 0)
c90517
                                         set_up_session (manager, display);
c90517
                                 g_free (session_class);
c90517
                         }
c90517
 
c90517
                         if (status == GDM_DISPLAY_MANAGED) {
c90517
                                 greeter_display_started (manager, display);
c90517
                         }
c90517
                         break;
c90517
                 case GDM_DISPLAY_FAILED:
c90517
                 case GDM_DISPLAY_UNMANAGED:
c90517
                 case GDM_DISPLAY_FINISHED:
c90517
 #ifdef WITH_PLYMOUTH
c90517
                         if (quit_plymouth) {
c90517
                                 plymouth_quit_without_transition ();
c90517
                                 manager->priv->plymouth_is_running = FALSE;
c90517
                         }
c90517
 #endif
c90517
 
c90517
-                        if (status == GDM_DISPLAY_FINISHED || g_strcmp0 (session_type, "x11") == 0) {
c90517
+                        if (!doing_initial_setup && (status == GDM_DISPLAY_FINISHED || g_strcmp0 (session_type, "x11") == 0)) {
c90517
                                 manager->priv->ran_once = TRUE;
c90517
                         }
c90517
                         maybe_start_pending_initial_login (manager, display);
c90517
                         break;
c90517
                 default:
c90517
                         break;
c90517
         }
c90517
 
c90517
 }
c90517
 
c90517
 static void
c90517
 on_display_removed (GdmDisplayStore *display_store,
c90517
                     GdmDisplay      *display,
c90517
                     GdmManager      *manager)
c90517
 {
c90517
         char    *id;
c90517
 
c90517
         gdm_display_get_id (display, &id, NULL);
c90517
         g_dbus_object_manager_server_unexport (manager->priv->object_manager, id);
c90517
         g_free (id);
c90517
 
c90517
         g_signal_handlers_disconnect_by_func (display, G_CALLBACK (on_display_status_changed), manager);
c90517
 
c90517
         g_signal_emit (manager, signals[DISPLAY_REMOVED], 0, display);
c90517
 }
c90517
 
c90517
 static void
c90517
 destroy_start_user_session_operation (StartUserSessionOperation *operation)
c90517
 {
c90517
         g_object_set_data (G_OBJECT (operation->session),
c90517
-- 
c90517
2.26.0
c90517