⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 linux 下 telnet源码
💻
📖 第 1 页 / 共 2 页
字号:
	the future this may be used to signify that automatic
	authentication is requested.

	The USER variable is now only sent by the client if
	the "-a" or "-l user" options are explicity used, or
	if the user explicitly asks for the "USER" environment
	variable to be exported.  In the server, if it receives
	the "USER" environment variable, it won't print out the
	banner message, so that only "Password:" will be printed.
	This makes the symantics more like rlogin, and should be
	more familiar to the user.  (People are not used to
	getting a banner message, and then getting just a
	"Password:" prompt.)

	Re-vamp the code for starting up the child login
	process.  The code was getting ugly, and it was
	hard to tell what was really going on.  What we
	do now is after the fork(), in the child:
		1) make sure we have no controlling tty
		2) open and initialize the tty
		3) do a setsid()/setpgrp()
		4) makes the tty our controlling tty.
	On some systems, #2 makes the tty our controlling
	tty, and #4 is a no-op.  The parent process does
	a gets rid of any controlling tty after the child
	is fork()ed.

	Use the strdup() library routine in telnet, instead
	of the local savestr() routine.  If you don't have
	strdup(), you need to define NO_STRDUP.

	Add support for ^T (SIGINFO/VSTATUS), found in the
	4.3Reno distribution.  This maps to the AYT character.
	You need a 4-line bugfix in the kernel to get this
	to work properly:

	> *** tty_pty.c.ORG	Tue Sep 11 09:41:53 1990
	> --- tty_pty.c	Tue Sep 11 17:48:03 1990
	> ***************
	> *** 609,613 ****
	> 			if ((tp->t_lflag&NOFLSH) == 0)
	> 				ttyflush(tp, FREAD|FWRITE);
	> ! 			pgsignal(tp->t_pgrp, *(unsigned int *)data);
	> 			return(0);
	> 		}
	> --- 609,616 ----
	> 			if ((tp->t_lflag&NOFLSH) == 0)
	> 				ttyflush(tp, FREAD|FWRITE);
	> ! 			pgsignal(tp->t_pgrp, *(unsigned int *)data, 1);
	> ! 			if ((*(unsigned int *)data == SIGINFO) &&
	> ! 			    ((tp->t_lflag&NOKERNINFO) == 0))
	> ! 				ttyinfo(tp);
	> 			return(0);
	> 		}

	The client is now smarter when setting the telnet escape
	character; it only sets it to one of VEOL and VEOL2 if
	one of them is undefined, and the other one is not already
	defined to the telnet escape character.

	Handle TERMIOS systems that have seperate input and output
	line speed settings imbedded in the flags.

	Many other minor bug fixes.

June 20, 1990:
	Re-organize makefiles and source tree.  The telnet/Source
	directory is now gone, and all the source that was in
	telnet/Source is now just in the telnet directory.

	Seperate makefile for each system are now gone.  There
	are two makefiles, Makefile and Makefile.generic.
	The "Makefile" has the definitions for the various
	system, and "Makefile.generic" does all the work.
	There is a variable called "WHAT" that is used to
	specify what to make.  For example, in the telnet
	directory, you might say:
		make 4.4bsd WHAT=clean
	to clean out the directory.

	Add support for the ENVIRON and XDISPLOC options.
	In order for the server to work, login has to have
	the "-p" option to preserve environment variables.

	Add the SOFT_TAB and LIT_ECHO modes in the LINEMODE support.

	Add the "-l user" option to command line and open command
	(This is passed through the ENVIRON option).

	Add the "-e" command line option, for setting the escape
	character.

	Add the "-D", diagnostic, option to the server.  This allows
	the server to print out debug information, which is very
	useful when trying to debug a telnet that doesn't have any
	debugging ability.

	Turn off the literal next character when not in LINEMODE.

	Don't recognize ^Y locally, just pass it through.

	Make minor modifications for Sun4.0 and Sun4.1

	Add support for both FORW1 and FORW2 characters.  The
	telnet escpape character is set to whichever of the
	two is not being used.  If both are in use, the escape
	character is not set, so when in linemode the user will
	have to follow the escape character with a <CR> or <EOF)
	to get it passed through.

	Commands can now be put in single and double quotes, and
	a backslash is now an escape character.  This is needed
	for allowing arbitrary strings to be assigned to environment
	variables.

	Switch telnetd to use macros like telnet for keeping
	track of the state of all the options.

	Fix telnetd's processing of options so that we always do
	the right processing of the LINEMODE option, regardless
	of who initiates the request to turn it on.  Also, make
	sure that if the other side went "WILL ECHO" in response
	to our "DO ECHO", that we send a "DONT ECHO" to get the
	option turned back off!

	Fix the TERMIOS setting of the terminal speed to handle both
	BSD's seperate fields, and the SYSV method of CBAUD bits.

	Change how we deal with the other side refusing to enable
	an option.  The sequence used to be: send DO option; receive
	WONT option; send DONT option.  Now, the sequence is: send
	DO option; receive WONT option.  Both should be valid
	according to the spec, but there has been at least one
	client implementation of telnet identified that can get
	really confused by this.  (The exact sequence, from a trace
	on the server side, is (numbers are number of responses that
	we expect to get after that line...):

		send WILL ECHO	1 (initial request)
		send WONT ECHO	2 (server is changing state)
		recv DO ECHO	1 (first reply, ok.  expect DONT ECHO next)
		send WILL ECHO	2 (server changes state again)
		recv DONT ECHO	1 (second reply, ok.  expect DO ECHO next)
		recv DONT ECHO	0 (third reply, wrong answer. got DONT!!!)
	***	send WONT ECHO	  (send WONT to acknowledge the DONT)
		send WILL ECHO	1 (ask again to enable option)
		recv DO ECHO	0

		recv DONT ECHO	0
		send WONT ECHO	1
		recv DONT ECHO	0
		recv DO ECHO	1
		send WILL ECHO	0
		(and the last 5 lines loop forever)

	The line with the "***" is last of the WILL/DONT/WONT sequence.
	The change to the server to not generate that makes this same
	example become:

		send will ECHO	1
		send wont ECHO	2
		recv do ECHO	1
		send will ECHO	2
		recv dont ECHO	1
		recv dont ECHO	0
		recv do ECHO	1
		send will ECHO	0

	There is other option negotiation going on, and not sending
	the third part changes some of the timings, but this specific
	example no longer gets stuck in a loop.  The "telnet.state"
	file has been modified to reflect this change to the algorithm.

	A bunch of miscellaneous bug fixes and changes to make
	lint happier.

	This version of telnet also has some KERBEROS stuff in
	it. This has not been tested, it uses an un-authorized
	telnet option number, and uses an out-of-date version
	of the (still being defined) AUTHENTICATION option.
	There is no support for this code, do not enable it.


March 1, 1990:
CHANGES/BUGFIXES SINCE LAST RELEASE:
	Some support for IP TOS has been added.  Requires that the
	kernel support the IP_TOS socket option (currently this
	is only in UNICOS 6.0).

	Both telnet and telnetd now use the cc_t typedef.  typedefs are
	included for systems that don't have it (in termios.h).

	SLC_SUSP was not supported properly before.  It is now.

	IAC EOF was not translated  properly in telnetd for SYSV_TERMIO
	when not in linemode.  It now saves a copy of the VEOF character,
	so that when ICANON is turned off and we can't trust it anymore
	(because it is now the VMIN character) we use the saved value.

	There were two missing "break" commands in the linemode
	processing code in telnetd.

	Telnetd wasn't setting the kernel window size information
	properly.  It was using the rows for both rows and columns...

Questions/comments go to
		David Borman
		Cray Research, Inc.
		655F Lone Oak Drive
		Eagan, MN 55123
		dab@cray.com.

README:	You are reading it.

Config.generic:
	This file contains all the OS specific definitions.  It
	has pre-definitions for many common system types, and is
	in standard makefile fromat.  See the comments at the top
	of the file for more information.

Config.local:
	This is not part of the distribution, but if this file exists,
	it is used instead of "Config.generic".  This allows site
	specific configuration without having to modify the distributed
	"Config.generic" file.

kern.diff:
	This file contains the diffs for the changes needed for the
	kernel to support LINEMODE is the server.  These changes are
	for a 4.3BSD system.  You may need to make some changes for
	your particular system.

	There is a new bit in the terminal state word, TS_EXTPROC.
	When this bit is set, several aspects of the terminal driver
	are disabled.  Input line editing, character echo, and
	mapping of signals are all disabled.  This allows the telnetd
	to turn of these functions when in linemode, but still keep
	track of what state the user wants the terminal to be in.

	New ioctl()s:

		TIOCEXT		Turn on/off the TS_EXTPROC bit
		TIOCGSTATE	Get t_state of tty to look at TS_EXTPROC bit
		TIOCSIG		Generate a signal to processes in the
				current process group of the pty.

	There is a new mode for packet driver, the TIOCPKT_IOCTL bit.
	When packet mode is turned on in the pty, and the TS_EXTPROC
	bit is set, then whenever the state of the pty is changed, the
	next read on the master side of the pty will have the TIOCPKT_IOCTL
	bit set, and the data will contain the following:
		struct xx {
			struct sgttyb a;
			struct tchars b;
			struct ltchars c;
			int t_state;
			int t_flags;
		}
	This allows the process on the server side of the pty to know
	when the state of the terminal has changed, and what the new
	state is.

	However, if you define USE_TERMIO or SYSV_TERMIO, the code will
	expect that the structure returned in the TIOCPKT_IOCTL is
	the termio/termios structure.

stty.diff:
	This file contains the changes needed for the stty(1) program
	to report on the current status of the TS_EXTPROC bit.  It also
	allows the user to turn on/off the TS_EXTPROC bit.  This is useful
	because it allows the user to say "stty -extproc", and the
	LINEMODE option will be automatically disabled, and saying "stty
	extproc" will re-enable the LINEMODE option.

telnet.state:
	Both the client and server have code in them to deal
	with option negotiation loops.  The algorithm that is
	used is described in this file.

telnet:
	This directory contains the client code.  No kernel changes are
	needed to use this code.

telnetd:
	This directory contains the server code.  If LINEMODE or KLUDGELINEMODE
	are defined, then the kernel modifications listed above are needed.

libtelnet:
	This directory contains code that is common to both the client
	and the server.

arpa:
	This directory has a new <arpa/telnet.h>

libtelnet/Makefile.4.4:
telnet/Makefile.4.4:
telnetd/Makefile.4.4:
	These are the makefiles that can be used on a 4.3Reno
	system when this software is installed in /usr/src/lib/libtelnet,
	/usr/src/libexec/telnetd, and /usr/src/usr.bin/telnet.


The following TELNET options are supported:
	
	LINEMODE:
		The LINEMODE option is supported as per RFC1116.  The
		FORWARDMASK option is not currently supported.

	BINARY: The client has the ability to turn on/off the BINARY
		option in each direction.  Turning on BINARY from
		server to client causes the LITOUT bit to get set in
		the terminal driver on both ends,  turning on BINARY
		from the client to the server causes the PASS8 bit
		to get set in the terminal driver on both ends.

	TERMINAL-TYPE:
		This is supported as per RFC1091.  On the server side,
		when a terminal type is received, termcap/terminfo
		is consulted to determine if it is a known terminal
		type.  It keeps requesting terminal types until it
		gets one that it recongnizes, or hits the end of the
		list.  The server side looks up the entry in the
		termcap/terminfo data base, and generates a list of
		names which it then passes one at a time to each
		request for a terminal type, duplicating the last
		entry in the list before cycling back to the beginning.

	NAWS:	The Negotiate about Window Size, as per RFC 1073.

	TERMINAL-SPEED:
		Implemented as per RFC 1079

	TOGGLE-FLOW-CONTROL:
		Implemented as per RFC 1080

	TIMING-MARK:
		As per RFC 860

	SGA:	As per RFC 858

	ECHO:	As per RFC 857

	LOGOUT: As per RFC 727

	STATUS:
		The server will send its current status upon
		request.  It does not ask for the clients status.
		The client will request the servers current status
		from the "send getstatus" command.

	ENVIRON:
		This option is currently being defined by the IETF
		Telnet Working Group, and an RFC has not yet been
		issued, but should be in the near future...

	X-DISPLAY-LOCATION:
		This functionality can be done through the ENVIRON
		option, it is added here for completeness.

	AUTHENTICATION:
		This option is currently being defined by the IETF
		Telnet Working Group, and an RFC has not yet been
		issued.  The basic framework is pretty much decided,
		but the definitions for the specific authentication
		schemes is still in a state of flux.

	ENCRYPTION:
		This option is currently being defined by the IETF
		Telnet Working Group, and an RFC has not yet been
		issued.  The draft RFC is still in a state of flux,
		so this code may change in the future.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -