sudo_term_raw: change the isig argument into a flags field

There are current two flags: SUDO_TERM_ISIG (enable terminal signals)
and SUDO_TERM_OFLAG (preserve output flags).
This commit is contained in:
Todd C. Miller
2023-07-14 13:12:51 -06:00
parent ff6ddff39b
commit 625653de08
3 changed files with 16 additions and 6 deletions

View File

@@ -629,7 +629,7 @@ setup_terminal(struct eventlog *evlog, bool interactive, bool resize)
/* Open fd for /dev/tty and set to raw mode. */
if (interactive) {
ttyfd = open(_PATH_TTY, O_RDWR);
while (!sudo_term_raw(ttyfd, 1)) {
while (!sudo_term_raw(ttyfd, SUDO_TERM_ISIG)) {
if (errno != EINTR)
sudo_fatal("%s", U_("unable to set tty to raw mode"));
kill(getpid(), SIGTTOU);