diff options
Diffstat (limited to 'crypto/heimdal/appl/telnet/telnetd')
-rw-r--r-- | crypto/heimdal/appl/telnet/telnetd/Makefile.am | 3 | ||||
-rw-r--r-- | crypto/heimdal/appl/telnet/telnetd/Makefile.in | 33 | ||||
-rw-r--r-- | crypto/heimdal/appl/telnet/telnetd/ext.h | 9 | ||||
-rw-r--r-- | crypto/heimdal/appl/telnet/telnetd/sys_term.c | 23 | ||||
-rw-r--r-- | crypto/heimdal/appl/telnet/telnetd/telnetd.c | 65 | ||||
-rw-r--r-- | crypto/heimdal/appl/telnet/telnetd/telnetd.cat8 | 297 | ||||
-rw-r--r-- | crypto/heimdal/appl/telnet/telnetd/telnetd.h | 1 | ||||
-rw-r--r-- | crypto/heimdal/appl/telnet/telnetd/utility.c | 12 |
8 files changed, 383 insertions, 60 deletions
diff --git a/crypto/heimdal/appl/telnet/telnetd/Makefile.am b/crypto/heimdal/appl/telnet/telnetd/Makefile.am index d8497c3..c375a05 100644 --- a/crypto/heimdal/appl/telnet/telnetd/Makefile.am +++ b/crypto/heimdal/appl/telnet/telnetd/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.14 2000/11/15 22:51:11 assar Exp $ +# $Id: Makefile.am,v 1.15 2001/02/07 06:12:02 assar Exp $ include $(top_srcdir)/Makefile.am.common @@ -20,4 +20,5 @@ LDADD = \ $(LIB_des) \ $(LIB_tgetent) \ $(LIB_logwtmp) \ + $(LIB_kdfs) \ $(LIB_roken) diff --git a/crypto/heimdal/appl/telnet/telnetd/Makefile.in b/crypto/heimdal/appl/telnet/telnetd/Makefile.in index 07ac35b..c62a8ba 100644 --- a/crypto/heimdal/appl/telnet/telnetd/Makefile.in +++ b/crypto/heimdal/appl/telnet/telnetd/Makefile.in @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.4a from Makefile.am +# Makefile.in generated automatically by automake 1.4b from Makefile.am -# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -113,13 +114,13 @@ dpagaix_CFLAGS = @dpagaix_CFLAGS@ dpagaix_LDADD = @dpagaix_LDADD@ install_sh = @install_sh@ -# $Id: Makefile.am,v 1.14 2000/11/15 22:51:11 assar Exp $ +# $Id: Makefile.am,v 1.15 2001/02/07 06:12:02 assar Exp $ # $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $ -# $Id: Makefile.am.common,v 1.23 2000/12/05 09:11:09 joda Exp $ +# $Id: Makefile.am.common,v 1.26 2001/05/21 13:27:48 joda Exp $ AUTOMAKE_OPTIONS = foreign no-dependencies @@ -185,6 +186,8 @@ NROFF_MAN = groff -mandoc -Tascii @KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la @KRB5_TRUE@LIB_gssapi = @KRB5_TRUE@$(top_builddir)/lib/gssapi/libgssapi.la +@DCE_TRUE@LIB_kdfs = @DCE_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la + CHECK_LOCAL = libexec_PROGRAMS = telnetd @@ -202,6 +205,7 @@ LDADD = \ $(LIB_des) \ $(LIB_tgetent) \ $(LIB_logwtmp) \ + $(LIB_kdfs) \ $(LIB_roken) subdir = appl/telnet/telnetd @@ -224,10 +228,16 @@ termstat.$(OBJEXT) slc.$(OBJEXT) sys_term.$(OBJEXT) utility.$(OBJEXT) \ global.$(OBJEXT) authenc.$(OBJEXT) telnetd_OBJECTS = $(am_telnetd_OBJECTS) telnetd_LDADD = $(LDADD) -@KRB5_FALSE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a -@KRB5_TRUE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a \ -@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \ -@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la +@DCE_FALSE@@KRB5_FALSE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a +@DCE_FALSE@@KRB5_TRUE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a \ +@DCE_FALSE@@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \ +@DCE_FALSE@@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la +@DCE_TRUE@@KRB5_FALSE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a \ +@DCE_TRUE@@KRB5_FALSE@$(top_builddir)/lib/kdfs/libkdfs.la +@DCE_TRUE@@KRB5_TRUE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a \ +@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \ +@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la \ +@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la telnetd_LDFLAGS = COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -249,7 +259,7 @@ OBJECTS = $(am_telnetd_OBJECTS) all: all-redirect .SUFFIXES: -.SUFFIXES: .1 .3 .5 .8 .c .cat1 .cat3 .cat5 .cat8 .et .h .lo .o .obj .x +.SUFFIXES: .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x .c .lo .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common cd $(top_srcdir) && $(AUTOMAKE) --foreign appl/telnet/telnetd/Makefile @@ -382,6 +392,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $$here + mostlyclean-tags: clean-tags: diff --git a/crypto/heimdal/appl/telnet/telnetd/ext.h b/crypto/heimdal/appl/telnet/telnetd/ext.h index 4c122f8..1cba5b6 100644 --- a/crypto/heimdal/appl/telnet/telnetd/ext.h +++ b/crypto/heimdal/appl/telnet/telnetd/ext.h @@ -33,7 +33,7 @@ * @(#)ext.h 8.2 (Berkeley) 12/15/93 */ -/* $Id: ext.h,v 1.20 2000/11/15 23:03:38 assar Exp $ */ +/* $Id: ext.h,v 1.22 2001/04/24 23:12:11 assar Exp $ */ #ifndef __EXT_H__ #define __EXT_H__ @@ -116,15 +116,15 @@ void tty_tspeed (int val); void tty_rspeed (int val); void getptyslave (void); int cleanopen (char *line); -void startslave (char *host, int autologin, char *autoname); +void startslave (const char *host, const char *, int autologin, char *autoname); void init_env (void); -void start_login (char *host, int autologin, char *name); +void start_login (const char *host, int autologin, char *name); void cleanup (int sig); int main (int argc, char **argv); int getterminaltype (char *name, size_t); void _gettermname (void); int terminaltypeok (char *s); -void my_telnet (int f, int p, char*, int, char*); +void my_telnet (int f, int p, const char*, const char *, int, char*); void interrupt (void); void sendbrk (void); void sendsusp (void); @@ -141,6 +141,7 @@ void netflush (void); void writenet (unsigned char *ptr, int len); void fatal (int f, char *msg); void fatalperror (int f, const char *msg); +void fatalperror_errno (int f, const char *msg, int error); void edithost (char *pat, char *host); void putstr (char *s); void putchr (int cc); diff --git a/crypto/heimdal/appl/telnet/telnetd/sys_term.c b/crypto/heimdal/appl/telnet/telnetd/sys_term.c index 7c529af..067f8da 100644 --- a/crypto/heimdal/appl/telnet/telnetd/sys_term.c +++ b/crypto/heimdal/appl/telnet/telnetd/sys_term.c @@ -33,7 +33,7 @@ #include "telnetd.h" -RCSID("$Id: sys_term.c,v 1.97 2000/12/08 23:32:06 assar Exp $"); +RCSID("$Id: sys_term.c,v 1.100 2001/04/24 23:11:43 assar Exp $"); #if defined(_CRAY) || (defined(__hpux) && !defined(HAVE_UTMPX_H)) # define PARENT_DOES_UTMP @@ -1110,7 +1110,8 @@ make_id (char *tty) /* ARGSUSED */ void -startslave(char *host, int autologin, char *autoname) +startslave(const char *host, const char *utmp_host, + int autologin, char *autoname) { int i; @@ -1158,7 +1159,7 @@ startslave(char *host, int autologin, char *autoname) wtmp.ut_type = LOGIN_PROCESS; wtmp.ut_pid = pid; strncpy(wtmp.ut_user, "LOGIN", sizeof(wtmp.ut_user)); - strncpy(wtmp.ut_host, host, sizeof(wtmp.ut_host)); + strncpy(wtmp.ut_host, utmp_host, sizeof(wtmp.ut_host)); strncpy(wtmp.ut_line, clean_ttyname(line), sizeof(wtmp.ut_line)); #ifdef HAVE_STRUCT_UTMP_UT_ID strncpy(wtmp.ut_id, wtmp.ut_line + 3, sizeof(wtmp.ut_id)); @@ -1192,7 +1193,6 @@ extern char **environ; void init_env(void) { - extern char *getenv(const char *); char **envp; envp = envinit; @@ -1259,10 +1259,10 @@ scrub_env(void) struct arg_val { int size; int argc; - char **argv; + const char **argv; }; -static void addarg(struct arg_val*, char*); +static void addarg(struct arg_val*, const char*); /* * start_login(host) @@ -1272,10 +1272,11 @@ static void addarg(struct arg_val*, char*); */ void -start_login(char *host, int autologin, char *name) +start_login(const char *host, int autologin, char *name) { struct arg_val argv; char *user; + int save_errno; #ifdef HAVE_UTMPX_H int pid = getpid(); @@ -1316,7 +1317,7 @@ start_login(char *host, int autologin, char *name) /* init argv structure */ argv.size=0; argv.argc=0; - argv.argv=(char**)malloc(0); /*so we can call realloc later */ + argv.argv=malloc(0); /*so we can call realloc later */ addarg(&argv, "login"); addarg(&argv, "-h"); addarg(&argv, host); @@ -1371,14 +1372,14 @@ start_login(char *host, int autologin, char *name) sleep(1); execv(new_login, argv.argv); - + save_errno = errno; syslog(LOG_ERR, "%s: %m\n", new_login); - fatalperror(net, new_login); + fatalperror_errno(net, new_login, save_errno); /*NOTREACHED*/ } static void -addarg(struct arg_val *argv, char *val) +addarg(struct arg_val *argv, const char *val) { if(argv->size <= argv->argc+1) { argv->argv = realloc(argv->argv, sizeof(char*) * (argv->size + 10)); diff --git a/crypto/heimdal/appl/telnet/telnetd/telnetd.c b/crypto/heimdal/appl/telnet/telnetd/telnetd.c index b788574..af63ce1 100644 --- a/crypto/heimdal/appl/telnet/telnetd/telnetd.c +++ b/crypto/heimdal/appl/telnet/telnetd/telnetd.c @@ -33,7 +33,7 @@ #include "telnetd.h" -RCSID("$Id: telnetd.c,v 1.63 2000/10/08 13:32:28 assar Exp $"); +RCSID("$Id: telnetd.c,v 1.64 2001/02/08 16:06:27 assar Exp $"); #ifdef _SC_CRAY_SECURE_SYS #include <sys/sysv.h> @@ -289,9 +289,14 @@ main(int argc, char **argv) #endif break; - case 'u': - utmp_len = atoi(optarg); + case 'u': { + char *eptr; + + utmp_len = strtol(optarg, &eptr, 0); + if (optarg == eptr) + fprintf(stderr, "telnetd: unknown utmp len (%s)\n", optarg); break; + } case 'U': registerd_host_only = 1; @@ -490,7 +495,6 @@ int getterminaltype(char *name, size_t name_sz) { int retval = -1; - void _gettermname(); settimer(baseline); #ifdef AUTHENTICATION @@ -629,7 +633,7 @@ getterminaltype(char *name, size_t name_sz) } /* end of getterminaltype */ void -_gettermname() +_gettermname(void) { /* * If the client turned off the option, @@ -653,9 +657,9 @@ terminaltypeok(char *s) } -char *hostname; char host_name[MaxHostNameLen]; char remote_host_name[MaxHostNameLen]; +char remote_utmp_name[MaxHostNameLen]; /* * Get a pty, scan input lines. @@ -663,12 +667,10 @@ char remote_host_name[MaxHostNameLen]; static void doit(struct sockaddr *who, int who_len) { - char *host = NULL; int level; int ptynum; char user_name[256]; int error; - char host_addr[256]; /* * Find an available pty to use. @@ -693,43 +695,42 @@ doit(struct sockaddr *who, int who_len) } #endif /* _SC_CRAY_SECURE_SYS */ - error = getnameinfo_verified (who, who_len, host_addr, sizeof(host_addr), + error = getnameinfo_verified (who, who_len, + remote_host_name, + sizeof(remote_host_name), NULL, 0, registerd_host_only ? NI_NAMEREQD : 0); if (error) fatal(net, "Couldn't resolve your address into a host name.\r\n\ Please contact your net administrator"); - /* - * We must make a copy because Kerberos is probably going - * to also do a gethost* and overwrite the static data... - */ - strlcpy(remote_host_name, host_addr, sizeof(remote_host_name)); - host = remote_host_name; - - /* XXX - should be k_gethostname? */ gethostname(host_name, sizeof (host_name)); - hostname = host_name; + + strlcpy (remote_utmp_name, remote_host_name, sizeof(remote_utmp_name)); /* Only trim if too long (and possible) */ - if (strlen(remote_host_name) > abs(utmp_len)) { + if (strlen(remote_utmp_name) > utmp_len) { char *domain = strchr(host_name, '.'); - char *p = strchr(remote_host_name, '.'); - if (domain && p && (strcmp(p, domain) == 0)) - *p = 0; /* remove domain part */ + char *p = strchr(remote_utmp_name, '.'); + if (domain != NULL && p != NULL && (strcmp(p, domain) == 0)) + *p = '\0'; /* remove domain part */ } - /* * If hostname still doesn't fit utmp, use ipaddr. */ - if (strlen(remote_host_name) > abs(utmp_len)) - strlcpy(remote_host_name, - host_addr, - sizeof(remote_host_name)); + if (strlen(remote_utmp_name) > utmp_len) { + error = getnameinfo (who, who_len, + remote_utmp_name, + sizeof(remote_utmp_name), + NULL, 0, + NI_NUMERICHOST); + if (error) + fatal(net, "Couldn't get numeric address\r\n"); + } #ifdef AUTHENTICATION - auth_encrypt_init(hostname, host, "TELNETD", 1); + auth_encrypt_init(host_name, remote_host_name, "TELNETD", 1); #endif init_env(); @@ -750,7 +751,8 @@ Please contact your net administrator"); #endif /* _SC_CRAY_SECURE_SYS */ /* begin server processing */ - my_telnet(net, ourpty, host, level, user_name); + my_telnet(net, ourpty, remote_host_name, remote_utmp_name, + level, user_name); /*NOTREACHED*/ } /* end of doit */ @@ -777,7 +779,8 @@ show_issue(void) * hand data to telnet receiver finite state machine. */ void -my_telnet(int f, int p, char *host, int level, char *autoname) +my_telnet(int f, int p, const char *host, const char *utmp_host, + int level, char *autoname) { int on = 1; char *he; @@ -960,7 +963,7 @@ my_telnet(int f, int p, char *host, int level, char *autoname) indefinitely */ if(!startslave_called && (!encrypt_delay() || timeout > time(NULL))){ startslave_called = 1; - startslave(host, level, autoname); + startslave(host, utmp_host, level, autoname); } if (ncc < 0 && pcc < 0) diff --git a/crypto/heimdal/appl/telnet/telnetd/telnetd.cat8 b/crypto/heimdal/appl/telnet/telnetd/telnetd.cat8 new file mode 100644 index 0000000..988bf31 --- /dev/null +++ b/crypto/heimdal/appl/telnet/telnetd/telnetd.cat8 @@ -0,0 +1,297 @@ + +TELNETD(8) UNIX System Manager's Manual TELNETD(8) + +NNAAMMEE + tteellnneettdd - DARPA TELNET protocol server + +SSYYNNOOPPSSIISS + tteellnneettdd [--BBUUhhkkllnn] [--DD _d_e_b_u_g_m_o_d_e] [--SS _t_o_s] [--XX _a_u_t_h_t_y_p_e] [--aa _a_u_t_h_m_o_d_e] + [--rr_l_o_w_p_t_y_-_h_i_g_h_p_t_y] [--uu _l_e_n] [--ddeebbuugg] [--LL _/_b_i_n_/_l_o_g_i_n] [_p_o_r_t] + +DDEESSCCRRIIPPTTIIOONN + The tteellnneettdd command is a server which supports the DARPA standard TELNET + virtual terminal protocol. TTeellnneettdd is normally invoked by the internet + server (see inetd(8)) for requests to connect to the TELNET port as in- + dicated by the _/_e_t_c_/_s_e_r_v_i_c_e_s file (see services(5)). The --ddeebbuugg option + may be used to start up tteellnneettdd manually, instead of through inetd(8). + If started up this way, _p_o_r_t may be specified to run tteellnneettdd on an alter- + nate TCP port number. + + The tteellnneettdd command accepts the following options: + + --aa _a_u_t_h_m_o_d_e This option may be used for specifying what mode should be + used for authentication. Note that this option is only use- + ful if tteellnneettdd has been compiled with support for the + AUTHENTICATION option. There are several valid values for + _a_u_t_h_m_o_d_e: + + debug Turns on authentication debugging code. + + user Only allow connections when the remote user can pro- + vide valid authentication information to identify the + remote user, and is allowed access to the specified + account without providing a password. + + valid Only allow connections when the remote user can pro- + vide valid authentication information to identify the + remote user. The login(1) command will provide any + additional user verification needed if the remote us- + er is not allowed automatic access to the specified + account. + + other Only allow connections that supply some authentica- + tion information. This option is currently not sup- + ported by any of the existing authentication mecha- + nisms, and is thus the same as specifying --aa vvaalliidd. + + otp Only allow authenticated connections (as with --aa + uusseerr) and also logins with one-time passwords (OTPs). + This option will call login with an option so that + only OTPs are accepted. The user can of course still + type secret information at the prompt. + + none This is the default state. Authentication informa- + tion is not required. If no or insufficient authen- + tication information is provided, then the login(1) + program will provide the necessary user verification. + + off This disables the authentication code. All user ver- + ification will happen through the login(1) program. + + --BB Ignored. + + --DD _d_e_b_u_g_m_o_d_e + This option may be used for debugging purposes. This allows + tteellnneettdd to print out debugging information to the connec- + tion, allowing the user to see what tteellnneettdd is doing. There + are several possible values for _d_e_b_u_g_m_o_d_e: + + ooppttiioonnss Prints information about the negotiation of TELNET + options. + + rreeppoorrtt Prints the ooppttiioonnss information, plus some addi- + tional information about what processing is going + on. + + nneettddaattaa Displays the data stream received by tteellnneettdd. + + ppttyyddaattaa Displays data written to the pty. + + eexxeerrcciissee Has not been implemented yet. + + --hh Disables the printing of host-specific information before + login has been completed. + + --kk + + --ll Ignored. + + --nn Disable TCP keep-alives. Normally tteellnneettdd enables the TCP + keep-alive mechanism to probe connections that have been + idle for some period of time to determine if the client is + still there, so that idle connections from machines that + have crashed or can no longer be reached may be cleaned up. + + --rr _l_o_w_p_t_y_-_h_i_g_h_p_t_y + This option is only enabled when tteellnneettdd is compiled for + UNICOS. It specifies an inclusive range of pseudo-terminal + devices to use. If the system has sysconf variable + _SC_CRAY_NPTY configured, the default pty search range is 0 + to _SC_CRAY_NPTY; otherwise, the default range is 0 to 128. + Either _l_o_w_p_t_y or _h_i_g_h_p_t_y may be omitted to allow changing + either end of the search range. If _l_o_w_p_t_y is omitted, the - + character is still required so that tteellnneettdd can differenti- + ate _h_i_g_h_p_t_y from _l_o_w_p_t_y. + + --SS _t_o_s + + --uu _l_e_n This option is used to specify the size of the field in the + utmp structure that holds the remote host name. If the re- + solved host name is longer than _l_e_n, the dotted decimal val- + ue will be used instead. This allows hosts with very long + host names that overflow this field to still be uniquely + identified. Specifying --uu00 indicates that only dotted deci- + mal addresses should be put into the _u_t_m_p file. + + --UU This option causes tteellnneettdd to refuse connections from ad- + dresses that cannot be mapped back into a symbolic name via + the gethostbyaddr(3) routine. + + --XX _a_u_t_h_t_y_p_e This option is only valid if tteellnneettdd has been built with + support for the authentication option. It disables the use + of _a_u_t_h_t_y_p_e authentication, and can be used to temporarily + disable a specific authentication type without having to re- + compile tteellnneettdd. + + --LL --ppaatthhnnaammee + Specify pathname to an alternative login program. + + TTeellnneettdd operates by allocating a pseudo-terminal device (see pty(4)) for + a client, then creating a login process which has the slave side of the + pseudo-terminal as stdin, stdout and stderr. TTeellnneettdd manipulates the mas- + ter side of the pseudo-terminal, implementing the TELNET protocol and + passing characters between the remote client and the login process. + + When a TELNET session is started up, tteellnneettdd sends TELNET options to the + client side indicating a willingness to do the following TELNET options, + which are described in more detail below: + + DO AUTHENTICATION + WILL ENCRYPT + DO TERMINAL TYPE + DO TSPEED + DO XDISPLOC + DO NEW-ENVIRON + DO ENVIRON + WILL SUPPRESS GO AHEAD + DO ECHO + DO LINEMODE + DO NAWS + WILL STATUS + DO LFLOW + DO TIMING-MARK + + The pseudo-terminal allocated to the client is configured to operate in + ``cooked'' mode, and with XTABS and CRMOD enabled (see tty(4)). + + TTeellnneettdd has support for enabling locally the following TELNET options: + + WILL ECHO When the LINEMODE option is enabled, a WILL ECHO or + WONT ECHO will be sent to the client to indicate the + current state of terminal echoing. When terminal echo + is not desired, a WILL ECHO is sent to indicate that + telnetd will take care of echoing any data that needs + to be echoed to the terminal, and then nothing is + echoed. When terminal echo is desired, a WONT ECHO is + sent to indicate that telnetd will not be doing any + terminal echoing, so the client should do any terminal + echoing that is needed. + + WILL BINARY Indicates that the client is willing to send a 8 bits + of data, rather than the normal 7 bits of the Network + Virtual Terminal. + + WILL SGA Indicates that it will not be sending IAC GA, go + ahead, commands. + + WILL STATUS Indicates a willingness to send the client, upon re- + quest, of the current status of all TELNET options. + + WILL TIMING-MARK Whenever a DO TIMING-MARK command is received, it is + always responded to with a WILL TIMING-MARK + + WILL LOGOUT When a DO LOGOUT is received, a WILL LOGOUT is sent in + response, and the TELNET session is shut down. + + WILL ENCRYPT Only sent if tteellnneettdd is compiled with support for data + encryption, and indicates a willingness to decrypt the + data stream. + + TTeellnneettdd has support for enabling remotely the following TELNET options: + + DO BINARY Sent to indicate that telnetd is willing to receive an + 8 bit data stream. + + DO LFLOW Requests that the client handle flow control charac- + + + ters remotely. + + DO ECHO This is not really supported, but is sent to identify + a 4.2BSD telnet(1) client, which will improperly re- + spond with WILL ECHO. If a WILL ECHO is received, a + DONT ECHO will be sent in response. + + DO TERMINAL-TYPE Indicates a desire to be able to request the name of + the type of terminal that is attached to the client + side of the connection. + + DO SGA Indicates that it does not need to receive IAC GA, the + go ahead command. + + DO NAWS Requests that the client inform the server when the + window (display) size changes. + + DO TERMINAL-SPEED Indicates a desire to be able to request information + about the speed of the serial line to which the client + is attached. + + DO XDISPLOC Indicates a desire to be able to request the name of + the X windows display that is associated with the tel- + net client. + + DO NEW-ENVIRON Indicates a desire to be able to request environment + variable information, as described in RFC 1572. + + DO ENVIRON Indicates a desire to be able to request environment + variable information, as described in RFC 1408. + + DO LINEMODE Only sent if tteellnneettdd is compiled with support for + linemode, and requests that the client do line by line + processing. + + DO TIMING-MARK Only sent if tteellnneettdd is compiled with support for both + linemode and kludge linemode, and the client responded + with WONT LINEMODE. If the client responds with WILL + TM, the it is assumed that the client supports kludge + linemode. Note that the [--kk] option can be used to + disable this. + + DO AUTHENTICATION Only sent if tteellnneettdd is compiled with support for au- + thentication, and indicates a willingness to receive + authentication information for automatic login. + + DO ENCRYPT Only sent if tteellnneettdd is compiled with support for data + encryption, and indicates a willingness to decrypt the + data stream. + +EENNVVIIRROONNMMEENNTT +FFIILLEESS + /etc/services + /etc/inittab (UNICOS systems only) + /etc/iptos (if supported) + +SSEEEE AALLSSOO + telnet(1), login(1) + +SSTTAANNDDAARRDDSS + RRFFCC--885544 TELNET PROTOCOL SPECIFICATION + RRFFCC--885555 TELNET OPTION SPECIFICATIONS + RRFFCC--885566 TELNET BINARY TRANSMISSION + RRFFCC--885577 TELNET ECHO OPTION + + + RRFFCC--885588 TELNET SUPPRESS GO AHEAD OPTION + RRFFCC--885599 TELNET STATUS OPTION + RRFFCC--886600 TELNET TIMING MARK OPTION + RRFFCC--886611 TELNET EXTENDED OPTIONS - LIST OPTION + RRFFCC--888855 TELNET END OF RECORD OPTION + RRFFCC--11007733 Telnet Window Size Option + RRFFCC--11007799 Telnet Terminal Speed Option + RRFFCC--11009911 Telnet Terminal-Type Option + RRFFCC--11009966 Telnet X Display Location Option + RRFFCC--11112233 Requirements for Internet Hosts -- Application and Support + RRFFCC--11118844 Telnet Linemode Option + RRFFCC--11337722 Telnet Remote Flow Control Option + RRFFCC--11441166 Telnet Authentication Option + RRFFCC--11441111 Telnet Authentication: Kerberos Version 4 + RRFFCC--11441122 Telnet Authentication: SPX + RRFFCC--11557711 Telnet Environment Option Interoperability Issues + RRFFCC--11557722 Telnet Environment Option + +BBUUGGSS + Some TELNET commands are only partially implemented. + + Because of bugs in the original 4.2 BSD telnet(1), tteellnneettdd performs some + dubious protocol exchanges to try to discover if the remote client is, in + fact, a 4.2 BSD telnet(1). + + Binary mode has no common interpretation except between similar operating + systems (Unix in this case). + + The terminal type name received from the remote client is converted to + lower case. + + TTeellnneettdd never sends TELNET IAC GA (go ahead) commands. + +4.2 Berkeley Distribution June 1, 1994 5 diff --git a/crypto/heimdal/appl/telnet/telnetd/telnetd.h b/crypto/heimdal/appl/telnet/telnetd/telnetd.h index fdda3d7..6504607 100644 --- a/crypto/heimdal/appl/telnet/telnetd/telnetd.h +++ b/crypto/heimdal/appl/telnet/telnetd/telnetd.h @@ -166,7 +166,6 @@ struct hostent *gethostbyname(const char *); #endif #ifdef KRB4 -#include <des.h> #include <krb.h> #endif diff --git a/crypto/heimdal/appl/telnet/telnetd/utility.c b/crypto/heimdal/appl/telnet/telnetd/utility.c index a2e542d..496152c 100644 --- a/crypto/heimdal/appl/telnet/telnetd/utility.c +++ b/crypto/heimdal/appl/telnet/telnetd/utility.c @@ -34,7 +34,7 @@ #define PRINTOPTIONS #include "telnetd.h" -RCSID("$Id: utility.c,v 1.23 2000/10/08 13:34:27 assar Exp $"); +RCSID("$Id: utility.c,v 1.25 2001/05/17 00:34:42 assar Exp $"); /* * utility functions performing io related tasks @@ -363,14 +363,20 @@ void fatal(int f, char *msg) } void -fatalperror(int f, const char *msg) +fatalperror_errno(int f, const char *msg, int error) { char buf[BUFSIZ]; - snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(errno)); + snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(error)); fatal(f, buf); } +void +fatalperror(int f, const char *msg) +{ + fatalperror_errno(f, msg, errno); +} + char editedhost[32]; void edithost(char *pat, char *host) |