Blame SOURCES/0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch

a41c53
From 56d12ad9697d5695c780a5be0065d23fec6bd1a5 Mon Sep 17 00:00:00 2001
a41c53
From: Chingkai Chu <3013329+chuchingkai@users.noreply.github.com>
a41c53
Date: Thu, 12 Aug 2021 10:34:01 +0800
a41c53
Subject: [PATCH] session-worker: Set session_vt=0 out of pam uninitialization
a41c53
a41c53
MR GNOME/gdm!123 moved jump_to_vt and session_vt reseting to a
a41c53
separate function, so we don't need to reset session_vt in pam
a41c53
uninitialization.
a41c53
a41c53
https://gitlab.gnome.org/GNOME/gdm/-/issues/719
a41c53
---
a41c53
 daemon/gdm-session-worker.c | 2 --
a41c53
 1 file changed, 2 deletions(-)
a41c53
a41c53
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
a41c53
index c1201b70..9cff53a5 100644
a41c53
--- a/daemon/gdm-session-worker.c
a41c53
+++ b/daemon/gdm-session-worker.c
a41c53
@@ -1076,62 +1076,60 @@ gdm_session_worker_set_state (GdmSessionWorker      *worker,
a41c53
 
a41c53
 static void
a41c53
 gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
a41c53
                                      int               status)
a41c53
 {
a41c53
         g_debug ("GdmSessionWorker: uninitializing PAM");
a41c53
 
a41c53
         if (worker->priv->pam_handle == NULL)
a41c53
                 return;
a41c53
 
a41c53
         gdm_session_worker_get_username (worker, NULL);
a41c53
 
a41c53
         if (worker->priv->state >= GDM_SESSION_WORKER_STATE_SESSION_OPENED) {
a41c53
                 pam_close_session (worker->priv->pam_handle, 0);
a41c53
                 gdm_session_auditor_report_logout (worker->priv->auditor);
a41c53
         } else {
a41c53
                 gdm_session_auditor_report_login_failure (worker->priv->auditor,
a41c53
                                                           status,
a41c53
                                                           pam_strerror (worker->priv->pam_handle, status));
a41c53
         }
a41c53
 
a41c53
         if (worker->priv->state >= GDM_SESSION_WORKER_STATE_ACCREDITED) {
a41c53
                 pam_setcred (worker->priv->pam_handle, PAM_DELETE_CRED);
a41c53
         }
a41c53
 
a41c53
         pam_end (worker->priv->pam_handle, status);
a41c53
         worker->priv->pam_handle = NULL;
a41c53
 
a41c53
         gdm_session_worker_stop_auditor (worker);
a41c53
 
a41c53
-        worker->priv->session_vt = 0;
a41c53
-
a41c53
         g_debug ("GdmSessionWorker: state NONE");
a41c53
         gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_NONE);
a41c53
 }
a41c53
 
a41c53
 static char *
a41c53
 _get_tty_for_pam (const char *x11_display_name,
a41c53
                   const char *display_device)
a41c53
 {
a41c53
 #ifdef __sun
a41c53
         return g_strdup (display_device);
a41c53
 #else
a41c53
         return g_strdup (x11_display_name);
a41c53
 #endif
a41c53
 }
a41c53
 
a41c53
 #ifdef PAM_XAUTHDATA
a41c53
 static struct pam_xauth_data *
a41c53
 _get_xauth_for_pam (const char *x11_authority_file)
a41c53
 {
a41c53
         FILE                  *fh;
a41c53
         Xauth                 *auth = NULL;
a41c53
         struct pam_xauth_data *retval = NULL;
a41c53
         gsize                  len = sizeof (*retval) + 1;
a41c53
 
a41c53
         fh = fopen (x11_authority_file, "r");
a41c53
         if (fh) {
a41c53
                 auth = XauReadAuth (fh);
a41c53
                 fclose (fh);
a41c53
         }
a41c53
         if (auth) {
a41c53
-- 
a41c53
2.31.1
a41c53