1 2This is a distribution of both client and server telnet. These programs 3have been compiled on: 4 telnet telnetd 5 BSD 4.4 x x 6 BSD 4.3 Reno X X 7 UNICOS 8.0 X X 8 UNICOS 7.C X X 9 UNICOS 7.0 X X 10 UNICOS 6.1 X X 11 BSDI 1.0 X X 12 Solaris 2.2 x x (no linemode in server) 13 Solaris 2.3 x x (no linemode in server) 14 SunOs 4.1.3 X X (no linemode in server) 15 Ultrix 4.3 X X (no linemode in server) 16 DYNIX V3.0.17.9 X X (no linemode in server) 17 HP-UX 8.0 x x (no linemode in server) 18 19In addition, previous versions have been compiled on the following 20machines, but were not available for testing this version. 21 telnet telnetd 22 Next1.0 X X 23 UNICOS 6.0 X X 24 UNICOS 5.1 X X 25 UNICOS 5.0 X X 26 SunOs 4.0.3c X X (no linemode in server) 27 BSD 4.3 X X (no linemode in server) 28 DYNIX V3.0.12 X X (no linemode in server) 29 Ultrix 3.1 X X (no linemode in server) 30 Ultrix 4.0 X X (no linemode in server) 31 SunOs 3.5 X X (no linemode in server) 32 33This code should work, but there are no guarantees. 34 35January 19, 1994 36 37This is a list of some of the changes since the last tar release 38of telnet/telnetd. There are probably other changes that aren't 39listed here, but this should hit a lot of the main ones. 40 41 General: 42 Changed #define for AUTHENTICATE to AUTHENTICATION 43 Changed #define for ENCRYPT to ENCRYPTION 44 Changed #define for DES_ENCRYPT to DES_ENCRYPTION 45 46 Added support for SPX authentication: -DSPX 47 48 Added support for Kerberos Version 5 authentication: -DKRB5 49 50 Added support for ANSI C function prototypes 51 52 Added support for the NEW-ENVIRON option (RFC-1572) 53 including support for USERVAR. 54 55 Made support for the old Environment Option (RFC-1408) 56 conditional on -DOLD_ENVIRON 57 58 Added #define ENV_HACK - support for RFC 1571 59 60 The encryption code is removed from the public distributions. 61 Domestic 4.4 BSD distributions contain the encryption code. 62 63 ENV_HACK: Code to deal with systems that only implement 64 the old ENVIRON option, and have reversed definitions 65 of ENV_VAR and ENV_VAL. Also fixes ENV processing in 66 client to handle things besides just the default set... 67 68 NO_BSD_SETJMP: UNICOS configuration for 69 UNICOS 6.1/6.0/5.1/5.0 systems. 70 71 STREAMSPTY: Use /dev/ptmx to get a clean pty. This 72 is for SVr4 derivatives (Like Solaris) 73 74 UTMPX: For systems that have /etc/utmpx. This is for 75 SVr4 derivatives (Like Solaris) 76 77 Definitions for BSDI 1.0 78 79 Definitions for 4.3 Reno and 4.4 BSD. 80 81 Definitions for UNICOS 8.0 and UNICOS 7.C 82 83 Definitions for Solaris 2.0 84 85 Definitions for HP-UX 8.0 86 87 Latest Copyright notices from Berkeley. 88 89 FLOW-CONTROL: support for RFC-XXXx 90 91 92 Client Specific: 93 94 Fix the "send" command to not send garbage... 95 96 Fix status message for "skiprc" 97 98 Make sure to send NAWS after telnet has been suspended 99 or an external command has been run, if the window size 100 has changed. 101 102 sysV88 support. 103 104 Server Specific: 105 106 Support flowcontrol option in non-linemode servers. 107 108 -k Server supports Kludge Linemode, but will default to 109 either single character mode or real Linemode support. 110 The user will have to explicitly ask to switch into 111 kludge linemode. ("stty extproc", or escape back to 112 to telnet and say "mode line".) 113 114 -u Specify the length of the hostname field in the utmp 115 file. Hostname longer than this length will be put 116 into the utmp file in dotted decimal notation, rather 117 than putting in a truncated hostname. 118 119 -U Registered hosts only. If a reverse hostname lookup 120 fails, the connection will be refused. 121 122 -f/-F 123 Allows forwarding of credentials for KRB5. 124 125Februrary 22, 1991: 126 127 Features: 128 129 This version of telnet/telnetd has support for both 130 the AUTHENTICATION and ENCRYPTION options. The 131 AUTHENTICATION option is fairly well defined, and 132 an option number has been assigned to it. The 133 ENCRYPTION option is still in a state of flux; an 134 option number has been assigned to, but it is still 135 subject to change. The code is provided in this release 136 for experimental and testing purposes. 137 138 The telnet "send" command can now be used to send 139 do/dont/will/wont commands, with any telnet option 140 name. The rules for when do/dont/will/wont are sent 141 are still followed, so just because the user requests 142 that one of these be sent doesn't mean that it will 143 be sent... 144 145 The telnet "getstatus" command no longer requires 146 that option printing be enabled to see the response 147 to the "DO STATUS" command. 148 149 A -n flag has been added to telnetd to disable 150 keepalives. 151 152 A new telnet command, "auth" has been added (if 153 AUTHENTICATE is defined). It has four sub-commands, 154 "status", "disable", "enable" and "help". 155 156 A new telnet command, "encrypt" has been added (if 157 ENCRYPT is defined). It has many sub-commands: 158 "enable", "type", "start", "stop", "input", 159 "-input", "output", "-output", "status", and "help". 160 161 The LOGOUT option is now supported by both telnet 162 and telnetd, a new command, "logout", was added 163 to support this. 164 165 Several new toggle options were added: 166 "autoencrypt", "autodecrypt", "autologin", "authdebug", 167 "encdebug", "skiprc", "verbose_encrypt" 168 169 An "rlogin" interface has been added. If the program 170 is named "rlogin", or the "-r" flag is given, then 171 an rlogin type of interface will be used. 172 ~. Terminates the session 173 ~<susp> Suspend the session 174 ~^] Escape to telnet command mode 175 ~~ Pass through the ~. 176 BUG: If you type the rlogin escape character 177 in the middle of a line while in rlogin 178 mode, you cannot erase it or any characters 179 before it. Hopefully this can be fixed 180 in a future release... 181 182 General changes: 183 184 A "libtelnet.a" has now been created. This libraray 185 contains code that is common to both telnet and 186 telnetd. This is also where library routines that 187 are needed, but are not in the standard C library, 188 are placed. 189 190 The makefiles have been re-done. All of the site 191 specific configuration information has now been put 192 into a single "Config.generic" file, in the top level 193 directory. Changing this one file will take care of 194 all three subdirectories. Also, to add a new/local 195 definition, a "Config.local" file may be created 196 at the top level; if that file exists, the subdirectories 197 will use that file instead of "Config.generic". 198 199 Many 1-2 line functions in commands.c have been 200 removed, and just inserted in-line, or replaced 201 with a macro. 202 203 Bug Fixes: 204 205 The non-termio code in both telnet and telnetd was 206 setting/clearing CTLECH in the sg_flags word. This 207 was incorrect, and has been changed to set/clear the 208 LCTLECH bit in the local mode word. 209 210 The SRCRT #define has been removed. If IP_OPTIONS 211 and IPPROTO_IP are defined on the system, then the 212 source route code is automatically enabled. 213 214 The NO_GETTYTAB #define has been removed; there 215 is a compatability routine that can be built into 216 libtelnet to achive the same results. 217 218 The server, telnetd, has been switched to use getopt() 219 for parsing the argument list. 220 221 The code for getting the input/output speeds via 222 cfgetispeed()/cfgetospeed() was still not quite 223 right in telnet. Posix says if the ispeed is 0, 224 then it is really equal to the ospeed. 225 226 The suboption processing code in telnet now has 227 explicit checks to make sure that we received 228 the entire suboption (telnetd was already doing this). 229 230 The telnet code for processing the terminal type 231 could cause a core dump if an existing connection 232 was closed, and a new connection opened without 233 exiting telnet. 234 235 Telnetd was doing a TCSADRAIN when setting the new 236 terminal settings; This is not good, because it means 237 that the tcsetattr() will hang waiting for output to 238 drain, and telnetd is the only one that will drain 239 the output... The fix is to use TCSANOW which does 240 not wait. 241 242 Telnetd was improperly setting/clearing the ISTRIP 243 flag in the c_lflag field, it should be using the 244 c_iflag field. 245 246 When the child process of telnetd was opening the 247 slave side of the pty, it was re-setting the EXTPROC 248 bit too early, and some of the other initialization 249 code was wiping it out. This would cause telnetd 250 to go out of linemode and into single character mode. 251 252 One instance of leaving linemode in telnetd forgot 253 to send a WILL ECHO to the client, the net result 254 would be that the user would see double character 255 echo. 256 257 If the MODE was being changed several times very 258 quickly, telnetd could get out of sync with the 259 state changes and the returning acks; and wind up 260 being left in the wrong state. 261 262September 14, 1990: 263 264 Switch the client to use getopt() for parsing the 265 argument list. The 4.3Reno getopt.c is included for 266 systems that don't have getopt(). 267 268 Use the posix _POSIX_VDISABLE value for what value 269 to use when disabling special characters. If this 270 is undefined, it defaults to 0x3ff. 271 272 For non-termio systems, TIOCSETP was being used to 273 change the state of the terminal. This causes the 274 input queue to be flushed, which we don't want. This 275 is now changed to TIOCSETN. 276 277 Take out the "#ifdef notdef" around the code in the 278 server that generates a "sync" when the pty oputput 279 is flushed. The potential problem is that some older 280 telnet clients may go into an infinate loop when they 281 receive a "sync", if so, the server can be compiled 282 with "NO_URGENT" defined. 283 284 Fix the client where it was setting/clearing the OPOST 285 bit in the c_lflag field, not the c_oflag field. 286 287 Fix the client where it was setting/clearing the ISTRIP 288 bit in the c_lflag field, not the c_iflag field. (On 289 4.3Reno, this is the ECHOPRT bit in the c_lflag field.) 290 The client also had its interpretation of WILL BINARY 291 and DO BINARY reversed. 292 293 Fix a bug in client that would cause a core dump when 294 attempting to remove the last environment variable. 295 296 In the client, there were a few places were switch() 297 was being passed a character, and if it was a negative 298 value, it could get sign extended, and not match 299 the 8 bit case statements. The fix is to and the 300 switch value with 0xff. 301 302 Add a couple more printoption() calls in the client, I 303 don't think there are any more places were a telnet 304 command can be received and not printed out when 305 "options" is on. 306 307 A new flag has been added to the client, "-a". Currently, 308 this just causes the USER name to be sent across, in 309 the future this may be used to signify that automatic 310 authentication is requested. 311 312 The USER variable is now only sent by the client if 313 the "-a" or "-l user" options are explicity used, or 314 if the user explicitly asks for the "USER" environment 315 variable to be exported. In the server, if it receives 316 the "USER" environment variable, it won't print out the 317 banner message, so that only "Password:" will be printed. 318 This makes the symantics more like rlogin, and should be 319 more familiar to the user. (People are not used to 320 getting a banner message, and then getting just a 321 "Password:" prompt.) 322 323 Re-vamp the code for starting up the child login 324 process. The code was getting ugly, and it was 325 hard to tell what was really going on. What we 326 do now is after the fork(), in the child: 327 1) make sure we have no controlling tty 328 2) open and initialize the tty 329 3) do a setsid()/setpgrp() 330 4) makes the tty our controlling tty. 331 On some systems, #2 makes the tty our controlling 332 tty, and #4 is a no-op. The parent process does 333 a gets rid of any controlling tty after the child 334 is fork()ed. 335 336 Use the strdup() library routine in telnet, instead 337 of the local savestr() routine. If you don't have 338 strdup(), you need to define NO_STRDUP. 339 340 Add support for ^T (SIGINFO/VSTATUS), found in the 341 4.3Reno distribution. This maps to the AYT character. 342 You need a 4-line bugfix in the kernel to get this 343 to work properly: 344 345 > *** tty_pty.c.ORG Tue Sep 11 09:41:53 1990 346 > --- tty_pty.c Tue Sep 11 17:48:03 1990 347 > *************** 348 > *** 609,613 **** 349 > if ((tp->t_lflag&NOFLSH) == 0) 350 > ttyflush(tp, FREAD|FWRITE); 351 > ! pgsignal(tp->t_pgrp, *(unsigned int *)data); 352 > return(0); 353 > } 354 > --- 609,616 ---- 355 > if ((tp->t_lflag&NOFLSH) == 0) 356 > ttyflush(tp, FREAD|FWRITE); 357 > ! pgsignal(tp->t_pgrp, *(unsigned int *)data, 1); 358 > ! if ((*(unsigned int *)data == SIGINFO) && 359 > ! ((tp->t_lflag&NOKERNINFO) == 0)) 360 > ! ttyinfo(tp); 361 > return(0); 362 > } 363 364 The client is now smarter when setting the telnet escape 365 character; it only sets it to one of VEOL and VEOL2 if 366 one of them is undefined, and the other one is not already 367 defined to the telnet escape character. 368 369 Handle TERMIOS systems that have seperate input and output 370 line speed settings imbedded in the flags. 371 372 Many other minor bug fixes. 373 374June 20, 1990: 375 Re-organize makefiles and source tree. The telnet/Source 376 directory is now gone, and all the source that was in 377 telnet/Source is now just in the telnet directory. 378 379 Seperate makefile for each system are now gone. There 380 are two makefiles, Makefile and Makefile.generic. 381 The "Makefile" has the definitions for the various 382 system, and "Makefile.generic" does all the work. 383 There is a variable called "WHAT" that is used to 384 specify what to make. For example, in the telnet 385 directory, you might say: 386 make 4.4bsd WHAT=clean 387 to clean out the directory. 388 389 Add support for the ENVIRON and XDISPLOC options. 390 In order for the server to work, login has to have 391 the "-p" option to preserve environment variables. 392 393 Add the SOFT_TAB and LIT_ECHO modes in the LINEMODE support. 394 395 Add the "-l user" option to command line and open command 396 (This is passed through the ENVIRON option). 397 398 Add the "-e" command line option, for setting the escape 399 character. 400 401 Add the "-D", diagnostic, option to the server. This allows 402 the server to print out debug information, which is very 403 useful when trying to debug a telnet that doesn't have any 404 debugging ability. 405 406 Turn off the literal next character when not in LINEMODE. 407 408 Don't recognize ^Y locally, just pass it through. 409 410 Make minor modifications for Sun4.0 and Sun4.1 411 412 Add support for both FORW1 and FORW2 characters. The 413 telnet escpape character is set to whichever of the 414 two is not being used. If both are in use, the escape 415 character is not set, so when in linemode the user will 416 have to follow the escape character with a <CR> or <EOF) 417 to get it passed through. 418 419 Commands can now be put in single and double quotes, and 420 a backslash is now an escape character. This is needed 421 for allowing arbitrary strings to be assigned to environment 422 variables. 423 424 Switch telnetd to use macros like telnet for keeping 425 track of the state of all the options. 426 427 Fix telnetd's processing of options so that we always do 428 the right processing of the LINEMODE option, regardless 429 of who initiates the request to turn it on. Also, make 430 sure that if the other side went "WILL ECHO" in response 431 to our "DO ECHO", that we send a "DONT ECHO" to get the 432 option turned back off! 433 434 Fix the TERMIOS setting of the terminal speed to handle both 435 BSD's seperate fields, and the SYSV method of CBAUD bits. 436 437 Change how we deal with the other side refusing to enable 438 an option. The sequence used to be: send DO option; receive 439 WONT option; send DONT option. Now, the sequence is: send 440 DO option; receive WONT option. Both should be valid 441 according to the spec, but there has been at least one 442 client implementation of telnet identified that can get 443 really confused by this. (The exact sequence, from a trace 444 on the server side, is (numbers are number of responses that 445 we expect to get after that line...): 446 447 send WILL ECHO 1 (initial request) 448 send WONT ECHO 2 (server is changing state) 449 recv DO ECHO 1 (first reply, ok. expect DONT ECHO next) 450 send WILL ECHO 2 (server changes state again) 451 recv DONT ECHO 1 (second reply, ok. expect DO ECHO next) 452 recv DONT ECHO 0 (third reply, wrong answer. got DONT!!!) 453 *** send WONT ECHO (send WONT to acknowledge the DONT) 454 send WILL ECHO 1 (ask again to enable option) 455 recv DO ECHO 0 456 457 recv DONT ECHO 0 458 send WONT ECHO 1 459 recv DONT ECHO 0 460 recv DO ECHO 1 461 send WILL ECHO 0 462 (and the last 5 lines loop forever) 463 464 The line with the "***" is last of the WILL/DONT/WONT sequence. 465 The change to the server to not generate that makes this same 466 example become: 467 468 send will ECHO 1 469 send wont ECHO 2 470 recv do ECHO 1 471 send will ECHO 2 472 recv dont ECHO 1 473 recv dont ECHO 0 474 recv do ECHO 1 475 send will ECHO 0 476 477 There is other option negotiation going on, and not sending 478 the third part changes some of the timings, but this specific 479 example no longer gets stuck in a loop. The "telnet.state" 480 file has been modified to reflect this change to the algorithm. 481 482 A bunch of miscellaneous bug fixes and changes to make 483 lint happier. 484 485 This version of telnet also has some KERBEROS stuff in 486 it. This has not been tested, it uses an un-authorized 487 telnet option number, and uses an out-of-date version 488 of the (still being defined) AUTHENTICATION option. 489 There is no support for this code, do not enable it. 490 491 492March 1, 1990: 493CHANGES/BUGFIXES SINCE LAST RELEASE: 494 Some support for IP TOS has been added. Requires that the 495 kernel support the IP_TOS socket option (currently this 496 is only in UNICOS 6.0). 497 498 Both telnet and telnetd now use the cc_t typedef. typedefs are 499 included for systems that don't have it (in termios.h). 500 501 SLC_SUSP was not supported properly before. It is now. 502 503 IAC EOF was not translated properly in telnetd for SYSV_TERMIO 504 when not in linemode. It now saves a copy of the VEOF character, 505 so that when ICANON is turned off and we can't trust it anymore 506 (because it is now the VMIN character) we use the saved value. 507 508 There were two missing "break" commands in the linemode 509 processing code in telnetd. 510 511 Telnetd wasn't setting the kernel window size information 512 properly. It was using the rows for both rows and columns... 513 514Questions/comments go to 515 David Borman 516 Cray Research, Inc. 517 655F Lone Oak Drive 518 Eagan, MN 55123 519 dab@cray.com. 520 521README: You are reading it. 522 523Config.generic: 524 This file contains all the OS specific definitions. It 525 has pre-definitions for many common system types, and is 526 in standard makefile fromat. See the comments at the top 527 of the file for more information. 528 529Config.local: 530 This is not part of the distribution, but if this file exists, 531 it is used instead of "Config.generic". This allows site 532 specific configuration without having to modify the distributed 533 "Config.generic" file. 534 535kern.diff: 536 This file contains the diffs for the changes needed for the 537 kernel to support LINEMODE is the server. These changes are 538 for a 4.3BSD system. You may need to make some changes for 539 your particular system. 540 541 There is a new bit in the terminal state word, TS_EXTPROC. 542 When this bit is set, several aspects of the terminal driver 543 are disabled. Input line editing, character echo, and 544 mapping of signals are all disabled. This allows the telnetd 545 to turn of these functions when in linemode, but still keep 546 track of what state the user wants the terminal to be in. 547 548 New ioctl()s: 549 550 TIOCEXT Turn on/off the TS_EXTPROC bit 551 TIOCGSTATE Get t_state of tty to look at TS_EXTPROC bit 552 TIOCSIG Generate a signal to processes in the 553 current process group of the pty. 554 555 There is a new mode for packet driver, the TIOCPKT_IOCTL bit. 556 When packet mode is turned on in the pty, and the TS_EXTPROC 557 bit is set, then whenever the state of the pty is changed, the 558 next read on the master side of the pty will have the TIOCPKT_IOCTL 559 bit set, and the data will contain the following: 560 struct xx { 561 struct sgttyb a; 562 struct tchars b; 563 struct ltchars c; 564 int t_state; 565 int t_flags; 566 } 567 This allows the process on the server side of the pty to know 568 when the state of the terminal has changed, and what the new 569 state is. 570 571 However, if you define USE_TERMIO or SYSV_TERMIO, the code will 572 expect that the structure returned in the TIOCPKT_IOCTL is 573 the termio/termios structure. 574 575stty.diff: 576 This file contains the changes needed for the stty(1) program 577 to report on the current status of the TS_EXTPROC bit. It also 578 allows the user to turn on/off the TS_EXTPROC bit. This is useful 579 because it allows the user to say "stty -extproc", and the 580 LINEMODE option will be automatically disabled, and saying "stty 581 extproc" will re-enable the LINEMODE option. 582 583telnet.state: 584 Both the client and server have code in them to deal 585 with option negotiation loops. The algorithm that is 586 used is described in this file. 587 588telnet: 589 This directory contains the client code. No kernel changes are 590 needed to use this code. 591 592telnetd: 593 This directory contains the server code. If LINEMODE or KLUDGELINEMODE 594 are defined, then the kernel modifications listed above are needed. 595 596libtelnet: 597 This directory contains code that is common to both the client 598 and the server. 599 600arpa: 601 This directory has a new <arpa/telnet.h> 602 603libtelnet/Makefile.4.4: 604telnet/Makefile.4.4: 605telnetd/Makefile.4.4: 606 These are the makefiles that can be used on a 4.3Reno 607 system when this software is installed in /usr/src/lib/libtelnet, 608 /usr/src/libexec/telnetd, and /usr/src/usr.bin/telnet. 609 610 611The following TELNET options are supported: 612 613 LINEMODE: 614 The LINEMODE option is supported as per RFC1116. The 615 FORWARDMASK option is not currently supported. 616 617 BINARY: The client has the ability to turn on/off the BINARY 618 option in each direction. Turning on BINARY from 619 server to client causes the LITOUT bit to get set in 620 the terminal driver on both ends, turning on BINARY 621 from the client to the server causes the PASS8 bit 622 to get set in the terminal driver on both ends. 623 624 TERMINAL-TYPE: 625 This is supported as per RFC1091. On the server side, 626 when a terminal type is received, termcap/terminfo 627 is consulted to determine if it is a known terminal 628 type. It keeps requesting terminal types until it 629 gets one that it recongnizes, or hits the end of the 630 list. The server side looks up the entry in the 631 termcap/terminfo data base, and generates a list of 632 names which it then passes one at a time to each 633 request for a terminal type, duplicating the last 634 entry in the list before cycling back to the beginning. 635 636 NAWS: The Negotiate about Window Size, as per RFC 1073. 637 638 TERMINAL-SPEED: 639 Implemented as per RFC 1079 640 641 TOGGLE-FLOW-CONTROL: 642 Implemented as per RFC 1080 643 644 TIMING-MARK: 645 As per RFC 860 646 647 SGA: As per RFC 858 648 649 ECHO: As per RFC 857 650 651 LOGOUT: As per RFC 727 652 653 STATUS: 654 The server will send its current status upon 655 request. It does not ask for the clients status. 656 The client will request the servers current status 657 from the "send getstatus" command. 658 659 ENVIRON: 660 This option is currently being defined by the IETF 661 Telnet Working Group, and an RFC has not yet been 662 issued, but should be in the near future... 663 664 X-DISPLAY-LOCATION: 665 This functionality can be done through the ENVIRON 666 option, it is added here for completeness. 667 668 AUTHENTICATION: 669 This option is currently being defined by the IETF 670 Telnet Working Group, and an RFC has not yet been 671 issued. The basic framework is pretty much decided, 672 but the definitions for the specific authentication 673 schemes is still in a state of flux. 674 675 ENCRYPTION: 676 This option is currently being defined by the IETF 677 Telnet Working Group, and an RFC has not yet been 678 issued. The draft RFC is still in a state of flux, 679 so this code may change in the future. 680