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

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


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

On Tue, May 31, 2005 at 09:30:15PM +0200, Nicolas Fran=E7ois wrote:
> Hello Tomasz,
>=20
> Here is a second patch.
>=20
> It pass the PAM_SILENT flag to pam_open_session in the case of a hushed
> login.
>=20
> More info at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D48002

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

--=20
Nekral

--zx4FCpZtqtKETZ7O
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=008_login_PAM_SILENT_if_hushed_login

Goal: check for hushed login and pass PAM_SILENT if true,
Fixes: #48002

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:40:30.000000000 +0200
@@ -703,11 +703,14 @@
 
 		if (!pwd || setup_groups (pwd))
 			exit (1);
+		else
+		        pwent = *pwd;
 
 		retcode = pam_setcred (pamh, PAM_ESTABLISH_CRED);
 		PAM_FAIL_CHECK;
 
-		retcode = pam_open_session (pamh, 0);
+		retcode = pam_open_session (pamh,
+					    hushed(&pwent) ? PAM_SILENT : 0);
 		PAM_FAIL_CHECK;
 
 #else				/* ! USE_PAM */

--zx4FCpZtqtKETZ7O--