gdm r6803 - in trunk: . daemon



Author: bcameron
Date: Wed Apr  8 08:22:45 2009
New Revision: 6803
URL: http://svn.gnome.org/viewvc/gdm?rev=6803&view=rev

Log:
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.


Modified:
   trunk/ChangeLog
   trunk/daemon/gdm-session-solaris-auditor.c
   trunk/daemon/gdm-session-worker.c

Modified: trunk/daemon/gdm-session-solaris-auditor.c
==============================================================================
--- trunk/daemon/gdm-session-solaris-auditor.c	(original)
+++ trunk/daemon/gdm-session-solaris-auditor.c	Wed Apr  8 08:22:45 2009
@@ -177,17 +177,17 @@
 
                 /* 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,

Modified: trunk/daemon/gdm-session-worker.c
==============================================================================
--- trunk/daemon/gdm-session-worker.c	(original)
+++ trunk/daemon/gdm-session-worker.c	Wed Apr  8 08:22:45 2009
@@ -978,6 +978,12 @@
                 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 @@
 _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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]