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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sun Apr 12 00:08:26 UTC 2009


Author: nekral-guest
Date: 2009-04-12 00:08:26 +0000 (Sun, 12 Apr 2009)
New Revision: 2663

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/login.c
Log:
	* src/login.c: Fix the count of failures before login exits in
	case of PAM enabled configurations.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-11 23:37:38 UTC (rev 2662)
+++ upstream/trunk/ChangeLog	2009-04-12 00:08:26 UTC (rev 2663)
@@ -1,5 +1,10 @@
 2009-04-12  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/login.c: Fix the count of failures before login exits in
+	case of PAM enabled configurations.
+
+2009-04-12  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* man/passwd.1.xml: Document that passwd uses PAM to authenticate
 	and change passwords on PAM-enabled builds.
 

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2009-04-11 23:37:38 UTC (rev 2662)
+++ upstream/trunk/src/login.c	2009-04-12 00:08:26 UTC (rev 2663)
@@ -726,7 +726,7 @@
 				failent_user = "UNKNOWN";
 			}
 
-			if (retcode == PAM_MAXTRIES || failcount >= retries) {
+			if (retcode == PAM_MAXTRIES) {
 				SYSLOG ((LOG_NOTICE,
 				         "TOO MANY LOGIN TRIES (%d)%s FOR '%s'",
 				         failcount, fromhost, failent_user));
@@ -769,6 +769,17 @@
 
 			fprintf (stderr, "\nLogin incorrect\n");
 
+			if (failcount >= retries) {
+				SYSLOG ((LOG_NOTICE,
+				         "TOO MANY LOGIN TRIES (%d)%s FOR '%s'",
+				         failcount, fromhost, failent_user));
+				fprintf(stderr,
+				        _("Maximum number of tries exceeded (%d)\n"),
+				        failcount);
+				PAM_END;
+				exit(0);
+			}
+
 			/*
 			 * Let's give it another go around.
 			 * Even if a username was given on the command




More information about the Pkg-shadow-commits mailing list