diff options
author | Ray Strode <rstrode@redhat.com> | 2009-10-28 16:05:14 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2011-03-08 00:39:13 -0500 |
commit | cb6ce72d901d6b4eef629de3548c25177e10029a (patch) | |
tree | 102f0614d9efd3ec1f321292d688b7558ba79a2d | |
parent | 412ec369b1006a95ed99507fece88de441ae5fe9 (diff) | |
download | gdm-cb6ce72d901d6b4eef629de3548c25177e10029a.tar.gz |
Return a different error code for "service won't work" than "auth failed"
If we bubble it up to the greeter then we should be able to have
a more sensible UI when e.g. fingerprinting isn't enabled.
-rw-r--r-- | daemon/gdm-session-worker.c | 14 | ||||
-rw-r--r-- | daemon/gdm-session-worker.h | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c index 617c69cd..0277aaba 100644 --- a/daemon/gdm-session-worker.c +++ b/daemon/gdm-session-worker.c @@ -1060,8 +1060,8 @@ gdm_session_worker_initialize_pam (GdmSessionWorker *worker, */ g_set_error (error, GDM_SESSION_WORKER_ERROR, - GDM_SESSION_WORKER_ERROR_AUTHENTICATING, - _("error initiating conversation with authentication system: %s"), + GDM_SESSION_WORKER_ERROR_SERVICE_UNAVAILABLE, + _("error initiating conversation with authentication system - %s"), error_code == PAM_ABORT? _("general failure") : error_code == PAM_BUF_ERR? _("out of memory") : error_code == PAM_SYSTEM_ERR? _("application programmer error") : @@ -1172,7 +1172,15 @@ gdm_session_worker_authenticate_user (GdmSessionWorker *worker, /* blocking call, does the actual conversation */ error_code = pam_authenticate (worker->priv->pam_handle, authentication_flags); - if (error_code != PAM_SUCCESS) { + if (error_code == PAM_AUTHINFO_UNAVAIL) { + g_debug ("GdmSessionWorker: authentication service unavailable"); + + g_set_error (error, + GDM_SESSION_WORKER_ERROR, + GDM_SESSION_WORKER_ERROR_SERVICE_UNAVAILABLE, + "%s", pam_strerror (worker->priv->pam_handle, error_code)); + goto out; + } else if (error_code != PAM_SUCCESS) { g_debug ("GdmSessionWorker: authentication returned %d: %s", error_code, pam_strerror (worker->priv->pam_handle, error_code)); /* diff --git a/daemon/gdm-session-worker.h b/daemon/gdm-session-worker.h index ee5465aa..b1c8285c 100644 --- a/daemon/gdm-session-worker.h +++ b/daemon/gdm-session-worker.h @@ -41,6 +41,7 @@ typedef enum _GdmSessionWorkerError { GDM_SESSION_WORKER_ERROR_OPENING_MESSAGE_PIPE, GDM_SESSION_WORKER_ERROR_COMMUNICATING, GDM_SESSION_WORKER_ERROR_WORKER_DIED, + GDM_SESSION_WORKER_ERROR_SERVICE_UNAVAILABLE, GDM_SESSION_WORKER_ERROR_AUTHENTICATING, GDM_SESSION_WORKER_ERROR_AUTHORIZING, GDM_SESSION_WORKER_ERROR_OPENING_LOG_FILE, |