getting rid of the global pwent variable.
+2009-04-20 Nicolas François <nicolas.francois@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@centraliens.net>
* src/login.c: Added comments.
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);
(void) fflush (stdout);
}
-static void check_nologin (void)
+static void check_nologin (bool login_to_root)
{
char *fname;
* gets to login.
*/
- if (pwent.pw_uid != 0) {
+ if (!login_to_root) {
closelog ();
exit (0);
}
exit (1);
}
- check_nologin ();
+ check_nologin (pwent.pw_uid == 0);
#endif
if (getenv ("IFS")) { /* don't export user IFS ... */