[comp.unix.aix] Telnet negotiation - Not a defect: a feature!

resnick@cogsci.uiuc.edu (Pete Resnick) (10/09/90)

Well, the good old saying "We're IBM; we don't have to!" has finally
come up and bit me. In the TCP/IP documentation for AIX 2.2.1, the
telnet and telnetd sections explain that telnet on the RT handles
terminal negotiation. But any time I log in over telnet, my terminal
type gets set to whatever is in /etc/ports. I call IBM defect support
who quickly explain to me that this is not a defect, but in fact a
feature!!!! Geez, just what I always wanted. According to them, telnet
does in fact do terminal negotiation; it's just that /bin/login stomps
over the terminal type and makes it whatever is in /etc/ports. And
defect support says that, because it was designed to work that way,
changing would be a "design change" and not a "corrective service."

Some days are just not as funny as others.

So, here is my question: Can someone there in IBM-land who might be
working for the TCP/IP group write a little piece of code so that
terminal negotiation can be done after /bin/login has finished its
dirty work? That is, I would like a little program that sends the
IAC DO TERMINAL-TYPE and gets the response back that I can put in
/etc/environment or /etc/profile. I have given up on the idea of
getting this to work to spec (I don't care whether defect support
believes it does; it's not working the way it ought to, even though
it works the way it is supposed to). I just want something that does
the job. I don't even know if you can do terminal negotiation this
late in the game; maybe setting an environmet variable like NETTERM.
Anything.


Alternatively, does someone know how I can do this through official
channels. No offense, but I do not have a great deal of faith going
through the front lines of the office here in Champaign; I will be
gone by the time a real design change goes through.

Thanks for any help.
pr

--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD

tif@doorstop.austin.ibm.com (Paul Chamberlain) (10/10/90)

In article <1990Oct8.192405.19439@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
>But any time I log in over telnet, my terminal
>type gets set to whatever is in /etc/ports.

Just off the top of my head -- does this happen if /etc/ports doesn't
define what terminal it is?

Paul Chamberlain | I do NOT represent IBM.     tif@doorstop, sc30661 at ausvm6
512/838-7008     | ...!cs.utexas.edu!ibmaus!auschs!doorstop.austin.ibm.com!tif

resnick@cogsci.uiuc.edu (Pete Resnick) (10/12/90)

tif@doorstop.austin.ibm.com (Paul Chamberlain) writes:

>In article <1990Oct8.192405.19439@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
>>But any time I log in over telnet, my terminal
>>type gets set to whatever is in /etc/ports.

>Just off the top of my head -- does this happen if /etc/ports doesn't
>define what terminal it is?

Yes. If there is no entry in /etc/ports, it sets it to 'dumb'.

Dumb.

pr
--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD

karish@mindcrf.UUCP (Chuck Karish) (10/12/90)

In article <1990Oct8.192405.19439@ux1.cso.uiuc.edu>
resnick@cogsci.uiuc.edu (Pete Resnick) wrote:
>But any time I log in over telnet, my terminal
>type gets set to whatever is in /etc/ports.

Later, he added:

>If there is no entry in /etc/ports, it sets it to 'dumb'.
>
>Dumb.

UNIX systems maintain information about the terminal type in the
shell, not in the terminal driver.  Telnet itself doesn't know
what the terminal type is, and therefore can't do the negotiation.
It's been done this way since telnet was first provided on BSD
systems, as far as I know; AIX behavior does not differ from
historical practice.

The rlogin protocol does propagate the $TERM variable from the
environment.  This is the only environment variable from the
local shell that's provided to the remote shell.

When your terminal type comes up as `dumb', there are two things
you can have your session initialization script (.cshrc, .profile, etc.)
do:

- Prompt you to fill in the correct terminal type, and set it
  in $TERM (and $term, in csh).

- Run a program to probe the terminal for an identification code;
  many terminals can report what type they are.
-- 

	Chuck Karish		karish@mindcraft.com
	Mindcraft, Inc.		(415) 323-9000		

resnick@cogsci.uiuc.edu (Pete Resnick) (10/13/90)

karish@mindcrf.UUCP (Chuck Karish) writes:

>UNIX systems maintain information about the terminal type in the
>shell, not in the terminal driver.  Telnet itself doesn't know
>what the terminal type is, and therefore can't do the negotiation.
>It's been done this way since telnet was first provided on BSD
>systems, as far as I know; AIX behavior does not differ from
>historical practice.

This is just not true. RFC 1091 is Telnet Terminal-Type negotiation,
which IBM claims that AIX implements. When telnetd comes up, it sends
an IAC DO TERMINAL-TYPE to the incoming telnet. If the incoming telnet
answers appropriately, telnetd gets the text string for the terminal
type from the incoming telnet. This should then be put in the TERM
environment variable. Unfortunately, IBM has decided that the /bin/login,
which executes after telnetd is done, look up the terminal type in
/etc/ports and kludge whatever telnetd has set. This makes the implementing
RFC 1091 absolutely useless.

I know for a fact that Ultrix does telnet terminal-type negotiation.
Even when I log in from my Macintosh which runs its own little
telnet, whatever I set my terminal type to, whether it's 'vt100' or
'foobar', that's what my TERM variable is set to when I am logged in
on the VAX.

pr
--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD

karish@mindcrf.UUCP (Chuck Karish) (10/13/90)

In article <1990Oct12.171007.14012@ux1.cso.uiuc.edu>
resnick@cogsci.uiuc.edu (Pete Resnick) writes:
|karish@mindcrf.UUCP (Chuck Karish) writes:
|
||UNIX systems maintain information about the terminal type in the
||shell, not in the terminal driver.  Telnet itself doesn't know
||what the terminal type is, and therefore can't do the negotiation.
||[ ... ]
|
|This is just not true. RFC 1091 is Telnet Terminal-Type negotiation,
|which IBM claims that AIX implements. When telnetd comes up, it sends
|an IAC DO TERMINAL-TYPE to the incoming telnet. If the incoming telnet
|answers appropriately, telnetd gets the text string for the terminal
|type from the incoming telnet. [ ... ]

Experiment shows me that Pete is correct.  Thanks; I've now unlearned
something I'd thought I learned seven years ago.

My login scripts on AIX machines still need all sorts of hackery,
though...
-- 

	Chuck Karish		karish@mindcraft.com
	Mindcraft, Inc.		(415) 323-9000		

brian@cygnus.la.locus.com (Brian D. Horn) (10/14/90)

In article <1990Oct12.171007.14012@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
>environment variable. Unfortunately, IBM has decided that the /bin/login,
>which executes after telnetd is done, look up the terminal type in
>/etc/ports and kludge whatever telnetd has set. This makes the implementing
>RFC 1091 absolutely useless.

	Unfortunately I have no ready access to an RS/6000, but both
AIX/370 and AIX/PS/2 DO correctly implement terminal type negotiation in
telnet.  If the RS/6000 does not it is a BUG and should be fixed.  If the
IBM service rep gives you grief, point out that the 6000 is family
incompatible in this respect.

robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) (10/24/90)

In article <9010130621.AA09630@mindcrf.mindcraft.com> karish@mindcrf.UUCP (Chuck Karish) writes:
>In article <1990Oct12.171007.14012@ux1.cso.uiuc.edu>
>resnick@cogsci.uiuc.edu (Pete Resnick) writes:
>|karish@mindcrf.UUCP (Chuck Karish) writes:
>|
>||UNIX systems maintain information about the terminal type in the
>||shell, not in the terminal driver.  Telnet itself doesn't know
>||what the terminal type is, and therefore can't do the negotiation.
>||[ ... ]
>|This is just not true. RFC 1091 is Telnet Terminal-Type negotiation,
>|which IBM claims that AIX implements. When telnetd comes up, it sends
>|an IAC DO TERMINAL-TYPE to the incoming telnet. If the incoming telnet
>|answers appropriately, telnetd gets the text string for the terminal
>|type from the incoming telnet. [ ... ]

Pete is correct... In AIX v.2.2.1 this is all irrelevant.  The terminal type 
is correctly negotiated by telnet, but the login process running on the pts
ignores the negotiated terminal type and sets the TERM environment variable
to the one specified by /etc/ports for that pts.

+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     cs.utexas.edu!ibmchs!auschs!sabre.austin.ibm.com!robin             |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)823-4526                       |
+-----------------------------------------------------------------------------+

robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) (10/25/90)

In article <18224@oolong.la.locus.com> brian@cygnus.la.locus.com (Brian D. Horn) writes:
)In article <1990Oct12.171007.14012@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
)>environment variable. Unfortunately, IBM has decided that the /bin/login,
)>which executes after telnetd is done, look up the terminal type in
)>/etc/ports and kludge whatever telnetd has set. This makes the implementing
)>RFC 1091 absolutely useless.
)
)	Unfortunately I have no ready access to an RS/6000, but both
)AIX/370 and AIX/PS/2 DO correctly implement terminal type negotiation in
)telnet.  If the RS/6000 does not it is a BUG and should be fixed.  If the
)IBM service rep gives you grief, point out that the 6000 is family
)incompatible in this respect.


The RS/6000 follows the standard, and does work.  


+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     cs.utexas.edu!ibmchs!auschs!sabre.austin.ibm.com!robin             |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)823-4526                       |
+-----------------------------------------------------------------------------+

robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) (10/25/90)

In article <1990Oct12.171007.14012@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
>karish@mindcrf.UUCP (Chuck Karish) writes:
>This is just not true. RFC 1091 is Telnet Terminal-Type negotiation,
>which IBM claims that AIX implements. When telnetd comes up, it sends
>an IAC DO TERMINAL-TYPE to the incoming telnet. If the incoming telnet
>answers appropriately, telnetd gets the text string for the terminal
>type from the incoming telnet. This should then be put in the TERM
>environment variable. Unfortunately, IBM has decided that the /bin/login,
>which executes after telnetd is done, look up the terminal type in
>/etc/ports and kludge whatever telnetd has set. This makes the implementing
>RFC 1091 absolutely useless.

This is correct.  And AIX v.2.2.1 telnetd does just this; however, the login 
process is what sets the terminal type, so it ignores what telnet negotiates.
This is not a "feature", it is an acknowledged restriction.  Meaning, it was
not intended to work this way, but the impact is too far reaching to make a
change now.  Changing the way the login process works would affect 3rd party
software designed around the "feature" of setting the terminal type to whatever
is set in /etc/ports.  Changing telnet to work around the problem makes the 
AIX v.2.2.1 version of telnet out of published specs, and completely 
non-standard.  We are between a rock and a hard place, and the best solution
in this case is to acknowledge the flaw, but leave it as-is so that we don't
create more problems.


+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     cs.utexas.edu!ibmchs!auschs!sabre.austin.ibm.com!robin             |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)823-4526                       |
+-----------------------------------------------------------------------------+