home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc1408 < prev    next >
Text File  |  1993-01-26  |  14KB  |  396 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                  D. Borman, Editor
  8. Request for Comments: 1408                           Cray Research, Inc.
  9.                                                             January 1993
  10.  
  11.  
  12.                        Telnet Environment Option
  13.  
  14. Status of this Memo
  15.  
  16.    This RFC specifies an IAB standards track protocol for the Internet
  17.    community, and requests discussion and suggestions for improvements.
  18.    Please refer to the current edition of the "IAB Official Protocol
  19.    Standards" for the standardization state and status of this protocol.
  20.    Distribution of this memo is unlimited.
  21.  
  22. Abstract
  23.  
  24.    This document specifies a mechanism for passing environment
  25.    information between a telnet client and server.  Use of this
  26.    mechanism enables a telnet user to propagate configuration
  27.    information to a remote host when connecting.
  28.  
  29. 1.  Command Names and Codes
  30.  
  31.       ENVIRON         36
  32.           IS               0
  33.           SEND             1
  34.           INFO             2
  35.  
  36.           VAR              0
  37.           VALUE            1
  38.           ESC              2
  39.           USERVAR          3
  40.  
  41. 2.  Command Meanings
  42.  
  43.  
  44.    IAC WILL ENVIRON
  45.  
  46.       The sender of this command is willing to send environment
  47.       variables.
  48.  
  49.    IAC WONT ENVIRON
  50.  
  51.       The sender of this command refuses to send environment variables.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Telnet Working Group                                            [Page 1]
  59.  
  60. RFC 1408               Telnet Environment Option            January 1993
  61.  
  62.  
  63.    IAC DO ENVIRON
  64.  
  65.       The sender of this command is willing to receive environment
  66.       variables.
  67.  
  68.    IAC DONT ENVIRON
  69.  
  70.       The sender of this command refuses to accept environment
  71.       variables.
  72.  
  73.    IAC SB ENVIRON SEND [ type ... [ type ... [ ... ] ] ] IAC SE
  74.  
  75.       The sender of this command requests that the remote side send its
  76.       environment variables.  The "type" may be either VAR or USERVAR,
  77.       to indicate either well known or user variable names.  Only the
  78.       side that is DO ENVIRON may initiate a SEND command.  If a list of
  79.       variables is specified, then only those variables should be sent.
  80.       If no list is specified, then the default environment, of both
  81.       well known and user defined variables, should be sent.  If one of
  82.       the variables has no name, then all the variables of that type
  83.       (well known or user defined)  in the default environment should be
  84.       sent.
  85.  
  86.    IAC SB ENVIRON IS type ... [ VALUE ... ] [ type ... [ VALUE ... ] [
  87.  
  88.    The sender of this command is sending environment variables.  This
  89.       command is sent in response to a SEND request.  Only the side that
  90.       is WILL ENVIRON may send an IS command.  The "type"/VALUE pairs
  91.       must be returned in the same order as the SEND request specified
  92.       them, and there must be a response for each "type ..." explicitly
  93.       requested.  The "type" will be VAR or USERVAR.  Multiple
  94.       environment variables may be sent.  The characters following a
  95.       "type" up to the next "type" or VALUE specify the variable name.
  96.       The characters following a VALUE up to the next "type" specify the
  97.       value of the variable.  If a "type" is not followed by a VALUE
  98.       (e.g., by another VAR, USERVAR, or IAC SE) then that variable is
  99.       undefined.  If a VALUE is immediately followed by a "type" or IAC,
  100.       then the variable is defined, but has no value.  If an IAC is
  101.       contained between the IS and the IAC SE, it must be sent as IAC
  102.       IAC.  If a variable or a value contains a VAR, it must be sent as
  103.       ESC VAR.
  104.  
  105.       If a variable or a value contains a USERVAR, it must be sent as
  106.       ESC USERVAR.  If a variable or a value contains a VALUE, it must
  107.       be sent as ESC VALUE.  If a variable or a value contains an ESC,
  108.       it must be sent as ESC ESC.
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Telnet Working Group                                            [Page 2]
  115.  
  116. RFC 1408               Telnet Environment Option            January 1993
  117.  
  118.  
  119.    IAC SB ENVIRON INFO type ... [ VALUE ... ] [ type ... [ VALUE ... ] [
  120.  
  121.    The sender of this command is sending information about environment
  122.       variables that have changed.  It is identical to the IS command,
  123.       except that the command is INFO instead of IS.  Only the side that
  124.       is WILL ENVIRON may send an INFO command.  The INFO command is not
  125.       to be used to send initial information; the SEND/IS sequence is to
  126.       be used for that.  The INFO command is to be used to propagate
  127.       changes in environment variables, and may be spontaneously
  128.       generated.
  129.  
  130. 3.  Default Specification
  131.  
  132.    The default specification for this option is
  133.  
  134.       WONT ENVIRON
  135.       DONT ENVIRON
  136.  
  137.    meaning there will not be any exchange of environment information.
  138.  
  139. 4.  Motivation
  140.  
  141.    Many operating systems have startup information and environment
  142.    variables that contain information that should be propagated to
  143.    remote machines when Telnet connections are established.  Rather than
  144.    create a new Telnet option each time someone comes up with some new
  145.    information that they need propagated through a Telnet session, but
  146.    that the Telnet session itself doesn't really need to know about,
  147.    this generic information option can be used.
  148.  
  149. 5.  Well Known Variables
  150.  
  151.    USER        This variable is used to transmit the user or account
  152.                name that the client wishes to log into on the remote
  153.                system.  The format of the value the USER variable is
  154.                system dependent, as determined by the remote system.
  155.  
  156.    JOB         This variable is used to transmit the job ID that the
  157.                client wishes to use when logging into the remote system.
  158.                The format of the value the JOB variable is system
  159.                dependent, as determined by the remote system.
  160.  
  161.    ACCT        This variable is used to transmit the account ID that the
  162.                client wishes to use when logging into the remote system.
  163.                The format of the value the ACCT variable is system
  164.                dependent, as determined by the remote system.
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Telnet Working Group                                            [Page 3]
  171.  
  172. RFC 1408               Telnet Environment Option            January 1993
  173.  
  174.  
  175.    PRINTER     This variable is used to identify the default location
  176.                for printer output.  Because there does not currently
  177.                exist a standard way of naming a printer on a network,
  178.                the format of this variable is currently undefined.
  179.  
  180.    SYSTEMTYPE  This is used to transmit the type of operating system on
  181.                the system that sends this variable.  It value is
  182.                identical to the value of the SYSTEM (SYST) command in
  183.                FTP [2].  The format of the value shall have as its
  184.                first word one of the system names listed in the
  185.                current version of the Assigned Numbers document [3].
  186.  
  187.    DISPLAY     This variable is used to transmit the X display location
  188.                of the client.  The format for the value of the DISPLAY
  189.                variable is:
  190.                   <host>:<dispnum>[.<screennum>]
  191.                This information is identical to the information passed
  192.                using the Telnet X-DISPLAY-LOCATION option.  If both the
  193.                DISPLAY environment variable, and the
  194.                X-DISPLAY-LOCATION option[4] are received, and they
  195.                contain conflicting information, the most recently
  196.                received information received should be used.
  197.  
  198.    Because it is impossible to anticipate all variables that users may
  199.    wish to exchange, the USERVAR type is provided to allow users to
  200.    transmit arbitrary variable/value pairs.  The use of an additional
  201.    type allows implementations to distinguish between values derived by
  202.    the remote host software and values supplied by the user.  Paranoid
  203.    implementations will most likely treat both types with an equal level
  204.    of distrust.  The results of a name-space collision between a well-
  205.    known and a user variable are implementation specific.
  206.  
  207. 6.  Implementation Rules
  208.  
  209.    WILL and DO are used only at the beginning of the connection to
  210.    obtain and grant permission for future negotiations.
  211.  
  212.    Once the two hosts have exchanged a WILL and a DO, the sender of the
  213.    DO ENVIRON is free to request that environment variables be sent.
  214.    Only the sender of the DO may send requests (IAC SB ENVIRON SEND IAC
  215.    SE) and only the sender of the WILL may transmit actual environment
  216.    information (via the IAC SB ENVIRON IS ... IAC SE command).  Though
  217.    this option may be used at anytime throughout the life of the telnet
  218.    connection, the exchange of environment information will usually
  219.    happen at the startup of the connection.  This is because many
  220.    operating systems only have mechanisms for propagating environment
  221.    information at process creation, so the information is needed before
  222.    the user logs in.  In this section, anything that is in quotes is
  223.  
  224.  
  225.  
  226. Telnet Working Group                                            [Page 4]
  227.  
  228. RFC 1408               Telnet Environment Option            January 1993
  229.  
  230.  
  231.    shorthand for a string of ASCII values.  For example, "joe" means the
  232.    three octet sequence (in decimal) 106 111 101.
  233.  
  234.    The receiving host is not required to put all variables that it
  235.    receives into the environment.  For example, if the client should
  236.    send across USERVAR "TERM" VALUE "xterm" as an environment variable,
  237.    and the TERMINAL-TYPE [1] option has already been used to determine
  238.    the terminal type, the server may safely ignore the TERM variable.
  239.    Also, some startup information may be used in other ways; for
  240.    example, the values for "USER", "ACCT" and "PROJ" values might be
  241.    used to decide which account to log into, and might never be put into
  242.    the users environment.  In general, if the server has already
  243.    determined the value of an environment variable by some more accurate
  244.    means, or if it does not understand a variable name, it may ignore
  245.    the value sent in the ENVIRON option.  The server may also prefer to
  246.    just put all unknown information into the users environment.  This is
  247.    the suggested method of implementation, because it allows the user
  248.    the most flexibility.
  249.  
  250.    The following is an example of use of the option:
  251.  
  252.        Host1                            Host2
  253.        IAC DO ENVIRON
  254.                                         IAC WILL ENVIRON
  255.        [ Host1 is now free to request environment information ]
  256.        IAC SB ENVIRON SEND VAR "USER"
  257.        VAR "ACCT" VAR USERVAR IAC SE
  258.        [ The server has now explicitly asked for the USER and ACCT
  259.          variables, the default set of well known environment variables,
  260.          and the default set of user defined variables.  Note that the
  261.          client includes the USER information twice; once because it was
  262.          explicitly asked for, and once because it is part of the
  263.          default environment.  ]
  264.                                         IAC SB ENVIRON IS VAR "USER"
  265.                                         VALUE "joe" VAR "ACCT" VALUE
  266.                                         "kernel" VAR "USER" VALUE "joe"
  267.                                         VAR "DISPLAY" VALUE "foo:0.0"
  268.                                         USERVAR "SHELL" VALUE "/bin/csh"
  269.                                         IAC SE
  270.  
  271.    It is legal for a client to respond with an empty environment (no
  272.    data between the IAC SB and IAC SE) when no well-defined or user
  273.    variables are currently defined.  For example:
  274.  
  275.       IAC SB ENVIRON IS IAC SE
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Telnet Working Group                                            [Page 5]
  283.  
  284. RFC 1408               Telnet Environment Option            January 1993
  285.  
  286.  
  287.    is a valid response to any of the following:
  288.  
  289.          IAC SB ENVIRON SEND IAC SE
  290.          IAC SB ENVIRON SEND VAR IAC SE
  291.          IAC SB ENVIRON SEND USERVAR IAC SE
  292.          IAC SB ENVIRON SEND VAR USERVAR IAC SE
  293.  
  294.    (The last example is equivalent to the first...)
  295.  
  296.    It is expected that any implementation that supports the Telnet
  297.    ENVIRON option will support all of this specification.
  298.  
  299. 7.  Security Concerns
  300.  
  301.    It is important for an implementor of the ENVIRON option to
  302.    understand the interaction of setting options and the
  303.    login/authentication process. Specifically careful analysis should be
  304.    done to determine which variables are "safe" to set prior to having
  305.    the client login.  An example of a bad choice would be permitting a
  306.    variable to be changed that allows an intruder to circumvent or
  307.    compromise the login/authentication program itself.
  308.  
  309. 8.  References
  310.  
  311.    [1] VanBokkelen, J., "Telnet Terminal-Type Option", RFC 1091, FTP
  312.        Software, Inc., February 1989.
  313.  
  314.    [2] Postel, J. and J. Reynolds, "File Transfer Protocol (FTP)", STD
  315.        9, RFC 959, USC/Information Sciences Institute, October 1985.
  316.  
  317.    [3] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1340,
  318.        USC/Information Sciences Institute, July 1992.
  319.  
  320.    [4] Marcy, G., "Telnet X Display Location Option", RFC 1096, Carnegie
  321.        Mellon University, March 1989.
  322.  
  323. Security Considerations
  324.  
  325.    Security issues are discussed in Section 7.
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Telnet Working Group                                            [Page 6]
  339.  
  340. RFC 1408               Telnet Environment Option            January 1993
  341.  
  342.  
  343. Author's Address
  344.  
  345.    David A. Borman, Editor
  346.    Cray Research, Inc.
  347.    655F Lone Oak Drive
  348.    Eagan, MN 55123
  349.  
  350.    Phone: (612) 452-6650
  351.    EMail: dab@CRAY.COM
  352.  
  353.    Mailing List: telnet-ietf@CRAY.COM
  354.  
  355. Chair's Address
  356.  
  357.    The working group can be contacted via the current chair:
  358.  
  359.    Steve Alexander
  360.    INTERACTIVE Systems Corporation
  361.    1901 North Naper Boulevard
  362.    Naperville, IL 60563-8895
  363.  
  364.    Phone: (708) 505-9100 x256
  365.    EMail: stevea@isc.com
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Telnet Working Group                                            [Page 7]
  395.  
  396.