summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2009-04-08 08:22:45 +0000
committerBrian Cameron <bcameron@src.gnome.org>2009-04-08 08:22:45 +0000
commit84b52658215a22c55625896d932cb8e6416ef407 (patch)
treec13111074e88e901ea43b61cce09888841823faa /daemon
parent1b644de142a1ebc66e51d500cdf1f69007ba048c (diff)
downloadgdm-84b52658215a22c55625896d932cb8e6416ef407.tar.gz
Correct reversed if-test. Fix setting of PAM_TTY on Solaris. Also make
2009-04-08 Brian Cameron <brian.cameron@sun.com> * daemon/gdm-session-solaris-auditor.c: Correct reversed if-test. * daemon/gdm-session-worker.c: Fix setting of PAM_TTY on Solaris. Also make sure that the auditor is provided the username on failed login by getting PAM_USER. Without this patch, if you select the "Other" button and have a failed login, username will not be set. svn path=/trunk/; revision=6803
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-session-solaris-auditor.c12
-rw-r--r--daemon/gdm-session-worker.c10
2 files changed, 16 insertions, 6 deletions
diff --git a/daemon/gdm-session-solaris-auditor.c b/daemon/gdm-session-solaris-auditor.c
index d8eb6379..badbdbba 100644
--- a/daemon/gdm-session-solaris-auditor.c
+++ b/daemon/gdm-session-solaris-auditor.c
@@ -177,17 +177,17 @@ gdm_session_solaris_auditor_report_login_failure (GdmSessionAuditor *auditor,
/* If display is on console or VT */
if (hostname != NULL && hostname[0] != '\0') {
- /* login from the local host */
- if (adt_load_ttyname (display_device, &tid) != 0) {
- syslog (LOG_AUTH | LOG_ALERT,
- "adt_loadhostname (localhost): %m");
- }
- } else {
/* Login from a remote host */
if (adt_load_hostname (hostname, &tid) != 0) {
syslog (LOG_AUTH | LOG_ALERT,
"adt_loadhostname (%s): %m", hostname);
}
+ } else {
+ /* login from the local host */
+ if (adt_load_ttyname (display_device, &tid) != 0) {
+ syslog (LOG_AUTH | LOG_ALERT,
+ "adt_loadhostname (localhost): %m");
+ }
}
if (adt_set_user (ah,
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index ea4b8bde..fa39c3b2 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -978,6 +978,12 @@ gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
pam_close_session (worker->priv->pam_handle, 0);
gdm_session_auditor_report_logout (worker->priv->auditor);
} else {
+ void *p;
+
+ if ((pam_get_item (worker->priv->pam_handle, PAM_USER, &p)) == PAM_SUCCESS) {
+ gdm_session_auditor_set_username (worker->priv->auditor, (const char *)p);
+ }
+
gdm_session_auditor_report_login_failure (worker->priv->auditor,
status,
pam_strerror (worker->priv->pam_handle, status));
@@ -1000,7 +1006,11 @@ static char *
_get_tty_for_pam (const char *x11_display_name,
const char *display_device)
{
+#ifdef __sun
+ return g_strdup (display_device);
+#else
return g_strdup (x11_display_name);
+#endif
}
#ifdef PAM_XAUTHDATA