Blame SOURCES/0003-session-worker-uninitialize-pam-if-worker-is-killed.patch

675525
From db99c5181950f6f383b75e9956e170d3b2762d15 Mon Sep 17 00:00:00 2001
675525
From: Ray Strode <rstrode@redhat.com>
675525
Date: Mon, 24 Jun 2019 16:21:59 -0400
675525
Subject: [PATCH 3/7] session-worker: uninitialize pam if worker is killed
675525
675525
Right nowe don't uninitialize pam or switch back to the
675525
starting VT if the worker is killed before the session.
675525
675525
This commit fixes that.
675525
---
675525
 daemon/gdm-session-worker.c | 4 ++++
675525
 1 file changed, 4 insertions(+)
675525
675525
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
675525
index e526fa5db..f9bc82177 100644
675525
--- a/daemon/gdm-session-worker.c
675525
+++ b/daemon/gdm-session-worker.c
675525
@@ -3534,60 +3534,64 @@ gdm_session_worker_init (GdmSessionWorker *worker)
675525
 static void
675525
 gdm_session_worker_unwatch_child (GdmSessionWorker *worker)
675525
 {
675525
         if (worker->priv->child_watch_id == 0)
675525
                 return;
675525
 
675525
         g_source_remove (worker->priv->child_watch_id);
675525
         worker->priv->child_watch_id = 0;
675525
 }
675525
 
675525
 
675525
 static void
675525
 gdm_session_worker_finalize (GObject *object)
675525
 {
675525
         GdmSessionWorker *worker;
675525
 
675525
         g_return_if_fail (object != NULL);
675525
         g_return_if_fail (GDM_IS_SESSION_WORKER (object));
675525
 
675525
         worker = GDM_SESSION_WORKER (object);
675525
 
675525
         g_return_if_fail (worker->priv != NULL);
675525
 
675525
         gdm_session_worker_unwatch_child (worker);
675525
 
675525
         if (worker->priv->child_pid > 0) {
675525
                 gdm_signal_pid (worker->priv->child_pid, SIGTERM);
675525
                 gdm_wait_on_pid (worker->priv->child_pid);
675525
         }
675525
 
675525
+        if (worker->priv->pam_handle != NULL) {
675525
+                gdm_session_worker_uninitialize_pam (worker, PAM_SUCCESS);
675525
+        }
675525
+
675525
         g_object_unref (worker->priv->user_settings);
675525
         g_free (worker->priv->service);
675525
         g_free (worker->priv->x11_display_name);
675525
         g_free (worker->priv->x11_authority_file);
675525
         g_free (worker->priv->display_device);
675525
         g_free (worker->priv->display_seat_id);
675525
         g_free (worker->priv->hostname);
675525
         g_free (worker->priv->username);
675525
         g_free (worker->priv->server_address);
675525
         g_strfreev (worker->priv->arguments);
675525
         g_strfreev (worker->priv->extensions);
675525
 
675525
         g_hash_table_unref (worker->priv->reauthentication_requests);
675525
 
675525
         G_OBJECT_CLASS (gdm_session_worker_parent_class)->finalize (object);
675525
 }
675525
 
675525
 GdmSessionWorker *
675525
 gdm_session_worker_new (const char *address,
675525
                         gboolean    is_reauth_session)
675525
 {
675525
         GObject *object;
675525
 
675525
         object = g_object_new (GDM_TYPE_SESSION_WORKER,
675525
                                "server-address", address,
675525
                                "is-reauth-session", is_reauth_session,
675525
                                NULL);
675525
 
675525
         return GDM_SESSION_WORKER (object);
675525
 }
675525
-- 
675525
2.21.0
675525