Network Working Group S. Alexander, Editor
Request for Comments: 1572 Lachman Technology, Inc.
Category: Standards Track January 1994
Telnet Environment Option
1. Command Names and Codes
NEW-ENVIRON 39
ESC 2
USERVAR 3
2. Command Meanings
IAC WILL NEW-ENVIRON
Telnet Working Group [Page 1]
RFC 1572 Telnet Environment Option January 1994
IAC DO NEW-ENVIRON
Telnet Working Group [Page 2]
RFC 1572 Telnet Environment Option January 1994
The sender of this command is sending information about environment variables that have changed. It is identical to the IS command, except that the command is INFO instead of IS. Only the side that is WILL NEW-ENVIRON may send an INFO command. The INFO command is not to be used to send initial information; the SEND/IS sequence is to be used for that. The INFO command is to be used to propagate changes in environment variables, and may be spontaneously generated.
3. Default Specification
The default specification for this option is
4. Motivation
Many operating systems have startup information and environment variables that contain information that should be propagated to remote machines when Telnet connections are established. Rather than create a new Telnet option each time someone comes up with some new information that they need propagated through a Telnet session, but that the Telnet session itself doesn't really need to know about, this generic information option can be used.
5. Well Known Variables
USER This variable is used to transmit the user or account
Telnet Working Group [Page 3]
RFC 1572 Telnet Environment Option January 1994
PRINTER This variable is used to identify the default location
6. Implementation Rules
WILL and DO are used only at the beginning of the connection to obtain and grant permission for future negotiations.
Telnet Working Group [Page 4]
RFC 1572 Telnet Environment Option January 1994
The receiving host is not required to put all variables that it receives into the environment. For example, if the client should send across USERVAR "TERM" VALUE "xterm" as an environment variable, and the TERMINAL-TYPE [3] option has already been used to determine the terminal type, the server may safely ignore the TERM variable. Also, some startup information may be used in other ways; for example, the values for "USER", "ACCT" and "PROJ" values might be used to decide which account to log into, and might never be put into the users environment. In general, if the server has already determined the value of an environment variable by some more accurate means, or if it does not understand a variable name, it may ignore the value sent in the NEW-ENVIRON option. The server may also prefer to just put all unknown information into the users environment. This is the suggested method of implementation, because it allows the user the most flexibility.
Telnet Working Group [Page 5]
RFC 1572 Telnet Environment Option January 1994
IAC SB NEW-ENVIRON SEND IAC SE IAC SB NEW-ENVIRON SEND VAR IAC SE IAC SB NEW-ENVIRON SEND USERVAR IAC SE IAC SB NEW-ENVIRON SEND VAR USERVAR IAC SE
7. Security Concerns
It is important for an implementor of the NEW-ENVIRON option to understand the interaction of setting options and the login/authentication process. Specifically careful analysis should be done to determine which variables are "safe" to set prior to having the client login. An example of a bad choice would be permitting a variable to be changed that allows an intruder to circumvent or compromise the login/authentication program itself.
8. References
[1] Borman, D., Editor, "Telnet Environment Option", RFC 1408, Cray
Telnet Working Group [Page 6]
RFC 1572 Telnet Environment Option January 1994
[6] Marcy, G., "Telnet X Display Location Option", RFC 1096, Carnegie