]> granicus.if.org Git - sudo/commitdiff
fixed a typo that caused commands with no tty on fd 0 but a tty
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 9 Sep 1995 00:51:49 +0000 (00:51 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 9 Sep 1995 00:51:49 +0000 (00:51 +0000)
on fd 1 to erroneously have "none" as their tty

sudo.c

diff --git a/sudo.c b/sudo.c
index 2c538bc25e8dedab23fff133905021931d9c4e5d..958c77b4063edc5a1cd742a84d43181183114ce6 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -371,7 +371,7 @@ static void load_globals(sudo_mode)
     /*
      * Need to get tty early since it's used for logging
      */
-    if ((tty = (char *) ttyname(0)) || (tty = (char *) ttyname(0))) {
+    if ((tty = (char *) ttyname(0)) || (tty = (char *) ttyname(1))) {
        if (strncmp(tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
            tty += sizeof(_PATH_DEV) - 1;
        if ((tty = strdup(tty)) == NULL) {