113e3f4d6SMark Murray 213e3f4d6SMark MurrayThis is a distribution of both client and server telnet. These programs 313e3f4d6SMark Murrayhave been compiled on: 413e3f4d6SMark Murray telnet telnetd 513e3f4d6SMark Murray 4.4 BSD-Lite x x 613e3f4d6SMark Murray 4.3 BSD Reno X X 713e3f4d6SMark Murray UNICOS 9.1 X X 813e3f4d6SMark Murray UNICOS 9.0 X X 913e3f4d6SMark Murray UNICOS 8.0 X X 1013e3f4d6SMark Murray BSDI 2.0 X X 1113e3f4d6SMark Murray Solaris 2.4 x x (no linemode in server) 1213e3f4d6SMark Murray SunOs 4.1.4 X X (no linemode in server) 1313e3f4d6SMark Murray Ultrix 4.3 X X (no linemode in server) 1413e3f4d6SMark Murray Ultrix 4.1 X X (no linemode in server) 1513e3f4d6SMark Murray 1613e3f4d6SMark MurrayIn addition, previous versions have been compiled on the following 1713e3f4d6SMark Murraymachines, but were not available for testing this version. 1813e3f4d6SMark Murray telnet telnetd 1913e3f4d6SMark Murray Next1.0 X X 2013e3f4d6SMark Murray UNICOS 8.3 X X 2113e3f4d6SMark Murray UNICOS 7.C X X 2213e3f4d6SMark Murray UNICOS 7.0 X X 2313e3f4d6SMark Murray SunOs 4.0.3c X X (no linemode in server) 2413e3f4d6SMark Murray 4.3 BSD X X (no linemode in server) 2513e3f4d6SMark Murray DYNIX V3.0.12 X X (no linemode in server) 2613e3f4d6SMark Murray Ultrix 3.1 X X (no linemode in server) 2713e3f4d6SMark Murray Ultrix 4.0 X X (no linemode in server) 2813e3f4d6SMark Murray SunOs 3.5 X X (no linemode in server) 2913e3f4d6SMark Murray SunOs 4.1.3 X X (no linemode in server) 3013e3f4d6SMark Murray Solaris 2.2 x x (no linemode in server) 3113e3f4d6SMark Murray Solaris 2.3 x x (no linemode in server) 3213e3f4d6SMark Murray BSDI 1.0 X X 3313e3f4d6SMark Murray BSDI 1.1 X X 3413e3f4d6SMark Murray DYNIX V3.0.17.9 X X (no linemode in server) 3513e3f4d6SMark Murray HP-UX 8.0 x x (no linemode in server) 3613e3f4d6SMark Murray 3713e3f4d6SMark MurrayThis code should work, but there are no guarantees. 3813e3f4d6SMark Murray 3913e3f4d6SMark MurrayMay 30, 1995 4013e3f4d6SMark Murray 4113e3f4d6SMark MurrayThis release represents what is on the 4.4BSD-Lite2 release, which 4213e3f4d6SMark Murrayshould be the final BSD release. I will continue to support of 4313e3f4d6SMark Murraytelnet, The code (without encryption) is available via anonymous ftp 4413e3f4d6SMark Murrayfrom ftp.cray.com, in src/telnet/telnet.YY.MM.DD.NE.tar.Z, where 4513e3f4d6SMark MurrayYY.MM.DD is replaced with the year, month and day of the release. 4613e3f4d6SMark MurrayIf you can't find it at one of these places, at some point in the 4713e3f4d6SMark Murraynear future information about the latest releases should be available 4813e3f4d6SMark Murrayfrom ftp.borman.com. 4913e3f4d6SMark Murray 5013e3f4d6SMark MurrayIn addition, the version with the encryption code is available via 5113e3f4d6SMark Murrayftp from net-dist.mit.edu, in the directory /pub/telnet. There 5213e3f4d6SMark Murrayis a README file there that gives further information on how 5313e3f4d6SMark Murrayto get the distribution. 5413e3f4d6SMark Murray 5513e3f4d6SMark MurrayQuestions, comments, bug reports and bug fixes can be sent to 5613e3f4d6SMark Murrayone of these addresses: 5713e3f4d6SMark Murray dab@borman.com 5813e3f4d6SMark Murray dab@cray.com 5913e3f4d6SMark Murray dab@bsdi.com 6013e3f4d6SMark Murray 6113e3f4d6SMark MurrayThis release is mainly bug fixes and code cleanup. 6213e3f4d6SMark Murray 6313e3f4d6SMark Murray Replace all calls to bcopy()/bzero() with calls to 6413e3f4d6SMark Murray memmove()/memset() and all calls to index()/rindex() 6513e3f4d6SMark Murray with calls to strchr()/strrchr(). 6613e3f4d6SMark Murray 6713e3f4d6SMark Murray Add some missing diagnostics for option tracing 6813e3f4d6SMark Murray to telnetd. 6913e3f4d6SMark Murray 7013e3f4d6SMark Murray Add support for BSDI 2.0 and Solaris 2.4. 7113e3f4d6SMark Murray 7213e3f4d6SMark Murray Add support for UNICOS 8.0 7313e3f4d6SMark Murray 7413e3f4d6SMark Murray Get rid of expanded tabs and trailing white spaces. 7513e3f4d6SMark Murray 7613e3f4d6SMark Murray From Paul Vixie: 7713e3f4d6SMark Murray Fix for telnet going into an endless spin 7813e3f4d6SMark Murray when the session dies abnormally. 7913e3f4d6SMark Murray 8013e3f4d6SMark Murray From Jef Poskanzer: 8113e3f4d6SMark Murray Changes to allow telnet to compile 8213e3f4d6SMark Murray under SunOS 3.5. 8313e3f4d6SMark Murray 8413e3f4d6SMark Murray From Philip Guenther: 8513e3f4d6SMark Murray makeutx() doesn't expand utmpx, 8613e3f4d6SMark Murray use pututxline() instead. 8713e3f4d6SMark Murray 8813e3f4d6SMark Murray From Chris Torek: 8913e3f4d6SMark Murray Add a sleep(1) before execing login 9013e3f4d6SMark Murray to avoid race condition that can eat 9113e3f4d6SMark Murray up the login prompt. 9213e3f4d6SMark Murray Use terminal speed directly if it is 9313e3f4d6SMark Murray not an encoded value. 9413e3f4d6SMark Murray 9513e3f4d6SMark Murray From Steve Parker: 9613e3f4d6SMark Murray Fix to realloc() call. Fix for execing 9713e3f4d6SMark Murray login on solaris with no user name. 9813e3f4d6SMark Murray 9913e3f4d6SMark MurrayJanuary 19, 1994 10013e3f4d6SMark Murray 10113e3f4d6SMark MurrayThis is a list of some of the changes since the last tar release 10213e3f4d6SMark Murrayof telnet/telnetd. There are probably other changes that aren't 10313e3f4d6SMark Murraylisted here, but this should hit a lot of the main ones. 10413e3f4d6SMark Murray 10513e3f4d6SMark Murray General: 10613e3f4d6SMark Murray Changed #define for AUTHENTICATE to AUTHENTICATION 10713e3f4d6SMark Murray Changed #define for ENCRYPT to ENCRYPTION 10813e3f4d6SMark Murray Changed #define for DES_ENCRYPT to DES_ENCRYPTION 10913e3f4d6SMark Murray 11013e3f4d6SMark Murray Added support for SPX authentication: -DSPX 11113e3f4d6SMark Murray 11213e3f4d6SMark Murray Added support for Kerberos Version 5 authentication: -DKRB5 11313e3f4d6SMark Murray 11413e3f4d6SMark Murray Added support for ANSI C function prototypes 11513e3f4d6SMark Murray 11613e3f4d6SMark Murray Added support for the NEW-ENVIRON option (RFC-1572) 11713e3f4d6SMark Murray including support for USERVAR. 11813e3f4d6SMark Murray 11913e3f4d6SMark Murray Made support for the old Environment Option (RFC-1408) 12013e3f4d6SMark Murray conditional on -DOLD_ENVIRON 12113e3f4d6SMark Murray 12213e3f4d6SMark Murray Added #define ENV_HACK - support for RFC 1571 12313e3f4d6SMark Murray 12413e3f4d6SMark Murray The encryption code is removed from the public distributions. 12513e3f4d6SMark Murray Domestic 4.4 BSD distributions contain the encryption code. 12613e3f4d6SMark Murray 12713e3f4d6SMark Murray ENV_HACK: Code to deal with systems that only implement 12813e3f4d6SMark Murray the old ENVIRON option, and have reversed definitions 12913e3f4d6SMark Murray of ENV_VAR and ENV_VAL. Also fixes ENV processing in 13013e3f4d6SMark Murray client to handle things besides just the default set... 13113e3f4d6SMark Murray 13213e3f4d6SMark Murray NO_BSD_SETJMP: UNICOS configuration for 13313e3f4d6SMark Murray UNICOS 6.1/6.0/5.1/5.0 systems. 13413e3f4d6SMark Murray 13513e3f4d6SMark Murray STREAMSPTY: Use /dev/ptmx to get a clean pty. This 13613e3f4d6SMark Murray is for SVr4 derivatives (Like Solaris) 13713e3f4d6SMark Murray 13813e3f4d6SMark Murray UTMPX: For systems that have /etc/utmpx. This is for 13913e3f4d6SMark Murray SVr4 derivatives (Like Solaris) 14013e3f4d6SMark Murray 14113e3f4d6SMark Murray Definitions for BSDI 1.0 14213e3f4d6SMark Murray 14313e3f4d6SMark Murray Definitions for 4.3 Reno and 4.4 BSD. 14413e3f4d6SMark Murray 14513e3f4d6SMark Murray Definitions for UNICOS 8.0 and UNICOS 7.C 14613e3f4d6SMark Murray 14713e3f4d6SMark Murray Definitions for Solaris 2.0 14813e3f4d6SMark Murray 14913e3f4d6SMark Murray Definitions for HP-UX 8.0 15013e3f4d6SMark Murray 15113e3f4d6SMark Murray Latest Copyright notices from Berkeley. 15213e3f4d6SMark Murray 15313e3f4d6SMark Murray FLOW-CONTROL: support for RFC-XXXx 15413e3f4d6SMark Murray 15513e3f4d6SMark Murray 15613e3f4d6SMark Murray Client Specific: 15713e3f4d6SMark Murray 15813e3f4d6SMark Murray Fix the "send" command to not send garbage... 15913e3f4d6SMark Murray 16013e3f4d6SMark Murray Fix status message for "skiprc" 16113e3f4d6SMark Murray 16213e3f4d6SMark Murray Make sure to send NAWS after telnet has been suspended 16313e3f4d6SMark Murray or an external command has been run, if the window size 16413e3f4d6SMark Murray has changed. 16513e3f4d6SMark Murray 16613e3f4d6SMark Murray sysV88 support. 16713e3f4d6SMark Murray 16813e3f4d6SMark Murray Server Specific: 16913e3f4d6SMark Murray 17013e3f4d6SMark Murray Support flowcontrol option in non-linemode servers. 17113e3f4d6SMark Murray 17213e3f4d6SMark Murray -k Server supports Kludge Linemode, but will default to 17313e3f4d6SMark Murray either single character mode or real Linemode support. 17413e3f4d6SMark Murray The user will have to explicitly ask to switch into 17513e3f4d6SMark Murray kludge linemode. ("stty extproc", or escape back to 17613e3f4d6SMark Murray to telnet and say "mode line".) 17713e3f4d6SMark Murray 17813e3f4d6SMark Murray -u Specify the length of the hostname field in the utmp 17913e3f4d6SMark Murray file. Hostname longer than this length will be put 18013e3f4d6SMark Murray into the utmp file in dotted decimal notation, rather 18113e3f4d6SMark Murray than putting in a truncated hostname. 18213e3f4d6SMark Murray 18313e3f4d6SMark Murray -U Registered hosts only. If a reverse hostname lookup 18413e3f4d6SMark Murray fails, the connection will be refused. 18513e3f4d6SMark Murray 18613e3f4d6SMark Murray -f/-F 18713e3f4d6SMark Murray Allows forwarding of credentials for KRB5. 18813e3f4d6SMark Murray 18913e3f4d6SMark MurrayFebrurary 22, 1991: 19013e3f4d6SMark Murray 19113e3f4d6SMark Murray Features: 19213e3f4d6SMark Murray 19313e3f4d6SMark Murray This version of telnet/telnetd has support for both 19413e3f4d6SMark Murray the AUTHENTICATION and ENCRYPTION options. The 19513e3f4d6SMark Murray AUTHENTICATION option is fairly well defined, and 19613e3f4d6SMark Murray an option number has been assigned to it. The 19713e3f4d6SMark Murray ENCRYPTION option is still in a state of flux; an 19813e3f4d6SMark Murray option number has been assigned to, but it is still 19913e3f4d6SMark Murray subject to change. The code is provided in this release 20013e3f4d6SMark Murray for experimental and testing purposes. 20113e3f4d6SMark Murray 20213e3f4d6SMark Murray The telnet "send" command can now be used to send 20313e3f4d6SMark Murray do/dont/will/wont commands, with any telnet option 20413e3f4d6SMark Murray name. The rules for when do/dont/will/wont are sent 20513e3f4d6SMark Murray are still followed, so just because the user requests 20613e3f4d6SMark Murray that one of these be sent doesn't mean that it will 20713e3f4d6SMark Murray be sent... 20813e3f4d6SMark Murray 20913e3f4d6SMark Murray The telnet "getstatus" command no longer requires 21013e3f4d6SMark Murray that option printing be enabled to see the response 21113e3f4d6SMark Murray to the "DO STATUS" command. 21213e3f4d6SMark Murray 21313e3f4d6SMark Murray A -n flag has been added to telnetd to disable 21413e3f4d6SMark Murray keepalives. 21513e3f4d6SMark Murray 21613e3f4d6SMark Murray A new telnet command, "auth" has been added (if 21713e3f4d6SMark Murray AUTHENTICATE is defined). It has four sub-commands, 21813e3f4d6SMark Murray "status", "disable", "enable" and "help". 21913e3f4d6SMark Murray 22013e3f4d6SMark Murray A new telnet command, "encrypt" has been added (if 22113e3f4d6SMark Murray ENCRYPT is defined). It has many sub-commands: 22213e3f4d6SMark Murray "enable", "type", "start", "stop", "input", 22313e3f4d6SMark Murray "-input", "output", "-output", "status", and "help". 22413e3f4d6SMark Murray 22513e3f4d6SMark Murray The LOGOUT option is now supported by both telnet 22613e3f4d6SMark Murray and telnetd, a new command, "logout", was added 22713e3f4d6SMark Murray to support this. 22813e3f4d6SMark Murray 22913e3f4d6SMark Murray Several new toggle options were added: 23013e3f4d6SMark Murray "autoencrypt", "autodecrypt", "autologin", "authdebug", 23113e3f4d6SMark Murray "encdebug", "skiprc", "verbose_encrypt" 23213e3f4d6SMark Murray 23313e3f4d6SMark Murray An "rlogin" interface has been added. If the program 23413e3f4d6SMark Murray is named "rlogin", or the "-r" flag is given, then 23513e3f4d6SMark Murray an rlogin type of interface will be used. 23613e3f4d6SMark Murray ~. Terminates the session 23713e3f4d6SMark Murray ~<susp> Suspend the session 23813e3f4d6SMark Murray ~^] Escape to telnet command mode 23913e3f4d6SMark Murray ~~ Pass through the ~. 24013e3f4d6SMark Murray BUG: If you type the rlogin escape character 24113e3f4d6SMark Murray in the middle of a line while in rlogin 24213e3f4d6SMark Murray mode, you cannot erase it or any characters 24313e3f4d6SMark Murray before it. Hopefully this can be fixed 24413e3f4d6SMark Murray in a future release... 24513e3f4d6SMark Murray 24613e3f4d6SMark Murray General changes: 24713e3f4d6SMark Murray 24813e3f4d6SMark Murray A "libtelnet.a" has now been created. This libraray 24913e3f4d6SMark Murray contains code that is common to both telnet and 25013e3f4d6SMark Murray telnetd. This is also where library routines that 25113e3f4d6SMark Murray are needed, but are not in the standard C library, 25213e3f4d6SMark Murray are placed. 25313e3f4d6SMark Murray 25413e3f4d6SMark Murray The makefiles have been re-done. All of the site 25513e3f4d6SMark Murray specific configuration information has now been put 25613e3f4d6SMark Murray into a single "Config.generic" file, in the top level 25713e3f4d6SMark Murray directory. Changing this one file will take care of 25813e3f4d6SMark Murray all three subdirectories. Also, to add a new/local 25913e3f4d6SMark Murray definition, a "Config.local" file may be created 26013e3f4d6SMark Murray at the top level; if that file exists, the subdirectories 26113e3f4d6SMark Murray will use that file instead of "Config.generic". 26213e3f4d6SMark Murray 26313e3f4d6SMark Murray Many 1-2 line functions in commands.c have been 26413e3f4d6SMark Murray removed, and just inserted in-line, or replaced 26513e3f4d6SMark Murray with a macro. 26613e3f4d6SMark Murray 26713e3f4d6SMark Murray Bug Fixes: 26813e3f4d6SMark Murray 26913e3f4d6SMark Murray The non-termio code in both telnet and telnetd was 27013e3f4d6SMark Murray setting/clearing CTLECH in the sg_flags word. This 27113e3f4d6SMark Murray was incorrect, and has been changed to set/clear the 27213e3f4d6SMark Murray LCTLECH bit in the local mode word. 27313e3f4d6SMark Murray 27413e3f4d6SMark Murray The SRCRT #define has been removed. If IP_OPTIONS 27513e3f4d6SMark Murray and IPPROTO_IP are defined on the system, then the 27613e3f4d6SMark Murray source route code is automatically enabled. 27713e3f4d6SMark Murray 27813e3f4d6SMark Murray The NO_GETTYTAB #define has been removed; there 27913e3f4d6SMark Murray is a compatability routine that can be built into 28013e3f4d6SMark Murray libtelnet to achive the same results. 28113e3f4d6SMark Murray 28213e3f4d6SMark Murray The server, telnetd, has been switched to use getopt() 28313e3f4d6SMark Murray for parsing the argument list. 28413e3f4d6SMark Murray 28513e3f4d6SMark Murray The code for getting the input/output speeds via 28613e3f4d6SMark Murray cfgetispeed()/cfgetospeed() was still not quite 28713e3f4d6SMark Murray right in telnet. Posix says if the ispeed is 0, 28813e3f4d6SMark Murray then it is really equal to the ospeed. 28913e3f4d6SMark Murray 29013e3f4d6SMark Murray The suboption processing code in telnet now has 29113e3f4d6SMark Murray explicit checks to make sure that we received 29213e3f4d6SMark Murray the entire suboption (telnetd was already doing this). 29313e3f4d6SMark Murray 29413e3f4d6SMark Murray The telnet code for processing the terminal type 29513e3f4d6SMark Murray could cause a core dump if an existing connection 29613e3f4d6SMark Murray was closed, and a new connection opened without 29713e3f4d6SMark Murray exiting telnet. 29813e3f4d6SMark Murray 29913e3f4d6SMark Murray Telnetd was doing a TCSADRAIN when setting the new 30013e3f4d6SMark Murray terminal settings; This is not good, because it means 30113e3f4d6SMark Murray that the tcsetattr() will hang waiting for output to 30213e3f4d6SMark Murray drain, and telnetd is the only one that will drain 30313e3f4d6SMark Murray the output... The fix is to use TCSANOW which does 30413e3f4d6SMark Murray not wait. 30513e3f4d6SMark Murray 30613e3f4d6SMark Murray Telnetd was improperly setting/clearing the ISTRIP 30713e3f4d6SMark Murray flag in the c_lflag field, it should be using the 30813e3f4d6SMark Murray c_iflag field. 30913e3f4d6SMark Murray 31013e3f4d6SMark Murray When the child process of telnetd was opening the 31113e3f4d6SMark Murray slave side of the pty, it was re-setting the EXTPROC 31213e3f4d6SMark Murray bit too early, and some of the other initialization 31313e3f4d6SMark Murray code was wiping it out. This would cause telnetd 31413e3f4d6SMark Murray to go out of linemode and into single character mode. 31513e3f4d6SMark Murray 31613e3f4d6SMark Murray One instance of leaving linemode in telnetd forgot 31713e3f4d6SMark Murray to send a WILL ECHO to the client, the net result 31813e3f4d6SMark Murray would be that the user would see double character 31913e3f4d6SMark Murray echo. 32013e3f4d6SMark Murray 32113e3f4d6SMark Murray If the MODE was being changed several times very 32213e3f4d6SMark Murray quickly, telnetd could get out of sync with the 32313e3f4d6SMark Murray state changes and the returning acks; and wind up 32413e3f4d6SMark Murray being left in the wrong state. 32513e3f4d6SMark Murray 32613e3f4d6SMark MurraySeptember 14, 1990: 32713e3f4d6SMark Murray 32813e3f4d6SMark Murray Switch the client to use getopt() for parsing the 32913e3f4d6SMark Murray argument list. The 4.3Reno getopt.c is included for 33013e3f4d6SMark Murray systems that don't have getopt(). 33113e3f4d6SMark Murray 33213e3f4d6SMark Murray Use the posix _POSIX_VDISABLE value for what value 33313e3f4d6SMark Murray to use when disabling special characters. If this 33413e3f4d6SMark Murray is undefined, it defaults to 0x3ff. 33513e3f4d6SMark Murray 33613e3f4d6SMark Murray For non-termio systems, TIOCSETP was being used to 33713e3f4d6SMark Murray change the state of the terminal. This causes the 33813e3f4d6SMark Murray input queue to be flushed, which we don't want. This 33913e3f4d6SMark Murray is now changed to TIOCSETN. 34013e3f4d6SMark Murray 34113e3f4d6SMark Murray Take out the "#ifdef notdef" around the code in the 34213e3f4d6SMark Murray server that generates a "sync" when the pty oputput 34313e3f4d6SMark Murray is flushed. The potential problem is that some older 34413e3f4d6SMark Murray telnet clients may go into an infinate loop when they 34513e3f4d6SMark Murray receive a "sync", if so, the server can be compiled 34613e3f4d6SMark Murray with "NO_URGENT" defined. 34713e3f4d6SMark Murray 34813e3f4d6SMark Murray Fix the client where it was setting/clearing the OPOST 34913e3f4d6SMark Murray bit in the c_lflag field, not the c_oflag field. 35013e3f4d6SMark Murray 35113e3f4d6SMark Murray Fix the client where it was setting/clearing the ISTRIP 35213e3f4d6SMark Murray bit in the c_lflag field, not the c_iflag field. (On 35313e3f4d6SMark Murray 4.3Reno, this is the ECHOPRT bit in the c_lflag field.) 35413e3f4d6SMark Murray The client also had its interpretation of WILL BINARY 35513e3f4d6SMark Murray and DO BINARY reversed. 35613e3f4d6SMark Murray 35713e3f4d6SMark Murray Fix a bug in client that would cause a core dump when 35813e3f4d6SMark Murray attempting to remove the last environment variable. 35913e3f4d6SMark Murray 36013e3f4d6SMark Murray In the client, there were a few places were switch() 36113e3f4d6SMark Murray was being passed a character, and if it was a negative 36213e3f4d6SMark Murray value, it could get sign extended, and not match 36313e3f4d6SMark Murray the 8 bit case statements. The fix is to and the 36413e3f4d6SMark Murray switch value with 0xff. 36513e3f4d6SMark Murray 36613e3f4d6SMark Murray Add a couple more printoption() calls in the client, I 36713e3f4d6SMark Murray don't think there are any more places were a telnet 36813e3f4d6SMark Murray command can be received and not printed out when 36913e3f4d6SMark Murray "options" is on. 37013e3f4d6SMark Murray 37113e3f4d6SMark Murray A new flag has been added to the client, "-a". Currently, 37213e3f4d6SMark Murray this just causes the USER name to be sent across, in 37313e3f4d6SMark Murray the future this may be used to signify that automatic 37413e3f4d6SMark Murray authentication is requested. 37513e3f4d6SMark Murray 37613e3f4d6SMark Murray The USER variable is now only sent by the client if 37713e3f4d6SMark Murray the "-a" or "-l user" options are explicity used, or 37813e3f4d6SMark Murray if the user explicitly asks for the "USER" environment 37913e3f4d6SMark Murray variable to be exported. In the server, if it receives 38013e3f4d6SMark Murray the "USER" environment variable, it won't print out the 38113e3f4d6SMark Murray banner message, so that only "Password:" will be printed. 38213e3f4d6SMark Murray This makes the symantics more like rlogin, and should be 38313e3f4d6SMark Murray more familiar to the user. (People are not used to 38413e3f4d6SMark Murray getting a banner message, and then getting just a 38513e3f4d6SMark Murray "Password:" prompt.) 38613e3f4d6SMark Murray 38713e3f4d6SMark Murray Re-vamp the code for starting up the child login 38813e3f4d6SMark Murray process. The code was getting ugly, and it was 38913e3f4d6SMark Murray hard to tell what was really going on. What we 39013e3f4d6SMark Murray do now is after the fork(), in the child: 39113e3f4d6SMark Murray 1) make sure we have no controlling tty 39213e3f4d6SMark Murray 2) open and initialize the tty 39313e3f4d6SMark Murray 3) do a setsid()/setpgrp() 39413e3f4d6SMark Murray 4) makes the tty our controlling tty. 39513e3f4d6SMark Murray On some systems, #2 makes the tty our controlling 39613e3f4d6SMark Murray tty, and #4 is a no-op. The parent process does 39713e3f4d6SMark Murray a gets rid of any controlling tty after the child 39813e3f4d6SMark Murray is fork()ed. 39913e3f4d6SMark Murray 40013e3f4d6SMark Murray Use the strdup() library routine in telnet, instead 40113e3f4d6SMark Murray of the local savestr() routine. If you don't have 40213e3f4d6SMark Murray strdup(), you need to define NO_STRDUP. 40313e3f4d6SMark Murray 40413e3f4d6SMark Murray Add support for ^T (SIGINFO/VSTATUS), found in the 40513e3f4d6SMark Murray 4.3Reno distribution. This maps to the AYT character. 40613e3f4d6SMark Murray You need a 4-line bugfix in the kernel to get this 40713e3f4d6SMark Murray to work properly: 40813e3f4d6SMark Murray 40913e3f4d6SMark Murray > *** tty_pty.c.ORG Tue Sep 11 09:41:53 1990 41013e3f4d6SMark Murray > --- tty_pty.c Tue Sep 11 17:48:03 1990 41113e3f4d6SMark Murray > *************** 41213e3f4d6SMark Murray > *** 609,613 **** 41313e3f4d6SMark Murray > if ((tp->t_lflag&NOFLSH) == 0) 41413e3f4d6SMark Murray > ttyflush(tp, FREAD|FWRITE); 41513e3f4d6SMark Murray > ! pgsignal(tp->t_pgrp, *(unsigned int *)data); 41613e3f4d6SMark Murray > return(0); 41713e3f4d6SMark Murray > } 41813e3f4d6SMark Murray > --- 609,616 ---- 41913e3f4d6SMark Murray > if ((tp->t_lflag&NOFLSH) == 0) 42013e3f4d6SMark Murray > ttyflush(tp, FREAD|FWRITE); 42113e3f4d6SMark Murray > ! pgsignal(tp->t_pgrp, *(unsigned int *)data, 1); 42213e3f4d6SMark Murray > ! if ((*(unsigned int *)data == SIGINFO) && 42313e3f4d6SMark Murray > ! ((tp->t_lflag&NOKERNINFO) == 0)) 42413e3f4d6SMark Murray > ! ttyinfo(tp); 42513e3f4d6SMark Murray > return(0); 42613e3f4d6SMark Murray > } 42713e3f4d6SMark Murray 42813e3f4d6SMark Murray The client is now smarter when setting the telnet escape 42913e3f4d6SMark Murray character; it only sets it to one of VEOL and VEOL2 if 43013e3f4d6SMark Murray one of them is undefined, and the other one is not already 43113e3f4d6SMark Murray defined to the telnet escape character. 43213e3f4d6SMark Murray 43313e3f4d6SMark Murray Handle TERMIOS systems that have seperate input and output 43413e3f4d6SMark Murray line speed settings imbedded in the flags. 43513e3f4d6SMark Murray 43613e3f4d6SMark Murray Many other minor bug fixes. 43713e3f4d6SMark Murray 43813e3f4d6SMark MurrayJune 20, 1990: 43913e3f4d6SMark Murray Re-organize makefiles and source tree. The telnet/Source 44013e3f4d6SMark Murray directory is now gone, and all the source that was in 44113e3f4d6SMark Murray telnet/Source is now just in the telnet directory. 44213e3f4d6SMark Murray 44313e3f4d6SMark Murray Seperate makefile for each system are now gone. There 44413e3f4d6SMark Murray are two makefiles, Makefile and Makefile.generic. 44513e3f4d6SMark Murray The "Makefile" has the definitions for the various 44613e3f4d6SMark Murray system, and "Makefile.generic" does all the work. 44713e3f4d6SMark Murray There is a variable called "WHAT" that is used to 44813e3f4d6SMark Murray specify what to make. For example, in the telnet 44913e3f4d6SMark Murray directory, you might say: 45013e3f4d6SMark Murray make 4.4bsd WHAT=clean 45113e3f4d6SMark Murray to clean out the directory. 45213e3f4d6SMark Murray 45313e3f4d6SMark Murray Add support for the ENVIRON and XDISPLOC options. 45413e3f4d6SMark Murray In order for the server to work, login has to have 45513e3f4d6SMark Murray the "-p" option to preserve environment variables. 45613e3f4d6SMark Murray 45713e3f4d6SMark Murray Add the SOFT_TAB and LIT_ECHO modes in the LINEMODE support. 45813e3f4d6SMark Murray 45913e3f4d6SMark Murray Add the "-l user" option to command line and open command 46013e3f4d6SMark Murray (This is passed through the ENVIRON option). 46113e3f4d6SMark Murray 46213e3f4d6SMark Murray Add the "-e" command line option, for setting the escape 46313e3f4d6SMark Murray character. 46413e3f4d6SMark Murray 46513e3f4d6SMark Murray Add the "-D", diagnostic, option to the server. This allows 46613e3f4d6SMark Murray the server to print out debug information, which is very 46713e3f4d6SMark Murray useful when trying to debug a telnet that doesn't have any 46813e3f4d6SMark Murray debugging ability. 46913e3f4d6SMark Murray 47013e3f4d6SMark Murray Turn off the literal next character when not in LINEMODE. 47113e3f4d6SMark Murray 47213e3f4d6SMark Murray Don't recognize ^Y locally, just pass it through. 47313e3f4d6SMark Murray 47413e3f4d6SMark Murray Make minor modifications for Sun4.0 and Sun4.1 47513e3f4d6SMark Murray 47613e3f4d6SMark Murray Add support for both FORW1 and FORW2 characters. The 47713e3f4d6SMark Murray telnet escpape character is set to whichever of the 47813e3f4d6SMark Murray two is not being used. If both are in use, the escape 47913e3f4d6SMark Murray character is not set, so when in linemode the user will 48013e3f4d6SMark Murray have to follow the escape character with a <CR> or <EOF) 48113e3f4d6SMark Murray to get it passed through. 48213e3f4d6SMark Murray 48313e3f4d6SMark Murray Commands can now be put in single and double quotes, and 48413e3f4d6SMark Murray a backslash is now an escape character. This is needed 48513e3f4d6SMark Murray for allowing arbitrary strings to be assigned to environment 48613e3f4d6SMark Murray variables. 48713e3f4d6SMark Murray 48813e3f4d6SMark Murray Switch telnetd to use macros like telnet for keeping 48913e3f4d6SMark Murray track of the state of all the options. 49013e3f4d6SMark Murray 49113e3f4d6SMark Murray Fix telnetd's processing of options so that we always do 49213e3f4d6SMark Murray the right processing of the LINEMODE option, regardless 49313e3f4d6SMark Murray of who initiates the request to turn it on. Also, make 49413e3f4d6SMark Murray sure that if the other side went "WILL ECHO" in response 49513e3f4d6SMark Murray to our "DO ECHO", that we send a "DONT ECHO" to get the 49613e3f4d6SMark Murray option turned back off! 49713e3f4d6SMark Murray 49813e3f4d6SMark Murray Fix the TERMIOS setting of the terminal speed to handle both 49913e3f4d6SMark Murray BSD's seperate fields, and the SYSV method of CBAUD bits. 50013e3f4d6SMark Murray 50113e3f4d6SMark Murray Change how we deal with the other side refusing to enable 50213e3f4d6SMark Murray an option. The sequence used to be: send DO option; receive 50313e3f4d6SMark Murray WONT option; send DONT option. Now, the sequence is: send 50413e3f4d6SMark Murray DO option; receive WONT option. Both should be valid 50513e3f4d6SMark Murray according to the spec, but there has been at least one 50613e3f4d6SMark Murray client implementation of telnet identified that can get 50713e3f4d6SMark Murray really confused by this. (The exact sequence, from a trace 50813e3f4d6SMark Murray on the server side, is (numbers are number of responses that 50913e3f4d6SMark Murray we expect to get after that line...): 51013e3f4d6SMark Murray 51113e3f4d6SMark Murray send WILL ECHO 1 (initial request) 51213e3f4d6SMark Murray send WONT ECHO 2 (server is changing state) 51313e3f4d6SMark Murray recv DO ECHO 1 (first reply, ok. expect DONT ECHO next) 51413e3f4d6SMark Murray send WILL ECHO 2 (server changes state again) 51513e3f4d6SMark Murray recv DONT ECHO 1 (second reply, ok. expect DO ECHO next) 51613e3f4d6SMark Murray recv DONT ECHO 0 (third reply, wrong answer. got DONT!!!) 51713e3f4d6SMark Murray *** send WONT ECHO (send WONT to acknowledge the DONT) 51813e3f4d6SMark Murray send WILL ECHO 1 (ask again to enable option) 51913e3f4d6SMark Murray recv DO ECHO 0 52013e3f4d6SMark Murray 52113e3f4d6SMark Murray recv DONT ECHO 0 52213e3f4d6SMark Murray send WONT ECHO 1 52313e3f4d6SMark Murray recv DONT ECHO 0 52413e3f4d6SMark Murray recv DO ECHO 1 52513e3f4d6SMark Murray send WILL ECHO 0 52613e3f4d6SMark Murray (and the last 5 lines loop forever) 52713e3f4d6SMark Murray 52813e3f4d6SMark Murray The line with the "***" is last of the WILL/DONT/WONT sequence. 52913e3f4d6SMark Murray The change to the server to not generate that makes this same 53013e3f4d6SMark Murray example become: 53113e3f4d6SMark Murray 53213e3f4d6SMark Murray send will ECHO 1 53313e3f4d6SMark Murray send wont ECHO 2 53413e3f4d6SMark Murray recv do ECHO 1 53513e3f4d6SMark Murray send will ECHO 2 53613e3f4d6SMark Murray recv dont ECHO 1 53713e3f4d6SMark Murray recv dont ECHO 0 53813e3f4d6SMark Murray recv do ECHO 1 53913e3f4d6SMark Murray send will ECHO 0 54013e3f4d6SMark Murray 54113e3f4d6SMark Murray There is other option negotiation going on, and not sending 54213e3f4d6SMark Murray the third part changes some of the timings, but this specific 54313e3f4d6SMark Murray example no longer gets stuck in a loop. The "telnet.state" 54413e3f4d6SMark Murray file has been modified to reflect this change to the algorithm. 54513e3f4d6SMark Murray 54613e3f4d6SMark Murray A bunch of miscellaneous bug fixes and changes to make 54713e3f4d6SMark Murray lint happier. 54813e3f4d6SMark Murray 54913e3f4d6SMark Murray This version of telnet also has some KERBEROS stuff in 55013e3f4d6SMark Murray it. This has not been tested, it uses an un-authorized 55113e3f4d6SMark Murray telnet option number, and uses an out-of-date version 55213e3f4d6SMark Murray of the (still being defined) AUTHENTICATION option. 55313e3f4d6SMark Murray There is no support for this code, do not enable it. 55413e3f4d6SMark Murray 55513e3f4d6SMark Murray 55613e3f4d6SMark MurrayMarch 1, 1990: 55713e3f4d6SMark MurrayCHANGES/BUGFIXES SINCE LAST RELEASE: 55813e3f4d6SMark Murray Some support for IP TOS has been added. Requires that the 55913e3f4d6SMark Murray kernel support the IP_TOS socket option (currently this 56013e3f4d6SMark Murray is only in UNICOS 6.0). 56113e3f4d6SMark Murray 56213e3f4d6SMark Murray Both telnet and telnetd now use the cc_t typedef. typedefs are 56313e3f4d6SMark Murray included for systems that don't have it (in termios.h). 56413e3f4d6SMark Murray 56513e3f4d6SMark Murray SLC_SUSP was not supported properly before. It is now. 56613e3f4d6SMark Murray 56713e3f4d6SMark Murray IAC EOF was not translated properly in telnetd for SYSV_TERMIO 56813e3f4d6SMark Murray when not in linemode. It now saves a copy of the VEOF character, 56913e3f4d6SMark Murray so that when ICANON is turned off and we can't trust it anymore 57013e3f4d6SMark Murray (because it is now the VMIN character) we use the saved value. 57113e3f4d6SMark Murray 57213e3f4d6SMark Murray There were two missing "break" commands in the linemode 57313e3f4d6SMark Murray processing code in telnetd. 57413e3f4d6SMark Murray 57513e3f4d6SMark Murray Telnetd wasn't setting the kernel window size information 57613e3f4d6SMark Murray properly. It was using the rows for both rows and columns... 57713e3f4d6SMark Murray 57813e3f4d6SMark MurrayQuestions/comments go to 57913e3f4d6SMark Murray David Borman 58013e3f4d6SMark Murray Cray Research, Inc. 58113e3f4d6SMark Murray 655F Lone Oak Drive 58213e3f4d6SMark Murray Eagan, MN 55123 58313e3f4d6SMark Murray dab@cray.com. 58413e3f4d6SMark Murray 58513e3f4d6SMark MurrayREADME: You are reading it. 58613e3f4d6SMark Murray 58713e3f4d6SMark MurrayConfig.generic: 58813e3f4d6SMark Murray This file contains all the OS specific definitions. It 58913e3f4d6SMark Murray has pre-definitions for many common system types, and is 59013e3f4d6SMark Murray in standard makefile fromat. See the comments at the top 59113e3f4d6SMark Murray of the file for more information. 59213e3f4d6SMark Murray 59313e3f4d6SMark MurrayConfig.local: 59413e3f4d6SMark Murray This is not part of the distribution, but if this file exists, 59513e3f4d6SMark Murray it is used instead of "Config.generic". This allows site 59613e3f4d6SMark Murray specific configuration without having to modify the distributed 59713e3f4d6SMark Murray "Config.generic" file. 59813e3f4d6SMark Murray 59913e3f4d6SMark Murraykern.diff: 60013e3f4d6SMark Murray This file contains the diffs for the changes needed for the 60113e3f4d6SMark Murray kernel to support LINEMODE is the server. These changes are 60213e3f4d6SMark Murray for a 4.3BSD system. You may need to make some changes for 60313e3f4d6SMark Murray your particular system. 60413e3f4d6SMark Murray 60513e3f4d6SMark Murray There is a new bit in the terminal state word, TS_EXTPROC. 60613e3f4d6SMark Murray When this bit is set, several aspects of the terminal driver 60713e3f4d6SMark Murray are disabled. Input line editing, character echo, and 60813e3f4d6SMark Murray mapping of signals are all disabled. This allows the telnetd 60913e3f4d6SMark Murray to turn of these functions when in linemode, but still keep 61013e3f4d6SMark Murray track of what state the user wants the terminal to be in. 61113e3f4d6SMark Murray 61213e3f4d6SMark Murray New ioctl()s: 61313e3f4d6SMark Murray 61413e3f4d6SMark Murray TIOCEXT Turn on/off the TS_EXTPROC bit 61513e3f4d6SMark Murray TIOCGSTATE Get t_state of tty to look at TS_EXTPROC bit 61613e3f4d6SMark Murray TIOCSIG Generate a signal to processes in the 61713e3f4d6SMark Murray current process group of the pty. 61813e3f4d6SMark Murray 61913e3f4d6SMark Murray There is a new mode for packet driver, the TIOCPKT_IOCTL bit. 62013e3f4d6SMark Murray When packet mode is turned on in the pty, and the TS_EXTPROC 62113e3f4d6SMark Murray bit is set, then whenever the state of the pty is changed, the 62213e3f4d6SMark Murray next read on the master side of the pty will have the TIOCPKT_IOCTL 62313e3f4d6SMark Murray bit set, and the data will contain the following: 62413e3f4d6SMark Murray struct xx { 62513e3f4d6SMark Murray struct sgttyb a; 62613e3f4d6SMark Murray struct tchars b; 62713e3f4d6SMark Murray struct ltchars c; 62813e3f4d6SMark Murray int t_state; 62913e3f4d6SMark Murray int t_flags; 63013e3f4d6SMark Murray } 63113e3f4d6SMark Murray This allows the process on the server side of the pty to know 63213e3f4d6SMark Murray when the state of the terminal has changed, and what the new 63313e3f4d6SMark Murray state is. 63413e3f4d6SMark Murray 63513e3f4d6SMark Murray However, if you define USE_TERMIO or SYSV_TERMIO, the code will 63613e3f4d6SMark Murray expect that the structure returned in the TIOCPKT_IOCTL is 63713e3f4d6SMark Murray the termio/termios structure. 63813e3f4d6SMark Murray 63913e3f4d6SMark Murraystty.diff: 64013e3f4d6SMark Murray This file contains the changes needed for the stty(1) program 64113e3f4d6SMark Murray to report on the current status of the TS_EXTPROC bit. It also 64213e3f4d6SMark Murray allows the user to turn on/off the TS_EXTPROC bit. This is useful 64313e3f4d6SMark Murray because it allows the user to say "stty -extproc", and the 64413e3f4d6SMark Murray LINEMODE option will be automatically disabled, and saying "stty 64513e3f4d6SMark Murray extproc" will re-enable the LINEMODE option. 64613e3f4d6SMark Murray 64713e3f4d6SMark Murraytelnet.state: 64813e3f4d6SMark Murray Both the client and server have code in them to deal 64913e3f4d6SMark Murray with option negotiation loops. The algorithm that is 65013e3f4d6SMark Murray used is described in this file. 65113e3f4d6SMark Murray 65213e3f4d6SMark Murraytelnet: 65313e3f4d6SMark Murray This directory contains the client code. No kernel changes are 65413e3f4d6SMark Murray needed to use this code. 65513e3f4d6SMark Murray 65613e3f4d6SMark Murraytelnetd: 65713e3f4d6SMark Murray This directory contains the server code. If LINEMODE or KLUDGELINEMODE 65813e3f4d6SMark Murray are defined, then the kernel modifications listed above are needed. 65913e3f4d6SMark Murray 66013e3f4d6SMark Murraylibtelnet: 66113e3f4d6SMark Murray This directory contains code that is common to both the client 66213e3f4d6SMark Murray and the server. 66313e3f4d6SMark Murray 66413e3f4d6SMark Murrayarpa: 66513e3f4d6SMark Murray This directory has a new <arpa/telnet.h> 66613e3f4d6SMark Murray 66713e3f4d6SMark Murraylibtelnet/Makefile.4.4: 66813e3f4d6SMark Murraytelnet/Makefile.4.4: 66913e3f4d6SMark Murraytelnetd/Makefile.4.4: 67013e3f4d6SMark Murray These are the makefiles that can be used on a 4.3Reno 67113e3f4d6SMark Murray system when this software is installed in /usr/src/lib/libtelnet, 67213e3f4d6SMark Murray /usr/src/libexec/telnetd, and /usr/src/usr.bin/telnet. 67313e3f4d6SMark Murray 67413e3f4d6SMark Murray 67513e3f4d6SMark MurrayThe following TELNET options are supported: 67613e3f4d6SMark Murray 67713e3f4d6SMark Murray LINEMODE: 67813e3f4d6SMark Murray The LINEMODE option is supported as per RFC1116. The 67913e3f4d6SMark Murray FORWARDMASK option is not currently supported. 68013e3f4d6SMark Murray 68113e3f4d6SMark Murray BINARY: The client has the ability to turn on/off the BINARY 68213e3f4d6SMark Murray option in each direction. Turning on BINARY from 68313e3f4d6SMark Murray server to client causes the LITOUT bit to get set in 68413e3f4d6SMark Murray the terminal driver on both ends, turning on BINARY 68513e3f4d6SMark Murray from the client to the server causes the PASS8 bit 68613e3f4d6SMark Murray to get set in the terminal driver on both ends. 68713e3f4d6SMark Murray 68813e3f4d6SMark Murray TERMINAL-TYPE: 68913e3f4d6SMark Murray This is supported as per RFC1091. On the server side, 69013e3f4d6SMark Murray when a terminal type is received, termcap/terminfo 69113e3f4d6SMark Murray is consulted to determine if it is a known terminal 69213e3f4d6SMark Murray type. It keeps requesting terminal types until it 69313e3f4d6SMark Murray gets one that it recongnizes, or hits the end of the 69413e3f4d6SMark Murray list. The server side looks up the entry in the 69513e3f4d6SMark Murray termcap/terminfo data base, and generates a list of 69613e3f4d6SMark Murray names which it then passes one at a time to each 69713e3f4d6SMark Murray request for a terminal type, duplicating the last 69813e3f4d6SMark Murray entry in the list before cycling back to the beginning. 69913e3f4d6SMark Murray 70013e3f4d6SMark Murray NAWS: The Negotiate about Window Size, as per RFC 1073. 70113e3f4d6SMark Murray 70213e3f4d6SMark Murray TERMINAL-SPEED: 70313e3f4d6SMark Murray Implemented as per RFC 1079 70413e3f4d6SMark Murray 70513e3f4d6SMark Murray TOGGLE-FLOW-CONTROL: 70613e3f4d6SMark Murray Implemented as per RFC 1080 70713e3f4d6SMark Murray 70813e3f4d6SMark Murray TIMING-MARK: 70913e3f4d6SMark Murray As per RFC 860 71013e3f4d6SMark Murray 71113e3f4d6SMark Murray SGA: As per RFC 858 71213e3f4d6SMark Murray 71313e3f4d6SMark Murray ECHO: As per RFC 857 71413e3f4d6SMark Murray 71513e3f4d6SMark Murray LOGOUT: As per RFC 727 71613e3f4d6SMark Murray 71713e3f4d6SMark Murray STATUS: 71813e3f4d6SMark Murray The server will send its current status upon 71913e3f4d6SMark Murray request. It does not ask for the clients status. 72013e3f4d6SMark Murray The client will request the servers current status 72113e3f4d6SMark Murray from the "send getstatus" command. 72213e3f4d6SMark Murray 72313e3f4d6SMark Murray ENVIRON: 72413e3f4d6SMark Murray This option is currently being defined by the IETF 72513e3f4d6SMark Murray Telnet Working Group, and an RFC has not yet been 72613e3f4d6SMark Murray issued, but should be in the near future... 72713e3f4d6SMark Murray 72813e3f4d6SMark Murray X-DISPLAY-LOCATION: 72913e3f4d6SMark Murray This functionality can be done through the ENVIRON 73013e3f4d6SMark Murray option, it is added here for completeness. 73113e3f4d6SMark Murray 73213e3f4d6SMark Murray AUTHENTICATION: 73313e3f4d6SMark Murray This option is currently being defined by the IETF 73413e3f4d6SMark Murray Telnet Working Group, and an RFC has not yet been 73513e3f4d6SMark Murray issued. The basic framework is pretty much decided, 73613e3f4d6SMark Murray but the definitions for the specific authentication 73713e3f4d6SMark Murray schemes is still in a state of flux. 73813e3f4d6SMark Murray 73913e3f4d6SMark Murray ENCRYPTION: 74013e3f4d6SMark Murray This option is currently being defined by the IETF 74113e3f4d6SMark Murray Telnet Working Group, and an RFC has not yet been 74213e3f4d6SMark Murray issued. The draft RFC is still in a state of flux, 74313e3f4d6SMark Murray so this code may change in the future. 744