summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-08 18:36:57 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-08 18:36:57 +0000
commit918a079dcbd7c72522df052a1a08f6ecd75d9a24 (patch)
tree06d1a1c0ef22824b3c5f9043fdf4445116fa46a5 /usr.bin
parenta6ddf763044ea546817a218979561f97c719d5e4 (diff)
export $TERM only if passed in; joerg@freebsd.org
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/su/su.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index 59321be1cce..6c23ab545f6 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: su.c,v 1.5 1996/07/22 01:58:55 deraadt Exp $ */
+/* $OpenBSD: su.c,v 1.6 1996/10/08 18:36:56 deraadt Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)su.c 5.26 (Berkeley) 7/6/91";*/
-static char rcsid[] = "$OpenBSD: su.c,v 1.5 1996/07/22 01:58:55 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: su.c,v 1.6 1996/10/08 18:36:56 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -241,7 +241,8 @@ badlogin:
cleanenv[0] = NULL;
environ = cleanenv;
(void)setenv("PATH", _PATH_DEFPATH, 1);
- (void)setenv("TERM", p, 1);
+ if (p)
+ (void)setenv("TERM", p, 1);
seteuid(pwd->pw_uid);
setegid(pwd->pw_gid);