[Pkg-shadow-commits] r3720 - in upstream/trunk: . libmisc src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Fri May 18 17:57:52 UTC 2012


Author: nekral-guest
Date: 2012-05-18 17:57:52 +0000 (Fri, 18 May 2012)
New Revision: 3720

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/libmisc/utmp.c
   upstream/trunk/src/login.c
Log:
	* NEWS, src/login.c: Log in utmp / utmpx / wtmp also when PAM is
	enabled. This is not done by pam_lastlog. This was broken on
	2011-07-23.
	* NEWS, libmisc/utmp.c: Do not log in wtmp when PAM is enabled.
	This is done by pam_lastlog.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2012-05-17 09:17:53 UTC (rev 3719)
+++ upstream/trunk/ChangeLog	2012-05-18 17:57:52 UTC (rev 3720)
@@ -1,3 +1,11 @@
+2012-05-17  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* NEWS, src/login.c: Log in utmp / utmpx / wtmp also when PAM is
+	enabled. This is not done by pam_lastlog. This was broken on
+	2011-07-23.
+	* NEWS, libmisc/utmp.c: Do not log in wtmp when PAM is enabled.
+	This is done by pam_lastlog.
+
 2012-05-17  Christian Perrier  <bubulle@Êebian.org>
 
 	* man/po/fr.po: French translation of manpages completed

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2012-05-17 09:17:53 UTC (rev 3719)
+++ upstream/trunk/NEWS	2012-05-18 17:57:52 UTC (rev 3720)
@@ -2,8 +2,10 @@
 
 shadow-4.1.5 -> shadow-4.1.5.1					UNRELEASED
 
+- login
+  * Log into utmp(x) when PAM is enabled, but do not log into wtmp.
+    This complete pam_lastlog which logs into wtmp and in into utmp(x).
 
-
 shadow-4.1.4.3 -> shadow-4.1.5					2012-02-12
 
 *** security

Modified: upstream/trunk/libmisc/utmp.c
===================================================================
--- upstream/trunk/libmisc/utmp.c	2012-05-17 09:17:53 UTC (rev 3719)
+++ upstream/trunk/libmisc/utmp.c	2012-05-18 17:57:52 UTC (rev 3720)
@@ -129,6 +129,7 @@
 	return ret;
 }
 
+#ifndef USE_PAM
 /*
  * Some systems already have updwtmp() and possibly updwtmpx().  Others
  * don't, so we re-implement these functions if necessary.
@@ -160,6 +161,7 @@
 }
 #endif				/* ! HAVE_UPDWTMPX */
 #endif				/* ! USE_UTMPX */
+#endif				/* ! USE_PAM */
 
 
 /*
@@ -313,7 +315,10 @@
 	}
 	endutent ();
 
+#ifndef USE_PAM
+	/* This is done by pam_lastlog */
 	updwtmp (_WTMP_FILE, ut);
+#endif				/* ! USE_PAM */
 
 	return err;
 }
@@ -446,7 +451,10 @@
 	}
 	endutxent ();
 
+#ifndef USE_PAM
+	/* This is done by pam_lastlog */
 	updwtmpx (_WTMP_FILE "x", utx);
+#endif				/* ! USE_PAM */
 
 	return err;
 }

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2012-05-17 09:17:53 UTC (rev 3719)
+++ upstream/trunk/src/login.c	2012-05-18 17:57:52 UTC (rev 3720)
@@ -126,12 +126,10 @@
 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;
@@ -473,7 +471,6 @@
 	return failent_user;
 }
 
-#ifndef USE_PAM
 /*
  * update_utmp - Update or create an utmp entry in utmp, wtmp, utmpw, and
  *               wtmpx
@@ -499,7 +496,6 @@
 	free (utx);
 #endif				/* USE_UTMPX */
 }
-#endif				/* ! USE_PAM */
 
 /*
  * login - create a new login session for a user
@@ -1215,13 +1211,11 @@
 		}
 	}
 
-#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.
 	 *




More information about the Pkg-shadow-commits mailing list