]> granicus.if.org Git - shadow/commitdiff
* NEWS, src/login.c: Do not log in utmp / utmpx / wtmp when PAM is
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 23 Jul 2011 11:03:50 +0000 (11:03 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 23 Jul 2011 11:03:50 +0000 (11:03 +0000)
enabled. This is already done by pam_lastlog.

ChangeLog
NEWS
src/login.c

index d73f8930f14ad40d73d61284fd3d1241e0ebbfb3..d01e34bcca0b851839b03809c2a8f30d3ec1902c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-23  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, src/login.c: Do not log in utmp / utmpx / wtmp when PAM is
+       enabled. This is already done by pam_lastlog.
+
 2011-07-23  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/chpasswd.c: Add annotations to indicate that usage() does
diff --git a/NEWS b/NEWS
index dfc0349d6835e7a9e2fb1193b6fc0dad20a5dc8f..8179326b622ccf30ef1523fa98e76bffdba661a5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,8 @@ shadow-4.1.4.3 -> shadow-4.1.5                                        UNRELEASED
     list of TTYs.
   * Fixed warning and support for CONSOLE_GROUPS for users member of more
     than 16 groups.
+  * Do not log into utmp(x) or wtmp when PAM is enabled. This is done by
+    pam_lastlog.
 - su
   * Document the su exit values.
   * When su receives a signal, wait for the child to terminate (after
index c24fc860d7cfb4f75b790acefed37c4eeab9d93b..1328b127d2c4b2f903a640c58756ad5b25131310 100644 (file)
@@ -126,10 +126,12 @@ static void usage (void);
 static void setup_tty (void);
 static void process_flags (int argc, char *const *argv);
 static /*@observer@*/const char *get_failent_user (/*@returned@*/const char *user);
+#ifndef USE_PAM
 static void update_utmp (const char *user,
                          const char *tty,
                          const char *host,
                          /*@null@*/const struct utmp *utent);
+#endif                         /* ! USE_PAM */
 
 #ifndef USE_PAM
 static struct faillog faillog;
@@ -471,6 +473,7 @@ static /*@observer@*/const char *get_failent_user (/*@returned@*/const char *use
        return failent_user;
 }
 
+#ifndef USE_PAM
 /*
  * update_utmp - Update or create an utmp entry in utmp, wtmp, utmpw, and
  *               wtmpx
@@ -496,6 +499,7 @@ static void update_utmp (const char *user,
        free (utx);
 #endif                         /* USE_UTMPX */
 }
+#endif                         /* ! USE_PAM */
 
 /*
  * login - create a new login session for a user
@@ -1208,11 +1212,13 @@ int main (int argc, char **argv)
                }
        }
 
+#ifndef USE_PAM
        /*
         * The utmp entry needs to be updated to indicate the new status
         * of the session, the new PID and SID.
         */
        update_utmp (username, tty, hostname, utent);
+#endif                         /* ! USE_PAM */
 
        /* The pwd and spwd entries for the user have been copied.
         *