]> granicus.if.org Git - sudo/commitdiff
add O_NOCTTY when opening /dev/tty just in case
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 7 Oct 1999 21:13:45 +0000 (21:13 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 7 Oct 1999 21:13:45 +0000 (21:13 +0000)
tgetpass.c

index 9a169c2bc2fe32ff12f50b0bffbd0da2d4fcf663..7329f640224efeec1e726aa9c2a602cf6e0e16a9 100644 (file)
 #define TCSASOFT       0
 #endif /* TCSASOFT */
 
+#ifndef O_NOCTTY
+#define O_NOCTTY       0
+#endif /* O_NOCTTY */
+
 #ifndef lint
 static const char rcsid[] = "$Sudo$";
 #endif /* lint */
@@ -106,7 +110,7 @@ tgetpass(prompt, timeout, echo_off)
     struct timeval tv;
 
     /* Open /dev/tty for reading/writing if possible else use stdin/stderr. */
-    if ((input = output = open(_PATH_TTY, O_RDWR)) == -1) {
+    if ((input = output = open(_PATH_TTY, O_RDWR|O_NOCTTY)) == -1) {
        input = STDIN_FILENO;
        output = STDERR_FILENO;
     }