summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-11-23 06:54:26 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-11-23 06:54:26 +0000
commit1adbde560fb6f91905196757f863bcc3013bfae5 (patch)
tree252786f64f7728dec325ed9af62aac30c5910d39
parentfeddd4907d404f4be5f02e4eb558e3eaa8662a9c (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.c7
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);