From jin@adv-pc-1.lbl.gov  Tue Nov 18 11:36:23 1997
Received: from adv-pc-1.lbl.gov (adv-pc-1.lbl.gov [128.3.196.189])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA16925
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 18 Nov 1997 11:36:22 -0800 (PST)
          (envelope-from jin@adv-pc-1.lbl.gov)
Received: (from jin@localhost)
	by adv-pc-1.lbl.gov (8.8.7/8.8.7) id LAA10767;
	Tue, 18 Nov 1997 11:36:21 -0800 (PST)
	(envelope-from jin)
Message-Id: <199711181936.LAA10767@adv-pc-1.lbl.gov>
Date: Tue, 18 Nov 1997 11:36:21 -0800 (PST)
From: "Jin Guojun[ITG]" <jin@adv-pc-1.lbl.gov>
Reply-To: jin@adv-pc-1.lbl.gov
To: FreeBSD-gnats-submit@freebsd.org
Subject: wrong "term" for internal shell
X-Send-Pr-Version: 3.2

>Number:         5084
>Category:       bin
>Synopsis:       wrong "term" for internal shell
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 18 11:40:01 PST 1997
>Closed-Date:    Wed Jan 19 03:00:46 PST 2000
>Last-Modified:  Wed Jan 19 03:01:59 PST 2000
>Originator:     Jin Guojun[ITG]
>Release:        FreeBSD 2.2.5-RELEASE i386 or Higher
>Organization:
>Environment:

	from 2.2.5-Release or 3.0-SNAP

>Description:

	When doing internal shell (no a login shell), the variable "term"
	supposes to be unset. Somehow, after 2.2.2-RELEASE, the "term" is
	is to "su", which is useless and confusing the conventional ENV.

>How-To-Repeat:

	any_hosts % rsh FreeBSD env
	HOME=/home/users/jin
	SHELL=/bin/csh
	PATH=/usr/bin:/bin
	USER=jin
	TERM=su				# should not be set at all
	PWD=/home/users/jin

>Fix:
	
	It should be in /usr/src/libexec/rshd/rshd.c ; but I could not
	find where the "term" has been used. So, a wide guess that the env
	string may be overflowing if no one intends to set it to "su".

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: ru 
State-Changed-When: Mon Jun 14 03:49:55 PDT 1999 
State-Changed-Why:  
`su'' is the default terminal type.  See login.conf(5) for details. 
The associated code is in src/lib/libutil/login_class.c. 
I think we should leave TERM empty, but I'm not sure. 
Will check with freebsd-hackers. 


Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Mon Jun 14 03:49:55 PDT 1999 
Responsible-Changed-Why:  
I'm taking this one. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: ru 
State-Changed-When: Wed Jan 19 03:00:46 PST 2000 
State-Changed-Why:  
Fixed in 4.0-CURRENT and 3.4-STABLE. 
>Unformatted:
