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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sun Apr 19 16:09:00 UTC 2009


Author: nekral-guest
Date: 2009-04-19 16:09:00 +0000 (Sun, 19 Apr 2009)
New Revision: 2710

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/login.c
Log:
	* src/login.c: fflg is already restricted to root. Move
	pam_acct_mgmt(), in case of fflg, earlier. This is equivalent and
	simplifies the code.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-19 15:28:38 UTC (rev 2709)
+++ upstream/trunk/ChangeLog	2009-04-19 16:09:00 UTC (rev 2710)
@@ -1,3 +1,9 @@
+2009-04-19  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* src/login.c: fflg is already restricted to root. Move
+	pam_acct_mgmt(), in case of fflg, earlier. This is equivalent and
+	simplifies the code.
+
 2009-04-19  Paul Szabo  <psz at maths.usyd.edu.au>
 
 	* libmisc/utmp.c: Always call endutent or endutxent when setutent

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2009-04-19 15:28:38 UTC (rev 2709)
+++ upstream/trunk/src/login.c	2009-04-19 16:09:00 UTC (rev 2710)
@@ -670,7 +670,7 @@
 	PAM_FAIL_CHECK;
 #endif
 	/* if fflg, then the user has already been authenticated */
-	if (!fflg || (getuid () != 0)) {
+	if (!fflg) {
 		int failcount = 0;
 		char hostn[256];
 		char loginprompt[256];	/* That's one hell of a prompt :) */
@@ -818,6 +818,9 @@
 		}
 
 		PAM_FAIL_CHECK;
+	} else (fflg) {
+		retcode = pam_acct_mgmt (pamh, 0);
+		PAM_FAIL_CHECK;
 	}
 
 	/* Grab the user information out of the password file for future usage
@@ -838,11 +841,6 @@
 		exit (1);
 	}
 
-	if (fflg) {
-		retcode = pam_acct_mgmt (pamh, 0);
-		PAM_FAIL_CHECK;
-	}
-
 	if (setup_groups (pwd) != 0) {
 		exit (1);
 	}




More information about the Pkg-shadow-commits mailing list