Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2012 00:38:06 +0000 (UTC)
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r235949 - head/usr.sbin/jail
Message-ID:  <201205250038.q4P0c62j069704@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jamie
Date: Fri May 25 00:38:06 2012
New Revision: 235949
URL: http://svn.freebsd.org/changeset/base/235949

Log:
  Don't try to set a null TERM environment.
  
  Submitted by:	Mateusz Guzik <mjguzik gmail.com>

Modified:
  head/usr.sbin/jail/command.c

Modified: head/usr.sbin/jail/command.c
==============================================================================
--- head/usr.sbin/jail/command.c	Fri May 25 00:18:19 2012	(r235948)
+++ head/usr.sbin/jail/command.c	Fri May 25 00:38:06 2012	(r235949)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205250038.q4P0c62j069704>