]> granicus.if.org Git - sudo/commitdiff
define tty global to an initial value to avoid dumping core in logging
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 23 Nov 1997 06:53:37 +0000 (06:53 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 23 Nov 1997 06:53:37 +0000 (06:53 +0000)
functions when passwd file is unavailable.

sudo.c

diff --git a/sudo.c b/sudo.c
index ac3d2ae58223c160ecfd0103ecfd4467a813d6e5..8342ce59f2537a519bf14ca3c6dc1c582194d2e4 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -144,7 +144,7 @@ struct passwd *user_pw_ent;
 char *runas_user = "root";
 char *cmnd = NULL;
 char *cmnd_args = NULL;
-char *tty = NULL;
+char *tty = "unknown";
 char *prompt;
 char host[MAXHOSTNAMELEN + 1];
 char *shost;
@@ -441,8 +441,7 @@ static void load_globals(sudo_mode)
            (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
            exit(1);
        }
-    } else
-       tty = "none";
+    }
 
 #ifdef UMASK
     (void) umask((mode_t)UMASK);