From: Todd C. Miller Date: Sun, 23 Nov 1997 06:53:37 +0000 (+0000) Subject: define tty global to an initial value to avoid dumping core in logging X-Git-Tag: SUDO_1_5_4~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b4e2b792923136db3d3635c315accec385ab972;p=sudo define tty global to an initial value to avoid dumping core in logging functions when passwd file is unavailable. --- diff --git a/sudo.c b/sudo.c index ac3d2ae58..8342ce59f 100644 --- 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);