From 1eaf836b4d7a3e8a2f005b3640c67f3f7bcca3fc Mon Sep 17 00:00:00 2001 From: jamie Date: Fri, 25 May 2012 00:38:06 +0000 Subject: Don't try to set a null TERM environment. Submitted by: Mateusz Guzik --- usr.sbin/jail/command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.sbin') diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index cbc7b88..b749576 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -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 -- cgit v1.1