Debian Codegraph @

rfc1572.html

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