Where does TERM get set for Telnet logins.(Solution!)

Dave Olson olson at anchor.esd.sgi.com
Thu Dec 20 05:12:35 AEST 1990


In <1990Dec18.074044.13043 at Think.COM> barmar at think.com (Barry Margolin) writes:

| In article <1990Dec18.041334.7498 at ccu1.aukuni.ac.nz> russell at ccu1.aukuni.ac.nz (Russell J Fulton;ccc032u) writes:
| >Dave was able to supply the crucial information that telnetd does not set
| >TERM if negotiations with the client fail to produce a terminal type.
| >From this I concluded that TERM must be already set for the telnetd process.
| 
| The 4.3bsd telnetd doesn't have this problem.  If it is unable to negotiate
| the terminal type, it doesn't supply the "-p" (preserve environment) option
| to /bin/login.  And when it does negotiate the terminal type, it sets the
| environment that is inherited by /bin/login to only contain the TERM
| variable.
| 
| I suggest you ask your vendor to adopt this strategy.

This is exactly how it works.  However, if TERM isn't passed in to login
by telnetd, AND TERM is already set in the environment, then login will
use the value already in the environment, which in this case was inherited
down the chain from the operator's shell -> inetd -> telnetd -> login.
--

	Dave Olson

Life would be so much easier if we could just look at the source code.



More information about the Comp.unix.internals mailing list