157416Smarkm 257416SmarkmThis is a distribution of both client and server telnet. These programs 357416Smarkmhave been compiled on: 457416Smarkm telnet telnetd 557416Smarkm 4.4 BSD-Lite x x 657416Smarkm 4.3 BSD Reno X X 757416Smarkm UNICOS 9.1 X X 857416Smarkm UNICOS 9.0 X X 957416Smarkm UNICOS 8.0 X X 1057416Smarkm BSDI 2.0 X X 1157416Smarkm Solaris 2.4 x x (no linemode in server) 1257416Smarkm SunOs 4.1.4 X X (no linemode in server) 1357416Smarkm Ultrix 4.3 X X (no linemode in server) 1457416Smarkm Ultrix 4.1 X X (no linemode in server) 1557416Smarkm 1657416SmarkmIn addition, previous versions have been compiled on the following 1757416Smarkmmachines, but were not available for testing this version. 1857416Smarkm telnet telnetd 1957416Smarkm Next1.0 X X 2057416Smarkm UNICOS 8.3 X X 2157416Smarkm UNICOS 7.C X X 2257416Smarkm UNICOS 7.0 X X 2357416Smarkm SunOs 4.0.3c X X (no linemode in server) 2457416Smarkm 4.3 BSD X X (no linemode in server) 2557416Smarkm DYNIX V3.0.12 X X (no linemode in server) 2657416Smarkm Ultrix 3.1 X X (no linemode in server) 2757416Smarkm Ultrix 4.0 X X (no linemode in server) 2857416Smarkm SunOs 3.5 X X (no linemode in server) 2957416Smarkm SunOs 4.1.3 X X (no linemode in server) 3057416Smarkm Solaris 2.2 x x (no linemode in server) 3157416Smarkm Solaris 2.3 x x (no linemode in server) 3257416Smarkm BSDI 1.0 X X 3357416Smarkm BSDI 1.1 X X 3457416Smarkm DYNIX V3.0.17.9 X X (no linemode in server) 3557416Smarkm HP-UX 8.0 x x (no linemode in server) 3657416Smarkm 3757416SmarkmThis code should work, but there are no guarantees. 3857416Smarkm 3957416SmarkmMay 30, 1995 4057416Smarkm 4157416SmarkmThis release represents what is on the 4.4BSD-Lite2 release, which 4257416Smarkmshould be the final BSD release. I will continue to support of 4357416Smarkmtelnet, The code (without encryption) is available via anonymous ftp 4457416Smarkmfrom ftp.cray.com, in src/telnet/telnet.YY.MM.DD.NE.tar.Z, where 4557416SmarkmYY.MM.DD is replaced with the year, month and day of the release. 4657416SmarkmIf you can't find it at one of these places, at some point in the 4757416Smarkmnear future information about the latest releases should be available 4857416Smarkmfrom ftp.borman.com. 4957416Smarkm 5057416SmarkmIn addition, the version with the encryption code is available via 5157416Smarkmftp from net-dist.mit.edu, in the directory /pub/telnet. There 5257416Smarkmis a README file there that gives further information on how 5357416Smarkmto get the distribution. 5457416Smarkm 5557416SmarkmQuestions, comments, bug reports and bug fixes can be sent to 5657416Smarkmone of these addresses: 5757416Smarkm dab@borman.com 5857416Smarkm dab@cray.com 5957416Smarkm dab@bsdi.com 6057416Smarkm 6157416SmarkmThis release is mainly bug fixes and code cleanup. 6257416Smarkm 6357416Smarkm Replace all calls to bcopy()/bzero() with calls to 6457416Smarkm memmove()/memset() and all calls to index()/rindex() 6557416Smarkm with calls to strchr()/strrchr(). 6657416Smarkm 6757416Smarkm Add some missing diagnostics for option tracing 6857416Smarkm to telnetd. 6957416Smarkm 7057416Smarkm Add support for BSDI 2.0 and Solaris 2.4. 7157416Smarkm 7257416Smarkm Add support for UNICOS 8.0 7357416Smarkm 7457416Smarkm Get rid of expanded tabs and trailing white spaces. 7557416Smarkm 7657416Smarkm From Paul Vixie: 7757416Smarkm Fix for telnet going into an endless spin 7857416Smarkm when the session dies abnormally. 7957416Smarkm 8057416Smarkm From Jef Poskanzer: 8157416Smarkm Changes to allow telnet to compile 8257416Smarkm under SunOS 3.5. 8357416Smarkm 8457416Smarkm From Philip Guenther: 8557416Smarkm makeutx() doesn't expand utmpx, 8657416Smarkm use pututxline() instead. 8757416Smarkm 8857416Smarkm From Chris Torek: 8957416Smarkm Add a sleep(1) before execing login 9057416Smarkm to avoid race condition that can eat 9157416Smarkm up the login prompt. 9257416Smarkm Use terminal speed directly if it is 9357416Smarkm not an encoded value. 9457416Smarkm 9557416Smarkm From Steve Parker: 9657416Smarkm Fix to realloc() call. Fix for execing 9757416Smarkm login on solaris with no user name. 9857416Smarkm 9957416SmarkmJanuary 19, 1994 10057416Smarkm 10157416SmarkmThis is a list of some of the changes since the last tar release 10257416Smarkmof telnet/telnetd. There are probably other changes that aren't 10357416Smarkmlisted here, but this should hit a lot of the main ones. 10457416Smarkm 10557416Smarkm General: 10657416Smarkm Changed #define for AUTHENTICATE to AUTHENTICATION 10757416Smarkm Changed #define for ENCRYPT to ENCRYPTION 10857416Smarkm Changed #define for DES_ENCRYPT to DES_ENCRYPTION 10957416Smarkm 11057416Smarkm Added support for SPX authentication: -DSPX 11157416Smarkm 11257416Smarkm Added support for Kerberos Version 5 authentication: -DKRB5 11357416Smarkm 11457416Smarkm Added support for ANSI C function prototypes 11557416Smarkm 11657416Smarkm Added support for the NEW-ENVIRON option (RFC-1572) 11757416Smarkm including support for USERVAR. 11857416Smarkm 11957416Smarkm Made support for the old Environment Option (RFC-1408) 12057416Smarkm conditional on -DOLD_ENVIRON 12157416Smarkm 12257416Smarkm Added #define ENV_HACK - support for RFC 1571 12357416Smarkm 12457416Smarkm The encryption code is removed from the public distributions. 12557416Smarkm Domestic 4.4 BSD distributions contain the encryption code. 12657416Smarkm 12757416Smarkm ENV_HACK: Code to deal with systems that only implement 12857416Smarkm the old ENVIRON option, and have reversed definitions 12957416Smarkm of ENV_VAR and ENV_VAL. Also fixes ENV processing in 13057416Smarkm client to handle things besides just the default set... 13157416Smarkm 13257416Smarkm NO_BSD_SETJMP: UNICOS configuration for 13357416Smarkm UNICOS 6.1/6.0/5.1/5.0 systems. 13457416Smarkm 13557416Smarkm STREAMSPTY: Use /dev/ptmx to get a clean pty. This 13657416Smarkm is for SVr4 derivatives (Like Solaris) 13757416Smarkm 13857416Smarkm UTMPX: For systems that have /etc/utmpx. This is for 13957416Smarkm SVr4 derivatives (Like Solaris) 14057416Smarkm 14157416Smarkm Definitions for BSDI 1.0 14257416Smarkm 14357416Smarkm Definitions for 4.3 Reno and 4.4 BSD. 14457416Smarkm 14557416Smarkm Definitions for UNICOS 8.0 and UNICOS 7.C 14657416Smarkm 14757416Smarkm Definitions for Solaris 2.0 14857416Smarkm 14957416Smarkm Definitions for HP-UX 8.0 15057416Smarkm 15157416Smarkm Latest Copyright notices from Berkeley. 15257416Smarkm 15357416Smarkm FLOW-CONTROL: support for RFC-XXXx 15457416Smarkm 15557416Smarkm 15657416Smarkm Client Specific: 15757416Smarkm 15857416Smarkm Fix the "send" command to not send garbage... 15957416Smarkm 16057416Smarkm Fix status message for "skiprc" 16157416Smarkm 16257416Smarkm Make sure to send NAWS after telnet has been suspended 16357416Smarkm or an external command has been run, if the window size 16457416Smarkm has changed. 16557416Smarkm 16657416Smarkm sysV88 support. 16757416Smarkm 16857416Smarkm Server Specific: 16957416Smarkm 17057416Smarkm Support flowcontrol option in non-linemode servers. 17157416Smarkm 17257416Smarkm -k Server supports Kludge Linemode, but will default to 17357416Smarkm either single character mode or real Linemode support. 17457416Smarkm The user will have to explicitly ask to switch into 17557416Smarkm kludge linemode. ("stty extproc", or escape back to 17657416Smarkm to telnet and say "mode line".) 17757416Smarkm 17857416Smarkm -u Specify the length of the hostname field in the utmp 17957416Smarkm file. Hostname longer than this length will be put 18057416Smarkm into the utmp file in dotted decimal notation, rather 18157416Smarkm than putting in a truncated hostname. 18257416Smarkm 18357416Smarkm -U Registered hosts only. If a reverse hostname lookup 18457416Smarkm fails, the connection will be refused. 18557416Smarkm 18657416Smarkm -f/-F 18757416Smarkm Allows forwarding of credentials for KRB5. 18857416Smarkm 18957416SmarkmFebrurary 22, 1991: 19057416Smarkm 19157416Smarkm Features: 19257416Smarkm 19357416Smarkm This version of telnet/telnetd has support for both 19457416Smarkm the AUTHENTICATION and ENCRYPTION options. The 19557416Smarkm AUTHENTICATION option is fairly well defined, and 19657416Smarkm an option number has been assigned to it. The 19757416Smarkm ENCRYPTION option is still in a state of flux; an 19857416Smarkm option number has been assigned to, but it is still 19957416Smarkm subject to change. The code is provided in this release 20057416Smarkm for experimental and testing purposes. 20157416Smarkm 20257416Smarkm The telnet "send" command can now be used to send 20357416Smarkm do/dont/will/wont commands, with any telnet option 20457416Smarkm name. The rules for when do/dont/will/wont are sent 20557416Smarkm are still followed, so just because the user requests 20657416Smarkm that one of these be sent doesn't mean that it will 20757416Smarkm be sent... 20857416Smarkm 20957416Smarkm The telnet "getstatus" command no longer requires 21057416Smarkm that option printing be enabled to see the response 21157416Smarkm to the "DO STATUS" command. 21257416Smarkm 21357416Smarkm A -n flag has been added to telnetd to disable 21457416Smarkm keepalives. 21557416Smarkm 21657416Smarkm A new telnet command, "auth" has been added (if 21757416Smarkm AUTHENTICATE is defined). It has four sub-commands, 21857416Smarkm "status", "disable", "enable" and "help". 21957416Smarkm 22057416Smarkm A new telnet command, "encrypt" has been added (if 22157416Smarkm ENCRYPT is defined). It has many sub-commands: 22257416Smarkm "enable", "type", "start", "stop", "input", 22357416Smarkm "-input", "output", "-output", "status", and "help". 22457416Smarkm 22557416Smarkm The LOGOUT option is now supported by both telnet 22657416Smarkm and telnetd, a new command, "logout", was added 22757416Smarkm to support this. 22857416Smarkm 22957416Smarkm Several new toggle options were added: 23057416Smarkm "autoencrypt", "autodecrypt", "autologin", "authdebug", 23157416Smarkm "encdebug", "skiprc", "verbose_encrypt" 23257416Smarkm 23357416Smarkm An "rlogin" interface has been added. If the program 23457416Smarkm is named "rlogin", or the "-r" flag is given, then 23557416Smarkm an rlogin type of interface will be used. 23657416Smarkm ~. Terminates the session 23757416Smarkm ~<susp> Suspend the session 23857416Smarkm ~^] Escape to telnet command mode 23957416Smarkm ~~ Pass through the ~. 24057416Smarkm BUG: If you type the rlogin escape character 24157416Smarkm in the middle of a line while in rlogin 24257416Smarkm mode, you cannot erase it or any characters 24357416Smarkm before it. Hopefully this can be fixed 24457416Smarkm in a future release... 24557416Smarkm 24657416Smarkm General changes: 24757416Smarkm 24857416Smarkm A "libtelnet.a" has now been created. This libraray 24957416Smarkm contains code that is common to both telnet and 25057416Smarkm telnetd. This is also where library routines that 25157416Smarkm are needed, but are not in the standard C library, 25257416Smarkm are placed. 25357416Smarkm 25457416Smarkm The makefiles have been re-done. All of the site 25557416Smarkm specific configuration information has now been put 25657416Smarkm into a single "Config.generic" file, in the top level 25757416Smarkm directory. Changing this one file will take care of 25857416Smarkm all three subdirectories. Also, to add a new/local 25957416Smarkm definition, a "Config.local" file may be created 26057416Smarkm at the top level; if that file exists, the subdirectories 26157416Smarkm will use that file instead of "Config.generic". 26257416Smarkm 26357416Smarkm Many 1-2 line functions in commands.c have been 26457416Smarkm removed, and just inserted in-line, or replaced 26557416Smarkm with a macro. 26657416Smarkm 26757416Smarkm Bug Fixes: 26857416Smarkm 26957416Smarkm The non-termio code in both telnet and telnetd was 27057416Smarkm setting/clearing CTLECH in the sg_flags word. This 27157416Smarkm was incorrect, and has been changed to set/clear the 27257416Smarkm LCTLECH bit in the local mode word. 27357416Smarkm 27457416Smarkm The SRCRT #define has been removed. If IP_OPTIONS 27557416Smarkm and IPPROTO_IP are defined on the system, then the 27657416Smarkm source route code is automatically enabled. 27757416Smarkm 27857416Smarkm The NO_GETTYTAB #define has been removed; there 27957416Smarkm is a compatability routine that can be built into 28057416Smarkm libtelnet to achive the same results. 28157416Smarkm 28257416Smarkm The server, telnetd, has been switched to use getopt() 28357416Smarkm for parsing the argument list. 28457416Smarkm 28557416Smarkm The code for getting the input/output speeds via 28657416Smarkm cfgetispeed()/cfgetospeed() was still not quite 28757416Smarkm right in telnet. Posix says if the ispeed is 0, 28857416Smarkm then it is really equal to the ospeed. 28957416Smarkm 29057416Smarkm The suboption processing code in telnet now has 29157416Smarkm explicit checks to make sure that we received 29257416Smarkm the entire suboption (telnetd was already doing this). 29357416Smarkm 29457416Smarkm The telnet code for processing the terminal type 29557416Smarkm could cause a core dump if an existing connection 29657416Smarkm was closed, and a new connection opened without 29757416Smarkm exiting telnet. 29857416Smarkm 29957416Smarkm Telnetd was doing a TCSADRAIN when setting the new 30057416Smarkm terminal settings; This is not good, because it means 30157416Smarkm that the tcsetattr() will hang waiting for output to 30257416Smarkm drain, and telnetd is the only one that will drain 30357416Smarkm the output... The fix is to use TCSANOW which does 30457416Smarkm not wait. 30557416Smarkm 30657416Smarkm Telnetd was improperly setting/clearing the ISTRIP 30757416Smarkm flag in the c_lflag field, it should be using the 30857416Smarkm c_iflag field. 30957416Smarkm 31057416Smarkm When the child process of telnetd was opening the 31157416Smarkm slave side of the pty, it was re-setting the EXTPROC 31257416Smarkm bit too early, and some of the other initialization 31357416Smarkm code was wiping it out. This would cause telnetd 31457416Smarkm to go out of linemode and into single character mode. 31557416Smarkm 31657416Smarkm One instance of leaving linemode in telnetd forgot 31757416Smarkm to send a WILL ECHO to the client, the net result 31857416Smarkm would be that the user would see double character 31957416Smarkm echo. 32057416Smarkm 32157416Smarkm If the MODE was being changed several times very 32257416Smarkm quickly, telnetd could get out of sync with the 32357416Smarkm state changes and the returning acks; and wind up 32457416Smarkm being left in the wrong state. 32557416Smarkm 32657416SmarkmSeptember 14, 1990: 32757416Smarkm 32857416Smarkm Switch the client to use getopt() for parsing the 32957416Smarkm argument list. The 4.3Reno getopt.c is included for 33057416Smarkm systems that don't have getopt(). 33157416Smarkm 33257416Smarkm Use the posix _POSIX_VDISABLE value for what value 33357416Smarkm to use when disabling special characters. If this 33457416Smarkm is undefined, it defaults to 0x3ff. 33557416Smarkm 33657416Smarkm For non-termio systems, TIOCSETP was being used to 33757416Smarkm change the state of the terminal. This causes the 33857416Smarkm input queue to be flushed, which we don't want. This 33957416Smarkm is now changed to TIOCSETN. 34057416Smarkm 34157416Smarkm Take out the "#ifdef notdef" around the code in the 34257416Smarkm server that generates a "sync" when the pty oputput 34357416Smarkm is flushed. The potential problem is that some older 34457416Smarkm telnet clients may go into an infinate loop when they 34557416Smarkm receive a "sync", if so, the server can be compiled 34657416Smarkm with "NO_URGENT" defined. 34757416Smarkm 34857416Smarkm Fix the client where it was setting/clearing the OPOST 34957416Smarkm bit in the c_lflag field, not the c_oflag field. 35057416Smarkm 35157416Smarkm Fix the client where it was setting/clearing the ISTRIP 35257416Smarkm bit in the c_lflag field, not the c_iflag field. (On 35357416Smarkm 4.3Reno, this is the ECHOPRT bit in the c_lflag field.) 35457416Smarkm The client also had its interpretation of WILL BINARY 35557416Smarkm and DO BINARY reversed. 35657416Smarkm 35757416Smarkm Fix a bug in client that would cause a core dump when 35857416Smarkm attempting to remove the last environment variable. 35957416Smarkm 36057416Smarkm In the client, there were a few places were switch() 36157416Smarkm was being passed a character, and if it was a negative 36257416Smarkm value, it could get sign extended, and not match 36357416Smarkm the 8 bit case statements. The fix is to and the 36457416Smarkm switch value with 0xff. 36557416Smarkm 36657416Smarkm Add a couple more printoption() calls in the client, I 36757416Smarkm don't think there are any more places were a telnet 36857416Smarkm command can be received and not printed out when 36957416Smarkm "options" is on. 37057416Smarkm 37157416Smarkm A new flag has been added to the client, "-a". Currently, 37257416Smarkm this just causes the USER name to be sent across, in 37357416Smarkm the future this may be used to signify that automatic 37457416Smarkm authentication is requested. 37557416Smarkm 37657416Smarkm The USER variable is now only sent by the client if 37757416Smarkm the "-a" or "-l user" options are explicity used, or 37857416Smarkm if the user explicitly asks for the "USER" environment 37957416Smarkm variable to be exported. In the server, if it receives 38057416Smarkm the "USER" environment variable, it won't print out the 38157416Smarkm banner message, so that only "Password:" will be printed. 38257416Smarkm This makes the symantics more like rlogin, and should be 38357416Smarkm more familiar to the user. (People are not used to 38457416Smarkm getting a banner message, and then getting just a 38557416Smarkm "Password:" prompt.) 38657416Smarkm 38757416Smarkm Re-vamp the code for starting up the child login 38857416Smarkm process. The code was getting ugly, and it was 38957416Smarkm hard to tell what was really going on. What we 39057416Smarkm do now is after the fork(), in the child: 39157416Smarkm 1) make sure we have no controlling tty 39257416Smarkm 2) open and initialize the tty 39357416Smarkm 3) do a setsid()/setpgrp() 39457416Smarkm 4) makes the tty our controlling tty. 39557416Smarkm On some systems, #2 makes the tty our controlling 39657416Smarkm tty, and #4 is a no-op. The parent process does 39757416Smarkm a gets rid of any controlling tty after the child 39857416Smarkm is fork()ed. 39957416Smarkm 40057416Smarkm Use the strdup() library routine in telnet, instead 40157416Smarkm of the local savestr() routine. If you don't have 40257416Smarkm strdup(), you need to define NO_STRDUP. 40357416Smarkm 40457416Smarkm Add support for ^T (SIGINFO/VSTATUS), found in the 40557416Smarkm 4.3Reno distribution. This maps to the AYT character. 40657416Smarkm You need a 4-line bugfix in the kernel to get this 40757416Smarkm to work properly: 40857416Smarkm 40957416Smarkm > *** tty_pty.c.ORG Tue Sep 11 09:41:53 1990 41057416Smarkm > --- tty_pty.c Tue Sep 11 17:48:03 1990 41157416Smarkm > *************** 41257416Smarkm > *** 609,613 **** 41357416Smarkm > if ((tp->t_lflag&NOFLSH) == 0) 41457416Smarkm > ttyflush(tp, FREAD|FWRITE); 41557416Smarkm > ! pgsignal(tp->t_pgrp, *(unsigned int *)data); 41657416Smarkm > return(0); 41757416Smarkm > } 41857416Smarkm > --- 609,616 ---- 41957416Smarkm > if ((tp->t_lflag&NOFLSH) == 0) 42057416Smarkm > ttyflush(tp, FREAD|FWRITE); 42157416Smarkm > ! pgsignal(tp->t_pgrp, *(unsigned int *)data, 1); 42257416Smarkm > ! if ((*(unsigned int *)data == SIGINFO) && 42357416Smarkm > ! ((tp->t_lflag&NOKERNINFO) == 0)) 42457416Smarkm > ! ttyinfo(tp); 42557416Smarkm > return(0); 42657416Smarkm > } 42757416Smarkm 42857416Smarkm The client is now smarter when setting the telnet escape 42957416Smarkm character; it only sets it to one of VEOL and VEOL2 if 43057416Smarkm one of them is undefined, and the other one is not already 43157416Smarkm defined to the telnet escape character. 43257416Smarkm 43357416Smarkm Handle TERMIOS systems that have seperate input and output 43457416Smarkm line speed settings imbedded in the flags. 43557416Smarkm 43657416Smarkm Many other minor bug fixes. 43757416Smarkm 43857416SmarkmJune 20, 1990: 43957416Smarkm Re-organize makefiles and source tree. The telnet/Source 44057416Smarkm directory is now gone, and all the source that was in 44157416Smarkm telnet/Source is now just in the telnet directory. 44257416Smarkm 44357416Smarkm Seperate makefile for each system are now gone. There 44457416Smarkm are two makefiles, Makefile and Makefile.generic. 44557416Smarkm The "Makefile" has the definitions for the various 44657416Smarkm system, and "Makefile.generic" does all the work. 44757416Smarkm There is a variable called "WHAT" that is used to 44857416Smarkm specify what to make. For example, in the telnet 44957416Smarkm directory, you might say: 45057416Smarkm make 4.4bsd WHAT=clean 45157416Smarkm to clean out the directory. 45257416Smarkm 45357416Smarkm Add support for the ENVIRON and XDISPLOC options. 45457416Smarkm In order for the server to work, login has to have 45557416Smarkm the "-p" option to preserve environment variables. 45657416Smarkm 45757416Smarkm Add the SOFT_TAB and LIT_ECHO modes in the LINEMODE support. 45857416Smarkm 45957416Smarkm Add the "-l user" option to command line and open command 46057416Smarkm (This is passed through the ENVIRON option). 46157416Smarkm 46257416Smarkm Add the "-e" command line option, for setting the escape 46357416Smarkm character. 46457416Smarkm 46557416Smarkm Add the "-D", diagnostic, option to the server. This allows 46657416Smarkm the server to print out debug information, which is very 46757416Smarkm useful when trying to debug a telnet that doesn't have any 46857416Smarkm debugging ability. 46957416Smarkm 47057416Smarkm Turn off the literal next character when not in LINEMODE. 47157416Smarkm 47257416Smarkm Don't recognize ^Y locally, just pass it through. 47357416Smarkm 47457416Smarkm Make minor modifications for Sun4.0 and Sun4.1 47557416Smarkm 47657416Smarkm Add support for both FORW1 and FORW2 characters. The 47757416Smarkm telnet escpape character is set to whichever of the 47857416Smarkm two is not being used. If both are in use, the escape 47957416Smarkm character is not set, so when in linemode the user will 48057416Smarkm have to follow the escape character with a <CR> or <EOF) 48157416Smarkm to get it passed through. 48257416Smarkm 48357416Smarkm Commands can now be put in single and double quotes, and 48457416Smarkm a backslash is now an escape character. This is needed 48557416Smarkm for allowing arbitrary strings to be assigned to environment 48657416Smarkm variables. 48757416Smarkm 48857416Smarkm Switch telnetd to use macros like telnet for keeping 48957416Smarkm track of the state of all the options. 49057416Smarkm 49157416Smarkm Fix telnetd's processing of options so that we always do 49257416Smarkm the right processing of the LINEMODE option, regardless 49357416Smarkm of who initiates the request to turn it on. Also, make 49457416Smarkm sure that if the other side went "WILL ECHO" in response 49557416Smarkm to our "DO ECHO", that we send a "DONT ECHO" to get the 49657416Smarkm option turned back off! 49757416Smarkm 49857416Smarkm Fix the TERMIOS setting of the terminal speed to handle both 49957416Smarkm BSD's seperate fields, and the SYSV method of CBAUD bits. 50057416Smarkm 50157416Smarkm Change how we deal with the other side refusing to enable 50257416Smarkm an option. The sequence used to be: send DO option; receive 50357416Smarkm WONT option; send DONT option. Now, the sequence is: send 50457416Smarkm DO option; receive WONT option. Both should be valid 50557416Smarkm according to the spec, but there has been at least one 50657416Smarkm client implementation of telnet identified that can get 50757416Smarkm really confused by this. (The exact sequence, from a trace 50857416Smarkm on the server side, is (numbers are number of responses that 50957416Smarkm we expect to get after that line...): 51057416Smarkm 51157416Smarkm send WILL ECHO 1 (initial request) 51257416Smarkm send WONT ECHO 2 (server is changing state) 51357416Smarkm recv DO ECHO 1 (first reply, ok. expect DONT ECHO next) 51457416Smarkm send WILL ECHO 2 (server changes state again) 51557416Smarkm recv DONT ECHO 1 (second reply, ok. expect DO ECHO next) 51657416Smarkm recv DONT ECHO 0 (third reply, wrong answer. got DONT!!!) 51757416Smarkm *** send WONT ECHO (send WONT to acknowledge the DONT) 51857416Smarkm send WILL ECHO 1 (ask again to enable option) 51957416Smarkm recv DO ECHO 0 52057416Smarkm 52157416Smarkm recv DONT ECHO 0 52257416Smarkm send WONT ECHO 1 52357416Smarkm recv DONT ECHO 0 52457416Smarkm recv DO ECHO 1 52557416Smarkm send WILL ECHO 0 52657416Smarkm (and the last 5 lines loop forever) 52757416Smarkm 52857416Smarkm The line with the "***" is last of the WILL/DONT/WONT sequence. 52957416Smarkm The change to the server to not generate that makes this same 53057416Smarkm example become: 53157416Smarkm 53257416Smarkm send will ECHO 1 53357416Smarkm send wont ECHO 2 53457416Smarkm recv do ECHO 1 53557416Smarkm send will ECHO 2 53657416Smarkm recv dont ECHO 1 53757416Smarkm recv dont ECHO 0 53857416Smarkm recv do ECHO 1 53957416Smarkm send will ECHO 0 54057416Smarkm 54157416Smarkm There is other option negotiation going on, and not sending 54257416Smarkm the third part changes some of the timings, but this specific 54357416Smarkm example no longer gets stuck in a loop. The "telnet.state" 54457416Smarkm file has been modified to reflect this change to the algorithm. 54557416Smarkm 54657416Smarkm A bunch of miscellaneous bug fixes and changes to make 54757416Smarkm lint happier. 54857416Smarkm 54957416Smarkm This version of telnet also has some KERBEROS stuff in 55057416Smarkm it. This has not been tested, it uses an un-authorized 55157416Smarkm telnet option number, and uses an out-of-date version 55257416Smarkm of the (still being defined) AUTHENTICATION option. 55357416Smarkm There is no support for this code, do not enable it. 55457416Smarkm 55557416Smarkm 55657416SmarkmMarch 1, 1990: 55757416SmarkmCHANGES/BUGFIXES SINCE LAST RELEASE: 55857416Smarkm Some support for IP TOS has been added. Requires that the 55957416Smarkm kernel support the IP_TOS socket option (currently this 56057416Smarkm is only in UNICOS 6.0). 56157416Smarkm 56257416Smarkm Both telnet and telnetd now use the cc_t typedef. typedefs are 56357416Smarkm included for systems that don't have it (in termios.h). 56457416Smarkm 56557416Smarkm SLC_SUSP was not supported properly before. It is now. 56657416Smarkm 56757416Smarkm IAC EOF was not translated properly in telnetd for SYSV_TERMIO 56857416Smarkm when not in linemode. It now saves a copy of the VEOF character, 56957416Smarkm so that when ICANON is turned off and we can't trust it anymore 57057416Smarkm (because it is now the VMIN character) we use the saved value. 57157416Smarkm 57257416Smarkm There were two missing "break" commands in the linemode 57357416Smarkm processing code in telnetd. 57457416Smarkm 57557416Smarkm Telnetd wasn't setting the kernel window size information 57657416Smarkm properly. It was using the rows for both rows and columns... 57757416Smarkm 57857416SmarkmQuestions/comments go to 57957416Smarkm David Borman 58057416Smarkm Cray Research, Inc. 58157416Smarkm 655F Lone Oak Drive 58257416Smarkm Eagan, MN 55123 58357416Smarkm dab@cray.com. 58457416Smarkm 58557416SmarkmREADME: You are reading it. 58657416Smarkm 58757416SmarkmConfig.generic: 58857416Smarkm This file contains all the OS specific definitions. It 58957416Smarkm has pre-definitions for many common system types, and is 59057416Smarkm in standard makefile fromat. See the comments at the top 59157416Smarkm of the file for more information. 59257416Smarkm 59357416SmarkmConfig.local: 59457416Smarkm This is not part of the distribution, but if this file exists, 59557416Smarkm it is used instead of "Config.generic". This allows site 59657416Smarkm specific configuration without having to modify the distributed 59757416Smarkm "Config.generic" file. 59857416Smarkm 59957416Smarkmkern.diff: 60057416Smarkm This file contains the diffs for the changes needed for the 60157416Smarkm kernel to support LINEMODE is the server. These changes are 60257416Smarkm for a 4.3BSD system. You may need to make some changes for 60357416Smarkm your particular system. 60457416Smarkm 60557416Smarkm There is a new bit in the terminal state word, TS_EXTPROC. 60657416Smarkm When this bit is set, several aspects of the terminal driver 60757416Smarkm are disabled. Input line editing, character echo, and 60857416Smarkm mapping of signals are all disabled. This allows the telnetd 60957416Smarkm to turn of these functions when in linemode, but still keep 61057416Smarkm track of what state the user wants the terminal to be in. 61157416Smarkm 61257416Smarkm New ioctl()s: 61357416Smarkm 61457416Smarkm TIOCEXT Turn on/off the TS_EXTPROC bit 61557416Smarkm TIOCGSTATE Get t_state of tty to look at TS_EXTPROC bit 61657416Smarkm TIOCSIG Generate a signal to processes in the 61757416Smarkm current process group of the pty. 61857416Smarkm 61957416Smarkm There is a new mode for packet driver, the TIOCPKT_IOCTL bit. 62057416Smarkm When packet mode is turned on in the pty, and the TS_EXTPROC 62157416Smarkm bit is set, then whenever the state of the pty is changed, the 62257416Smarkm next read on the master side of the pty will have the TIOCPKT_IOCTL 62357416Smarkm bit set, and the data will contain the following: 62457416Smarkm struct xx { 62557416Smarkm struct sgttyb a; 62657416Smarkm struct tchars b; 62757416Smarkm struct ltchars c; 62857416Smarkm int t_state; 62957416Smarkm int t_flags; 63057416Smarkm } 63157416Smarkm This allows the process on the server side of the pty to know 63257416Smarkm when the state of the terminal has changed, and what the new 63357416Smarkm state is. 63457416Smarkm 63557416Smarkm However, if you define USE_TERMIO or SYSV_TERMIO, the code will 63657416Smarkm expect that the structure returned in the TIOCPKT_IOCTL is 63757416Smarkm the termio/termios structure. 63857416Smarkm 63957416Smarkmstty.diff: 64057416Smarkm This file contains the changes needed for the stty(1) program 64157416Smarkm to report on the current status of the TS_EXTPROC bit. It also 64257416Smarkm allows the user to turn on/off the TS_EXTPROC bit. This is useful 64357416Smarkm because it allows the user to say "stty -extproc", and the 64457416Smarkm LINEMODE option will be automatically disabled, and saying "stty 64557416Smarkm extproc" will re-enable the LINEMODE option. 64657416Smarkm 64757416Smarkmtelnet.state: 64857416Smarkm Both the client and server have code in them to deal 64957416Smarkm with option negotiation loops. The algorithm that is 65057416Smarkm used is described in this file. 65157416Smarkm 65257416Smarkmtelnet: 65357416Smarkm This directory contains the client code. No kernel changes are 65457416Smarkm needed to use this code. 65557416Smarkm 65657416Smarkmtelnetd: 65757416Smarkm This directory contains the server code. If LINEMODE or KLUDGELINEMODE 65857416Smarkm are defined, then the kernel modifications listed above are needed. 65957416Smarkm 66057416Smarkmlibtelnet: 66157416Smarkm This directory contains code that is common to both the client 66257416Smarkm and the server. 66357416Smarkm 66457416Smarkmarpa: 66557416Smarkm This directory has a new <arpa/telnet.h> 66657416Smarkm 66757416Smarkmlibtelnet/Makefile.4.4: 66857416Smarkmtelnet/Makefile.4.4: 66957416Smarkmtelnetd/Makefile.4.4: 67057416Smarkm These are the makefiles that can be used on a 4.3Reno 67157416Smarkm system when this software is installed in /usr/src/lib/libtelnet, 67257416Smarkm /usr/src/libexec/telnetd, and /usr/src/usr.bin/telnet. 67357416Smarkm 67457416Smarkm 67557416SmarkmThe following TELNET options are supported: 67657416Smarkm 67757416Smarkm LINEMODE: 67857416Smarkm The LINEMODE option is supported as per RFC1116. The 67957416Smarkm FORWARDMASK option is not currently supported. 68057416Smarkm 68157416Smarkm BINARY: The client has the ability to turn on/off the BINARY 68257416Smarkm option in each direction. Turning on BINARY from 68357416Smarkm server to client causes the LITOUT bit to get set in 68457416Smarkm the terminal driver on both ends, turning on BINARY 68557416Smarkm from the client to the server causes the PASS8 bit 68657416Smarkm to get set in the terminal driver on both ends. 68757416Smarkm 68857416Smarkm TERMINAL-TYPE: 68957416Smarkm This is supported as per RFC1091. On the server side, 69057416Smarkm when a terminal type is received, termcap/terminfo 69157416Smarkm is consulted to determine if it is a known terminal 69257416Smarkm type. It keeps requesting terminal types until it 69357416Smarkm gets one that it recongnizes, or hits the end of the 69457416Smarkm list. The server side looks up the entry in the 69557416Smarkm termcap/terminfo data base, and generates a list of 69657416Smarkm names which it then passes one at a time to each 69757416Smarkm request for a terminal type, duplicating the last 69857416Smarkm entry in the list before cycling back to the beginning. 69957416Smarkm 70057416Smarkm NAWS: The Negotiate about Window Size, as per RFC 1073. 70157416Smarkm 70257416Smarkm TERMINAL-SPEED: 70357416Smarkm Implemented as per RFC 1079 70457416Smarkm 70557416Smarkm TOGGLE-FLOW-CONTROL: 70657416Smarkm Implemented as per RFC 1080 70757416Smarkm 70857416Smarkm TIMING-MARK: 70957416Smarkm As per RFC 860 71057416Smarkm 71157416Smarkm SGA: As per RFC 858 71257416Smarkm 71357416Smarkm ECHO: As per RFC 857 71457416Smarkm 71557416Smarkm LOGOUT: As per RFC 727 71657416Smarkm 71757416Smarkm STATUS: 71857416Smarkm The server will send its current status upon 71957416Smarkm request. It does not ask for the clients status. 72057416Smarkm The client will request the servers current status 72157416Smarkm from the "send getstatus" command. 72257416Smarkm 72357416Smarkm ENVIRON: 72457416Smarkm This option is currently being defined by the IETF 72557416Smarkm Telnet Working Group, and an RFC has not yet been 72657416Smarkm issued, but should be in the near future... 72757416Smarkm 72857416Smarkm X-DISPLAY-LOCATION: 72957416Smarkm This functionality can be done through the ENVIRON 73057416Smarkm option, it is added here for completeness. 73157416Smarkm 73257416Smarkm AUTHENTICATION: 73357416Smarkm This option is currently being defined by the IETF 73457416Smarkm Telnet Working Group, and an RFC has not yet been 73557416Smarkm issued. The basic framework is pretty much decided, 73657416Smarkm but the definitions for the specific authentication 73757416Smarkm schemes is still in a state of flux. 73857416Smarkm 73957416Smarkm ENCRYPTION: 74057416Smarkm This option is currently being defined by the IETF 74157416Smarkm Telnet Working Group, and an RFC has not yet been 74257416Smarkm issued. The draft RFC is still in a state of flux, 74357416Smarkm so this code may change in the future. 744