}
if (0 != killed) {
- (void) putchar ('\n');
- (void) fflush (stdout);
- exit (killed);
+ (void) write (STDOUT_FILENO, "\n", 1);
+ _exit (killed);
}
}
static bool preauth_flag = false;
static bool amroot;
-static unsigned int timeout;
+static char tmsg[256];
/*
* External identifiers.
static RETSIGTYPE alarm_handler (unused int sig)
{
- fprintf (stderr, _("\nLogin timed out after %u seconds.\n"), timeout);
- exit (0);
+ write (STDERR_FILENO, tmsg, strlen (tmsg));
+ _exit (0);
}
#ifdef USE_PAM
bool is_console;
#endif
int err;
+ unsigned int timeout;
const char *cp;
const char *tmp;
char fromhost[512];
top:
/* only allow ALARM sec. for login */
- (void) signal (SIGALRM, alarm_handler);
timeout = getdef_unum ("LOGIN_TIMEOUT", ALARM);
+ snprintf (tmsg, sizeof tmsg,
+ _("\nLogin timed out after %u seconds.\n"), timeout);
+ (void) signal (SIGALRM, alarm_handler);
if (timeout > 0) {
(void) alarm (timeout);
}
static bool change_environment = true;
#ifdef USE_PAM
+static char kill_msg[256];
+static char wait_msg[256];
static pam_handle_t *pamh = NULL;
static int caught = 0;
/* PID of the child, in case it needs to be killed */
}
if (killed != 0) {
- closelog ();
- exit (128+killed);
+ _exit (128+killed);
}
}
{
if (0 != pid_child) {
(void) kill (-pid_child, SIGKILL);
- (void) fputs (_(" ...killed.\n"), stderr);
+ (void) write (STDERR_FILENO, kill_msg, strlen (kill_msg));
} else {
- (void) fputs (_(" ...waiting for child to terminate.\n"),
- stderr);
+ (void) write (STDERR_FILENO, wait_msg, strlen (wait_msg));
}
- exit (255);
+ _exit (255);
}
#endif /* USE_PAM */
stderr);
(void) kill (-pid_child, caught);
+ snprintf (kill_msg, _(" ...killed.\n"));
+ snprintf (wait_msg, _(" ...waiting for child to terminate.\n"));
+
(void) signal (SIGALRM, kill_child);
(void) alarm (2);