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

@@ -181,7 +181,7 @@ pty_setup(uid_t uid, const char *tty, const char *utmp_user)
{
debug_decl(pty_setup, SUDO_DEBUG_EXEC);
io_fds[SFD_USERTTY] = open(_PATH_TTY, O_RDWR|O_NOCTTY, 0);
io_fds[SFD_USERTTY] = open(_PATH_TTY, O_RDWR);
if (io_fds[SFD_USERTTY] != -1) {
if (!get_pty(&io_fds[SFD_MASTER], &io_fds[SFD_SLAVE],
slavename, sizeof(slavename), uid))