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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Mon Apr 20 12:33:01 UTC 2009


Author: nekral-guest
Date: 2009-04-20 12:33:01 +0000 (Mon, 20 Apr 2009)
New Revision: 2722

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/login.c
Log:
	* src/login.c: Added parameter to check_nologin. This will help
	getting rid of the global pwent variable.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-20 12:27:27 UTC (rev 2721)
+++ upstream/trunk/ChangeLog	2009-04-20 12:33:01 UTC (rev 2722)
@@ -1,5 +1,10 @@
 2009-04-20  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/login.c: Added parameter to check_nologin. This will help
+	getting rid of the global pwent variable.
+
+2009-04-20  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/login.c: Added comments.
 	* src/login.c: Close the user and group files before dropping root
 	privileges.

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2009-04-20 12:27:27 UTC (rev 2721)
+++ upstream/trunk/src/login.c	2009-04-20 12:33:01 UTC (rev 2722)
@@ -134,7 +134,7 @@
 static struct faillog faillog;
 
 static void bad_time_notify (void);
-static void check_nologin (void);
+static void check_nologin (bool login_to_root);
 #endif
 
 static void init_env (void);
@@ -205,7 +205,7 @@
 	(void) fflush (stdout);
 }
 
-static void check_nologin (void)
+static void check_nologin (bool login_to_root)
 {
 	char *fname;
 
@@ -244,7 +244,7 @@
 		 * gets to login.
 		 */
 
-		if (pwent.pw_uid != 0) {
+		if (!login_to_root) {
 			closelog ();
 			exit (0);
 		}
@@ -1064,7 +1064,7 @@
 		exit (1);
 	}
 
-	check_nologin ();
+	check_nologin (pwent.pw_uid == 0);
 #endif
 
 	if (getenv ("IFS")) {	/* don't export user IFS ... */




More information about the Pkg-shadow-commits mailing list