diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-11-23 06:54:26 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-11-23 06:54:26 +0000 |
commit | 1adbde560fb6f91905196757f863bcc3013bfae5 (patch) | |
tree | 252786f64f7728dec325ed9af62aac30c5910d39 | |
parent | feddd4907d404f4be5f02e4eb558e3eaa8662a9c (diff) |
define tty global to an initial value to avoid dumping core in logging
functions when passwd file is unavailable.
-rw-r--r-- | gnu/usr.bin/sudo/sudo/sudo.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gnu/usr.bin/sudo/sudo/sudo.c b/gnu/usr.bin/sudo/sudo/sudo.c index c1615a47469..75c8bde1059 100644 --- a/gnu/usr.bin/sudo/sudo/sudo.c +++ b/gnu/usr.bin/sudo/sudo/sudo.c @@ -51,7 +51,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sudo.c,v 1.3 1997/04/12 07:18:56 millert Exp $"; +static char rcsid[] = "$Id: sudo.c,v 1.4 1997/11/23 06:54:25 millert Exp $"; #endif /* lint */ #define MAIN @@ -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); |