_exit (1);
}
-/*
- * syslogd is usually not running at the time when sulogin is typically
- * called, cluttering the screen with unnecessary messages. Suggested by
- * Ivan Nejgebauer <ian@unsux.ns.ac.yu>. --marekm
- */
-#undef USE_SYSLOG
-
/*ARGSUSED*/ int main (int argc, char **argv)
{
#ifndef USE_PAM
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
-#ifdef USE_SYSLOG
- OPENLOG ("sulogin");
-#endif
initenv ();
if (argc > 1) {
close (0);
dup (0);
dup (0);
} else {
-#ifdef USE_SYSLOG
- SYSLOG (LOG_WARN, "cannot open %s\n", argv[1]);
- closelog ();
-#endif
exit (1);
}
}
if (access (PASSWD_FILE, F_OK) == -1) { /* must be a password file! */
(void) puts (_("No password file"));
-#ifdef USE_SYSLOG
- SYSLOG (LOG_WARN, "No password file\n");
- closelog ();
-#endif
exit (1);
}
#if !defined(DEBUG) && defined(SULOGIN_ONLY_INIT)
if (getppid () != 1) { /* parent must be INIT */
-#ifdef USE_SYSLOG
- SYSLOG (LOG_WARN, "Pid == %d, not 1\n", getppid ());
- closelog ();
-#endif
exit (1);
}
#endif
if ((isatty (0) == 0) || (isatty (1) == 0) || (isatty (2) == 0)) {
-#ifdef USE_SYSLOG
- closelog ();
-#endif
exit (1); /* must be a terminal */
}
/* If we were init, we need to start a new session */
* Fail secure
*/
(void) puts (_("No password entry for 'root'"));
-#ifdef USE_SYSLOG
- SYSLOG (LOG_WARN, "No password entry for 'root'\n");
- closelog ();
-#endif
exit (1);
}
*/
if ((NULL == cp) || ('\0' == *cp)) {
erase_pass (cp);
-#ifdef USE_SYSLOG
- SYSLOG (LOG_INFO, "Normal startup\n");
- closelog ();
-#endif
(void) puts ("");
#ifdef TELINIT
execl (PATH_TELINIT, "telinit", RUNLEVEL, (char *) 0);
break; /* ... encrypted passwords matched */
}
-#ifdef USE_SYSLOG
- SYSLOG (LOG_WARN, "Incorrect root password\n");
-#endif
sleep (2);
(void) puts (_("Login incorrect"));
}
environ = newenvp; /* make new environment active */
(void) puts (_("Entering System Maintenance Mode"));
-#ifdef USE_SYSLOG
- SYSLOG (LOG_INFO, "System Maintenance Mode\n");
-#endif
-#ifdef USE_SYSLOG
- closelog ();
-#endif
/* exec the shell finally. */
err = shell (pwent.pw_shell, (char *) 0, environ);