summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2012-05-25 00:38:06 +0000
committerjamie <jamie@FreeBSD.org>2012-05-25 00:38:06 +0000
commit1eaf836b4d7a3e8a2f005b3640c67f3f7bcca3fc (patch)
tree4fd4344f5483e9e86c3c0c473206a5e83cba5282 /usr.sbin
parentfdda585ecb45d2a13f7e03381455b3027cf27fb7 (diff)
downloadFreeBSD-src-1eaf836b4d7a3e8a2f005b3640c67f3f7bcca3fc.zip
FreeBSD-src-1eaf836b4d7a3e8a2f005b3640c67f3f7bcca3fc.tar.gz
Don't try to set a null TERM environment.
Submitted by: Mateusz Guzik <mjguzik gmail.com>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/jail/command.c3
1 files changed, 2 insertions, 1 deletions
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
OpenPOWER on IntegriCloud