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

Nicolas François nicolas.francois@centraliens.net
Tue, 31 May 2005 21:30:15 +0200


--UHN/qo2QbUvPLonB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello Tomasz,

Here is a second patch.

It pass the PAM_SILENT flag to pam_open_session in the case of a hushed
login.

More info at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=48002

Kind Regards,
-- 
Nekral

--UHN/qo2QbUvPLonB
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.

Index: shadow-4.0.3/src/login.c
===================================================================
--- shadow-4.0.3.orig/src/login.c	2005-05-28 22:21:29.434189000 +0200
+++ shadow-4.0.3/src/login.c	2005-05-28 22:21:32.774189000 +0200
@@ -889,11 +889,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 */

--UHN/qo2QbUvPLonB--