O_NOCTTY has no effect when opening /dev/tty as the open can only

succeed if there is already a controlling tty.
This commit is contained in:
Todd C. Miller
2016-05-16 11:17:20 -06:00
parent 3b39377246
commit a2e541aef8
5 changed files with 6 additions and 6 deletions

View File

@@ -562,7 +562,7 @@ dispatch_signal(struct sudo_event_base *evbase, pid_t child,
sigaction_t sa, osa;
pid_t saved_pgrp = -1;
int signo = WSTOPSIG(status);
int fd = open(_PATH_TTY, O_RDWR|O_NOCTTY, 0);
int fd = open(_PATH_TTY, O_RDWR);
if (fd != -1) {
saved_pgrp = tcgetpgrp(fd);
if (saved_pgrp == -1) {