summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-02-14 16:13:16 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2014-02-14 16:24:38 -0500
commit7c34b11869261870d3fba1ccb4d5471e43d3dbba (patch)
treece7c6f89dc8099d3cd7e667d46dc9fdd86fe5d45
parent793f22270bcdb0afaeb61b3d9ed0a9027c6c7fdc (diff)
downloadgdm-7c34b11869261870d3fba1ccb4d5471e43d3dbba.tar.gz
worker: Properly detect the error code from setting PAM_TTY
Without this, we'll look at the error code for the last set if we have an empty TTY, rather than the one for the current set.
-rw-r--r--daemon/gdm-session-worker.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 380e0f68..a664ebd3 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -1105,18 +1105,18 @@ gdm_session_worker_initialize_pam (GdmSessionWorker *worker,
pam_tty = _get_tty_for_pam (x11_display_name, display_device);
if (pam_tty != NULL && pam_tty[0] != '\0') {
error_code = pam_set_item (worker->priv->pam_handle, PAM_TTY, pam_tty);
- }
- if (error_code != PAM_SUCCESS) {
- g_debug ("error informing authentication system of user's console %s: %s",
- pam_tty,
- pam_strerror (worker->priv->pam_handle, error_code));
- g_free (pam_tty);
- g_set_error (error,
- GDM_SESSION_WORKER_ERROR,
- GDM_SESSION_WORKER_ERROR_AUTHENTICATING,
- "%s", "");
- goto out;
+ if (error_code != PAM_SUCCESS) {
+ g_debug ("error informing authentication system of user's console %s: %s",
+ pam_tty,
+ pam_strerror (worker->priv->pam_handle, error_code));
+ g_free (pam_tty);
+ g_set_error (error,
+ GDM_SESSION_WORKER_ERROR,
+ GDM_SESSION_WORKER_ERROR_AUTHENTICATING,
+ "%s", "");
+ goto out;
+ }
}
g_free (pam_tty);