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