]> granicus.if.org Git - sudo/commitdiff
Do not need to open /dev/tty with O_NONBLOCK, it doesn't block on
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 16 May 2016 17:12:54 +0000 (11:12 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 16 May 2016 17:12:54 +0000 (11:12 -0600)
first open like a physical terminal.  By definition, if you have a
controlling tty, the first open (which might block) has already
occurred.

src/sudo.c

index 2217d6ae22d838eda5bbc83f3f27700b7c6496fc..d4bd688c3484c7372e2dbcbb74f250cb97028985 100644 (file)
@@ -506,7 +506,7 @@ get_user_info(struct user_details *ud)
     ud->ppid = getppid();
     ud->pgid = getpgid(0);
     ud->tcpgid = -1;
-    fd = open(_PATH_TTY, O_RDWR|O_NOCTTY|O_NONBLOCK, 0);
+    fd = open(_PATH_TTY, O_RDWR|O_NOCTTY, 0);
     if (fd != -1) {
        ud->tcpgid = tcgetpgrp(fd);
        close(fd);