From 4b4e2b792923136db3d3635c315accec385ab972 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 23 Nov 1997 06:53:37 +0000 Subject: [PATCH] define tty global to an initial value to avoid dumping core in logging functions when passwd file is unavailable. --- sudo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); -- 2.40.0