[Pkg-shadow-devel] patch for login - 1

Nicolas François nicolas.francois@centraliens.net
Wed, 1 Jun 2005 22:48:15 +0200


--rQ2U398070+RC21q
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 31, 2005 at 09:22:42PM +0200, Nicolas Fran=E7ois wrote:
> When PAM is used, the username is in pam_user, not username.
> This fix the log of successful logins (LOG_OK_LOGINS).
>=20
> More info at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D47819

An update, so it can be applied silently to upstream's CVS

--
Nekral

--rQ2U398070+RC21q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=008_login_log_pam_user_if_USE_PAM

Goal: fixed loggin of username on succesful login (was using
      the normal username, when it should have used pam_user)
Fixes: #47819

Status wrt upstream: It should be forwarded to upstream.

--- login.c.orig	2005-06-01 21:37:17.000000000 +0200
+++ login.c	2005-06-01 21:38:51.000000000 +0200
@@ -1075,7 +1075,11 @@
 	if (pwent.pw_uid == 0)
 		SYSLOG ((LOG_NOTICE, "ROOT LOGIN %s", fromhost));
 	else if (getdef_bool ("LOG_OK_LOGINS"))
+#ifdef USE_PAM
+		SYSLOG ((LOG_INFO, "`%s' logged in %s", pam_user, fromhost));
+#else
 		SYSLOG ((LOG_INFO, "`%s' logged in %s", username, fromhost));
+#endif
 	closelog ();
 	if ((tmp = getdef_str ("FAKE_SHELL")) != NULL) {
 		shell (tmp, pwent.pw_shell);	/* fake shell */

--rQ2U398070+RC21q--