Don't try to set a null TERM environment.

Submitted by:	Mateusz Guzik <mjguzik gmail.com>
This commit is contained in:
Jamie Gritton 2012-05-25 00:38:06 +00:00
parent d6a6e5902f
commit 8632fa3e92
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235949

View File

@ -584,7 +584,8 @@ run_command(struct cfjail *j)
term = getenv("TERM");
environ = &cleanenv;
setenv("PATH", "/bin:/usr/bin", 0);
setenv("TERM", term, 1);
if (term != NULL)
setenv("TERM", term, 1);
}
if (setusercontext(lcap, pwd, pwd->pw_uid, username
? LOGIN_SETALL & ~LOGIN_SETGROUP & ~LOGIN_SETLOGIN