getty: Disable VINTR + VEOF, re-enable before calling /bin/login

This patch makes the Finit built-in getty behave a bit more like other
getty implementations.  We now not only disable ISIG but also VEOF and
VINTR when prearing the TTY for the getty (built-in or external).

Like before, it is up to the getty process to leave the TTY in a
usable state to /bin/login, so we also move the stty() call to
just before calling /bin/login in getty.c

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-10-29 16:11:59 +01:00
1 parent faf0c680b8
commit d31575538c
2 files changed
+30 -7

No files matched your search

+8 -6
View File
@@ -300,18 +300,20 @@ int getty(char *tty, char *baud, char *term, char *user)
sigaction(SIGINT, &sa, NULL);
sigaction(SIGQUIT, &sa, NULL);
/* Set up TTY */
stty(fd, speed);
close(fd);
/* The getty process is responsible for the UTMP login record */
utmp_set_login(tty, NULL);
if (term)
setenv("TERM", term, 1);
if (!user)
do_getty(tty, name, sizeof(name));
else
strlcpy(name, user, sizeof(name));
/* Set up TTY, re-enabling ISIG et al. */
stty(fd, speed);
close(fd);
if (term)
setenv("TERM", term, 1);
return do_login(name);
}