mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-22 16:44:32 +01:00
Export $TERM only if it has been set in our environment.
Detected by: Amancio Hasty
This commit is contained in:
parent
e5ef3eec57
commit
40a8a5cf5c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18789
@ -42,7 +42,7 @@ static const char copyright[] =
|
|||||||
static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";
|
static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";
|
||||||
*/
|
*/
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id: su.c,v 1.12 1996/03/09 14:57:43 markm Exp $";
|
"$Id: su.c,v 1.13 1996/03/11 22:14:52 markm Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -293,7 +293,8 @@ main(argc, argv)
|
|||||||
cleanenv[0] = NULL;
|
cleanenv[0] = NULL;
|
||||||
environ = cleanenv;
|
environ = cleanenv;
|
||||||
(void)setenv("PATH", _PATH_DEFPATH, 1);
|
(void)setenv("PATH", _PATH_DEFPATH, 1);
|
||||||
(void)setenv("TERM", p, 1);
|
if (p)
|
||||||
|
(void)setenv("TERM", p, 1);
|
||||||
if (chdir(pwd->pw_dir) < 0)
|
if (chdir(pwd->pw_dir) < 0)
|
||||||
errx(1, "no directory");
|
errx(1, "no directory");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user