From 5ef43beff03aa2cd77c7248356b9cb2ae17137a1 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 10 Jun 1994 18:33:58 +0000 Subject: [PATCH] Updated telnet to be the 94.02.07 version, with some bugfixes git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3704 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/Config.generic | 503 ++++++-- src/appl/telnet/README | 125 +- src/appl/telnet/arpa/telnet.h | 36 +- src/appl/telnet/libtelnet/Imakefile | 27 +- src/appl/telnet/libtelnet/Makefile.4.4 | 36 +- src/appl/telnet/libtelnet/Makefile.generic | 9 +- src/appl/telnet/libtelnet/Makefile.orig | 5 +- src/appl/telnet/libtelnet/auth-proto.h | 7 +- src/appl/telnet/libtelnet/auth.c | 12 +- src/appl/telnet/libtelnet/auth.h | 6 +- src/appl/telnet/libtelnet/enc-proto.h | 10 +- src/appl/telnet/libtelnet/enc_des.c | 20 +- src/appl/telnet/libtelnet/encrypt.c | 14 +- src/appl/telnet/libtelnet/encrypt.h | 28 +- src/appl/telnet/libtelnet/forward.c | 4 +- src/appl/telnet/libtelnet/genget.c | 6 +- src/appl/telnet/libtelnet/getent.c | 27 +- src/appl/telnet/libtelnet/getopt.c | 68 +- src/appl/telnet/libtelnet/herror.c | 48 +- src/appl/telnet/libtelnet/kerberos.c | 42 +- src/appl/telnet/libtelnet/kerberos5.c | 49 +- src/appl/telnet/libtelnet/key-proto.h | 6 +- src/appl/telnet/libtelnet/krb4encpwd.c | 12 +- src/appl/telnet/libtelnet/mem.c | 160 ++- src/appl/telnet/libtelnet/misc-proto.h | 6 +- src/appl/telnet/libtelnet/misc.c | 10 +- src/appl/telnet/libtelnet/misc.h | 6 +- src/appl/telnet/libtelnet/parsetos.c | 41 + src/appl/telnet/libtelnet/read_password.c | 9 +- src/appl/telnet/libtelnet/rsaencpwd.c | 8 +- src/appl/telnet/libtelnet/setenv.c | 159 ++- src/appl/telnet/libtelnet/setsid.c | 52 +- src/appl/telnet/libtelnet/spx.c | 14 +- src/appl/telnet/libtelnet/strcasecmp.c | 85 +- src/appl/telnet/libtelnet/strchr.c | 44 +- src/appl/telnet/libtelnet/strdup.c | 64 +- src/appl/telnet/libtelnet/strerror.c | 71 +- src/appl/telnet/libtelnet/strrchr.c | 44 +- src/appl/telnet/telnet/Imakefile | 30 +- src/appl/telnet/telnet/Makefile.4.4 | 65 +- src/appl/telnet/telnet/Makefile.orig | 5 +- src/appl/telnet/telnet/authenc.c | 14 +- src/appl/telnet/telnet/commands.c | 107 +- src/appl/telnet/telnet/defines.h | 6 +- src/appl/telnet/telnet/externs.h | 32 +- src/appl/telnet/telnet/fdset.h | 6 +- src/appl/telnet/telnet/general.h | 6 +- src/appl/telnet/telnet/main.c | 2 + src/appl/telnet/telnet/network.c | 14 +- src/appl/telnet/telnet/ring.c | 18 +- src/appl/telnet/telnet/ring.h | 14 +- src/appl/telnet/telnet/sys_bsd.c | 38 +- src/appl/telnet/telnet/telnet.0 | 333 ------ src/appl/telnet/telnet/telnet.0.ps | 1008 ++++++++++++++++ src/appl/telnet/telnet/telnet.0.txt | 718 +++++++++++ src/appl/telnet/telnet/telnet.1 | 1264 +++++++++----------- src/appl/telnet/telnet/telnet.c | 165 ++- src/appl/telnet/telnet/terminal.c | 10 +- src/appl/telnet/telnet/tn3270.c | 16 +- src/appl/telnet/telnet/types.h | 6 +- src/appl/telnet/telnet/utilities.c | 91 +- src/appl/telnet/telnetd/Imakefile | 30 +- src/appl/telnet/telnetd/Makefile.4.4 | 44 +- src/appl/telnet/telnetd/Makefile.generic | 2 +- src/appl/telnet/telnetd/Makefile.orig | 5 +- src/appl/telnet/telnetd/authenc.c | 14 +- src/appl/telnet/telnetd/defs.h | 10 +- src/appl/telnet/telnetd/ext.h | 16 +- src/appl/telnet/telnetd/global.c | 6 +- src/appl/telnet/telnetd/pathnames.h | 14 +- src/appl/telnet/telnetd/slc.c | 6 +- src/appl/telnet/telnetd/state.c | 233 +++- src/appl/telnet/telnetd/sys_term.c | 417 +++++-- src/appl/telnet/telnetd/telnetd.0 | 132 -- src/appl/telnet/telnetd/telnetd.0.ps | 555 +++++++++ src/appl/telnet/telnetd/telnetd.0.txt | 322 +++++ src/appl/telnet/telnetd/telnetd.8 | 711 +++++++++-- src/appl/telnet/telnetd/telnetd.c | 210 +++- src/appl/telnet/telnetd/telnetd.h | 6 +- src/appl/telnet/telnetd/termstat.c | 58 +- src/appl/telnet/telnetd/utility.c | 86 +- 81 files changed, 6355 insertions(+), 2363 deletions(-) create mode 100644 src/appl/telnet/libtelnet/parsetos.c delete mode 100644 src/appl/telnet/telnet/telnet.0 create mode 100644 src/appl/telnet/telnet/telnet.0.ps create mode 100644 src/appl/telnet/telnet/telnet.0.txt delete mode 100644 src/appl/telnet/telnetd/telnetd.0 create mode 100644 src/appl/telnet/telnetd/telnetd.0.ps create mode 100644 src/appl/telnet/telnetd/telnetd.0.txt diff --git a/src/appl/telnet/Config.generic b/src/appl/telnet/Config.generic index 263098921..c6f88a52b 100644 --- a/src/appl/telnet/Config.generic +++ b/src/appl/telnet/Config.generic @@ -74,12 +74,22 @@ # KRB5 Enable Kerberos Version 5 Authentication code # in libtelnet/libtelnet.a # -# SIMPLE_AUTH +# SPX Enable SPX authentication code in. +# libtelnet/libtelnet.a +# +# RSA_ENCPWD +# +# KRB4_ENCPWD +# # # DES_ENCRYPTION Enable DES encryption/decryption, requires # getting a the initial key from Kerberos. This # works with both Kerberos Version 4 and 5. # +# ENV_HACK Turn on code to recognize and allow +# interoperability with systems that have their +# definitions for ENV_VALUE and ENV_VAR reversed. +# # LOCAL SYSYTEM PARAMATERS # # TERMCAP Define this if your system is termcap based, @@ -110,9 +120,45 @@ # # NO_STRING_H If you don't have , but have # +# LOGIN_PROGRAM= Specifies the login program to use. By default, +# it is /bin/login, or whatever is specified by +# _PATH_LOGIN in +# # NO_LOGIN_P If /bin/login doesn't understand the "-p" # (preserve environment) option. # +# LOGIN_ARGS if /bin/login understands environment variables +# after the login name. Only used if NO_LOGIN_P +# is defined. +# +# NO_LOGIN_F If /bin/login doesn't understand the "-f" option. +# Only used if AUTHENTICATION is defined. +# +# LOGIN_CAP_F If /bin/login understands the "-F" option (which +# works like "-f", but root logins are allowed). +# Only used if NO_LOGIN_F is not defined. +# +# LOGIN_R This says that /bin/login understands the "-r host" +# option. Only used if NO_LOGIN_F is defined (and +# the system supports the TIOCSTI ioctl). +# +# LOGIN_HOST Only applies if LOGIN_R is defined. This +# specifies the hostname to be passed to "login -r" +# for successfully authenticated logins. This +# defaults to "localhost" (don't forget to include +# the quotes, e.g. -DLOGIN_HOST=\"localhost\"). +# +# It can also be set to host (-DLOGIN_HOST=host) +# to have the real hostname passed to "/bin/login -r". +# NOTE: If you do this, then anyone that wants to +# allow authenticated login access will have +# to add those remote hosts to their .rhosts, +# which sort of defeats the whole purpose of +# authenticated login... +# +# NO_BSD_SETJMP For UNICOS releases prior to 7.0. Turns off +# the inclusion of . +# # STREAMS If the system has streams; causes # to be included instead of # @@ -126,6 +172,14 @@ # UTMPX System has /etc/utmpx as well as /etc/utmp. # Use makeutx and modutx to update utmp/x and wtmp/x. # Appropriate for SVr4 derivatives. +# +# HAS_CGETENT If your system has the cgetent() and cgetstr() +# routines. This is a 4.4BSD feature, that +# eliminates grabbing the getty gettytab.c source. +# You need to include getent.o on the LIB_OBJ +# line if this is defined. +# +# OLD_ENVIRON Support for the old environment option. # LIB_OBJ= # This is a list of object files that are needed but are not in @@ -140,9 +194,8 @@ # getopt.o If you don't have getopt(3) # herror.o If you don't have herror(3) # gettytab.o If you can get gettytab.c from getty source. -# getent.o If you can't get gettytab.c -# kerberos.o If you have Kerberos Version 4 -# kerberos5.o If you have Kerberos Version 5 +# getent.o If you can't get gettytab.c (or have +# HAS_CGETENT defined...) # mem.o If you don't have mem*(3) routines. # LIB_SRC= @@ -180,49 +233,54 @@ # Name of "ranlib" program, set it to "NONE" if you don't # have a "ranlib". -ODEFS="-DKRB5 -DAUTHENTICATION" -KRB_INC= -I../../../include -KRB_LIBS=" $(KLIB)" -KRB_LIBPATH=" $(DEPKLIB)" - all: - @echo "you must specify what type of system you are on," - @echo "or modify the makefile for your system." + @echo "You must specify what type of system you are on," + @echo "or setup a Config.local file for your system." @echo "Known system types are:" - @echo " 4.4bsd 4.3reno 4.3tahoe 4.3bsd" - @echo " unicos5.0 unicos5.1 unicos6.0 unicos6.1 unicos7.0 unicos8.0" - @echo " sun3.5 sun4.0 sun4.0.3c sun4.1 sol2.0" + @echo + @echo " 4.4bsd 4.3reno 4.4bsd.auth 4.3reno.auth 4.3tahoe 4.3bsd" + @echo " bsdi1.0 bsdi1.0.auth" + @echo " unicos8.1 unicos8.0 unicos7.C unicos7.0" + @echo " unicos8.1.auth unicos8.0.auth unicos7.0.auth" + @echo " unicos7.C.auth unicos7.0.des.auth" + @echo " unicos6.1 unicos6.0 unicos5.1 unicos5.0" + @echo " sun3.5 sun4.0.3c sun4.0 sun4.1 sun4.1.auth" + @echo " solaris2.2 solaris2.2.auth" @echo " dynix3.0.12 dynix3.0.17" - @echo " ultrix3.1 ultrix4.0" + @echo " ultrix3.1 ultrix4.0 ultrix4.1 ultrix4.3 ultrix4.3.auth" + @echo " irix4.0.1" + @echo " hpux8.0" @echo " next1.0" + @echo " convex" 4.4bsd: make -f Makefile.generic ${WHAT} \ - LIBS="-lutil -ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ - LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + LIBS="-lutil -ltermcap ../libtelnet/libtelnet.a" \ + LIBPATH="/usr/lib/libc.a /usr/lib/libtermcap.a \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/bin \ - DEFINES=${ODEFS}" -DLINEMODE -DTERMCAP -DKLUDGELINEMODE \ + DEFINES=${ODEFS}"-DLINEMODE -DTERMCAP -DKLUDGELINEMODE \ -DDEFAULT_IM='\"\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r\"' \ - -DUSE_TERMIO -DDIAGNOSTICS" \ - INCLUDES=${KRB_INC}" -I.." \ - LIB_OBJ="gettytab.o" \ - LIB_SRC="gettytab.c" \ + -DUSE_TERMIO -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON \ + -DHAS_CGETENT" \ + INCLUDES="-I.." \ + LIB_OBJ="getent.o" \ + LIB_SRC="getent.c" \ AR=ar ARFLAGS=cq RANLIB=ranlib \ - VPATH=/usr/src/libexec/getty \ LIBEXEC=${DESTDIR}/usr/libexec \ CC="${CC}" LCCFLAGS="-O" 4.3reno: make -f Makefile.generic ${WHAT} \ - LIBS="-lutil -ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-lutil -ltermcap ../libtelnet/libtelnet.a ${AUTH_LIB}" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a ${AUTH_LIBPATH}" \ DEST=${DESTDIR}/usr/bin \ - DEFINES=${ODEFS}" -DLINEMODE -DTERMCAP -DKLUDGELINEMODE \ + DEFINES=${ODEFS}"-DLINEMODE -DTERMCAP -DKLUDGELINEMODE \ -DDEFAULT_IM='\"\r\n4.3BSD-Reno UNIX (%h) (%t)\r\n\r\r\n\r\"' \ - -DUSE_TERMIO -DDIAGNOSTICS" \ - INCLUDES=${KRB_INC}" -I.." \ + -DUSE_TERMIO -DDIAGNOSTICS -DENV_HACK \ + -DOLD_ENVIRON ${AUTH_DEF}" \ + INCLUDES="-I.. ${AUTH_INC}" \ LIB_OBJ="gettytab.o" \ LIB_SRC="gettytab.c" \ AR=ar ARFLAGS=cq RANLIB=ranlib \ @@ -230,17 +288,24 @@ all: LIBEXEC=${DESTDIR}/usr/libexec \ CC="${CC}" LCCFLAGS="-O" + +4.4bsd.auth 4.3reno.auth: + make -f ../Config.generic `basename $@ .auth` WHAT=${WHAT} \ + AUTH_LIB="-lkrb -ldes" \ + AUTH_LIBPATH="/usr/lib/libkrb.a /usr/lib/libdes.a" \ + AUTH_DEF="-DAUTHENTICATION -DENCRYPTION -DKRB4 -DDES_ENCRYPTION" + 4.3tahoe: @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/bin \ - DEFINES=${ODEFS}" -DTERMCAP -DKLUDGELINEMODE \ + DEFINES=${ODEFS}"-DTERMCAP -DKLUDGELINEMODE \ -DDEFAULT_IM='\"\r\n4.3BSD-Tahoe UNIX (%h) (%t)\r\n\r\r\n\r\"'\ - -DDIAGNOSTICS" \ - INCLUDES=${KRB_INC}" -I.." \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ + INCLUDES="-I.." \ LIB_OBJ="strdup.o setsid.o strftime.o gettytab.o" \ LIB_SRC="strdup.c setsid.c strftime.c gettytab.c" \ AR=ar ARFLAGS=cq RANLIB=ranlib \ @@ -249,115 +314,195 @@ all: CC="${CC}" LCCFLAGS="-O" 4.3bsd: + @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/bin \ - DESTDIR=${DESTDIR} \ - DEFINES=${ODEFS}" -DTERMCAP -DKLUDGELINEMODE \ + DEFINES=${ODEFS}"-DTERMCAP -DKLUDGELINEMODE \ -DDEFAULT_IM='\"\r\n4.3BSD UNIX (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS" \ - INCLUDES=${KRB_INC}" -I.." \ - LIB_OBJ="strdup.o setsid.o strftime.o strerror.o \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ + INCLUDES="-I.." \ + LIB_OBJ="strdup.o setsid.o strftime.o \ gettytab.o getopt.o herror.o" \ - LIB_SRC="strdup.c setsid.c strftime.c strerror.c \ + LIB_SRC="strdup.c setsid.c strftime.c \ gettytab.c getopt.c herror.c" \ AR=ar ARFLAGS=cq RANLIB=ranlib \ + VPATH=/usr/src/etc/getty \ LIBEXEC=${DESTDIR}/etc \ CC="${CC}" LCCFLAGS="-O" +bsdi1.0: + make -f Makefile.generic ${WHAT} \ + LIBS="-lutil -ltermcap ../libtelnet/libtelnet.a ${AUTH_LIB}" \ + LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ + ../libtelnet/libtelnet.a ${AUTH_LIBPATH}" \ + DEST=${DESTDIR}/usr/bin \ + DEFINES=${ODEFS}"-DLINEMODE -DTERMCAP -DKLUDGELINEMODE \ + -DDEFAULT_IM='\"\r\nBSDI BSD/386 1.0 (%h) (%t)\r\n\r\r\n\r\"' \ + -DUSE_TERMIO -DDIAGNOSTICS -DENV_HACK \ + -DOLD_ENVIRON ${AUTH_DEF}" \ + INCLUDES="-I.. ${AUTH_INC}" \ + LIB_OBJ="gettytab.o" \ + LIB_SRC="gettytab.c" \ + AR=ar ARFLAGS=cq RANLIB=ranlib \ + VPATH=/usr/src/libexec/getty \ + LIBEXEC=${DESTDIR}/usr/libexec \ + CC="${CC}" LCCFLAGS="-O" + +bsdi1.0.auth: + make -f ../Config.generic `basename $@ .auth` WHAT=${WHAT} \ + AUTH_LIB="-lkrb -ldes" \ + AUTH_LIBPATH="/usr/lib/libkrb.a /usr/lib/libdes.a" \ + AUTH_DEF="-DAUTHENTICATION -DENCRYPTION -DKRB4 -DDES_ENCRYPTION" + AUTH_INC=-I/usr/include/kerberosIV + +unicos8.1: + make -f Makefile.generic ${WHAT} \ + LIBS="-lcurses -L../libtelnet -ltelnet ${AUTH_LIB}" \ + LIBPATH="/lib/libc.a /usr/lib/libcurses.a \ + ../libtelnet/libtelnet.a ${AUTH_LIBPATH}" \ + DEST=${DESTDIR}/usr/ucb \ + DEFINES=${ODEFS}"-Dvfork=fork -Dsignal=bsdsignal \ + -DLINEMODE -DKLUDGELINEMODE \ + -DSYSV_TERMIO -DHAS_GETTOS ${AUTH_DEF} \ + -DDEFAULT_IM='\"\r\nCray UNICOS 8.1 (%h) (%t)\r\n\r\r\n\r\"' \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ + AR=bld ARFLAGS=cq RANLIB=NONE \ + LIBEXEC=${DESTDIR}/etc \ + INCLUDES="-I.. ${AUTH_INC}" \ + LIB_OBJ="getent.o" \ + LIB_SRC="getent.c" \ + unicos8.0: make -f Makefile.generic ${WHAT} \ - LIBS="-lcurses -L../libtelnet -ltelnet "${KRB_LIBS} \ + LIBS="-lcurses -L../libtelnet -ltelnet ${AUTH_LIB}" \ LIBPATH="/lib/libc.a /usr/lib/libcurses.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} + ../libtelnet/libtelnet.a ${AUTH_LIBPATH}" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-Dvfork=fork -Dsignal=bsdsignal \ -DLINEMODE -DKLUDGELINEMODE \ - -DSYSV_TERMIO -DHAS_GETTOS \ - -D_ANSI_PROTO \ + -DSYSV_TERMIO -DHAS_GETTOS ${AUTH_DEF} \ -DDEFAULT_IM='\"\r\nCray UNICOS 8.0 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS" \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ + AR=bld ARFLAGS=cq RANLIB=NONE \ + LIBEXEC=${DESTDIR}/etc \ + INCLUDES="-I.. ${AUTH_INC}" \ + LIB_OBJ="getent.o" \ + LIB_SRC="getent.c" \ + CC="${CC}" LCCFLAGS="-O" + +unicos7.C: + make -f Makefile.generic ${WHAT} \ + LIBS="-lcurses -L../libtelnet -ltelnet ${AUTH_LIB}" \ + LIBPATH="/lib/libc.a /usr/lib/libcurses.a \ + ../libtelnet/libtelnet.a ${AUTH_LIBPATH}"\ + DEST=${DESTDIR}/usr/ucb \ + DEFINES=${ODEFS}"-Dvfork=fork -Dsignal=bsdsignal \ + -DLINEMODE -DKLUDGELINEMODE \ + -DSYSV_TERMIO -DHAS_GETTOS ${AUTH_DEF} \ + -DDEFAULT_IM='\"\r\nCray UNICOS 7.C (%h) (%t)\r\n\r\r\n\r\"' \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ AR=bld ARFLAGS=cq RANLIB=NONE \ LIBEXEC=${DESTDIR}/etc \ - INCLUDES=${KRB_INC}" -I.." \ + INCLUDES="-I.. ${AUTH_INC}" \ LIB_OBJ="getent.o" \ LIB_SRC="getent.c" \ CC="${CC}" LCCFLAGS="-O" -unicos7.0 unicos7.C: + +unicos7.0: make -f Makefile.generic ${WHAT} \ - LIBS="-lcurses -L../libtelnet -ltelnet "${KRB_LIBS} \ + LIBS="-lcurses -L../libtelnet -ltelnet -lkrb" \ LIBPATH="/lib/libc.a /usr/lib/libcurses.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} + ../libtelnet/libtelnet.a /usr/lib/libkrb.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-Dvfork=fork -Dsignal=bsdsignal \ -DLINEMODE -DKLUDGELINEMODE \ -DSYSV_TERMIO -DHAS_GETTOS \ -DDEFAULT_IM='\"\r\nCray UNICOS 7.0 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS" \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ AR=bld ARFLAGS=cq RANLIB=NONE \ LIBEXEC=${DESTDIR}/etc \ - INCLUDES=${KRB_INC}" -I.." \ + INCLUDES="-I.." \ LIB_OBJ="getent.o" \ LIB_SRC="getent.c" \ CC="${CC}" LCCFLAGS="-O" +# As of UNICOS 7.0.5.2, there is no longer a /usr/lib/libdes.a +# If you still have a /usr/lib/libdes.a, use the "unicos7.0.des.auth" +# target instead of "unicos7.0.auth". + +unicos8.1.auth unicos8.0.auth unicos7.0.auth: + make -f ../Config.generic `basename $@ .auth` WHAT=${WHAT} \ + AUTH_LIB=-lkrb AUTH_LIBPATH=/usr/lib/libkrb.a \ + AUTH_INC=-I/usr/include/krb \ + AUTH_DEF="-DAUTHENTICATION -DENCRYPTION -DKRB4 -DDES_ENCRYPTION" + +unicos7.C.auth unicos7.0.des.auth: + make -f ../Config.generic `basename $@ .des.auth` WHAT=${WHAT} \ + AUTH_LIB="-lkrb -ldes" \ + AUTH_LIBPATH="/usr/lib/libkrb.a /usr/lib/libdes.a" \ + AUTH_INC=-I/usr/include/krb \ + AUTH_DEF="-DAUTHENTICATION -DENCRYPTION -DKRB4 -DDES_ENCRYPTION" + unicos6.1: make -f Makefile.generic ${WHAT} \ - LIBS="-lcurses -L../libtelnet -ltelnet "${KRB_LIBS} \ + LIBS="-lcurses -L../libtelnet -ltelnet" \ LIBPATH="/lib/libc.a /usr/lib/libcurses.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-Dvfork=fork -Dsignal=bsdsignal \ -DKLUDGELINEMODE -DUSE_TERMIO -DHAS_GETTOS \ -DLINEMODE -DSYSV_TERMIO -DNEWINIT \ - -DNO_LOGIN_F -DNO_LOGIN_P \ - -DAUTHENTICATION -DENCRYPTION \ + -DNO_LOGIN_F -DNO_LOGIN_P -DNO_BSD_SETJMP \ + -DLOGIN_ARGS \ -DDEFAULT_IM='\"\r\nCray UNICOS 6.1 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS" \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ AR=bld ARFLAGS=cq RANLIB=NONE \ LIBEXEC=${DESTDIR}/etc \ - INCLUDES=${KRB_INC}" -I.." \ - LIB_OBJ="getent.o" \ - LIB_SRC="getent.c" \ + INCLUDES="-I.." \ + LIB_OBJ="getent.o parsetos.o" \ + LIB_SRC="getent.c parsetos.c" \ CC="${CC}" LCCFLAGS="-O" unicos6.0: + @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-lcurses -L../libtelnet -ltelnet "${KRB_LIBS} \ + LIBS="-lcurses -L../libtelnet -ltelnet" \ LIBPATH="/lib/libc.a /usr/lib/libcurses.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-Dvfork=fork -Dsignal=bsdsignal \ -DKLUDGELINEMODE -DUSE_TERMIO -DHAS_GETTOS \ -DLINEMODE -DSYSV_TERMIO -DNEWINIT \ - -DNO_LOGIN_F -DNO_LOGIN_P \ - -DAUTHENTICATION -DENCRYPTION \ + -DNO_LOGIN_F -DNO_LOGIN_P -DNO_BSD_SETJMP \ + -DLOGIN_ARGS \ -DDEFAULT_IM='\"\r\nCray UNICOS 6.0 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS" \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ AR=bld ARFLAGS=cq RANLIB=NONE \ LIBEXEC=${DESTDIR}/etc \ - INCLUDES=${KRB_INC}" -I.." \ - LIB_OBJ="getent.o" \ - LIB_SRC="getent.c" \ + INCLUDES="-I.." \ + LIB_OBJ="getent.o parsetos.o" \ + LIB_SRC="getent.c parsetos.c" \ CC="${CC}" LCCFLAGS="-O" unicos5.1: + @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-lnet -lcurses -L../libtelnet -ltelnet "${KRB_LIBS} \ + LIBS="-lnet -lcurses -L../libtelnet -ltelnet" \ LIBPATH="/lib/libc.a /usr/lib/libcurses.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-Dvfork=fork -Dsignal=sigset \ -DKLUDGELINEMODE -DSYSV_TERMIO -DNO_CC_T \ -DUNICOS5 -DLINEMODE -DSYSV_TERMIO \ - -DNEWINIT -DNO_LOGIN_F -DNO_LOGIN_P \ - -DAUTHENTICATION -DENCRYPTION \ + -DNEWINIT -DNO_LOGIN_F -DNO_LOGIN_P -DNO_BSD_SETJMP \ + -DLOGIN_ARGS \ -DDEFAULT_IM='\"\r\nCray UNICOS 5.1 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS" \ - INCLUDES=${KRB_INC}" -I.." \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ + INCLUDES="-I.." \ LIB_OBJ="getent.o strerror.o setsid.o strftime.o" \ LIB_SRC="getent.c strerror.c setsid.c strftime.c" \ AR=bld ARFLAGS=cq RANLIB=NONE \ @@ -365,19 +510,20 @@ unicos5.1: CC="${CC}" LCCFLAGS="-O" unicos5.0: + @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-lnet -lcurses -L../libtelnet -ltelnet "${KRB_LIBS} \ + LIBS="-lnet -lcurses -L../libtelnet -ltelnet" \ LIBPATH="/lib/libc.a /usr/lib/libcurses.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-Dvfork=fork -Dsignal=sigset \ -DKLUDGELINEMODE -DSYSV_TERMIO -DNO_CC_T \ -DUNICOS5 -DUNICOS50 -DLINEMODE -DSYSV_TERMIO \ - -DNEWINIT -DNO_LOGIN_F -DNO_LOGIN_P \ - -DAUTHENTICATION -DENCRYPTION \ + -DNEWINIT -DNO_LOGIN_F -DNO_LOGIN_P -DNO_BSD_SETJMP \ + -DLOGIN_ARGS \ -DDEFAULT_IM='\"\r\nCray UNICOS 5.0 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS" \ - INCLUDES=${KRB_INC}" -I.." \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ + INCLUDES="-I.." \ LIB_OBJ="getent.o strerror.o setsid.o strftime.o" \ LIB_SRC="getent.c strerror.c setsid.c strftime.c" \ AR=bld ARFLAGS=cq RANLIB=NONE \ @@ -385,17 +531,18 @@ unicos5.0: CC="${CC}" LCCFLAGS="-O" sun3.5: + @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-DTERMCAP -DKLUDGELINEMODE \ -DHAVE_fd_set \ - -DDIAGNOSTICS \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON \ -DDEFAULT_IM='\"\r\nSunOS UNIX 3.5 (%h) (%t)\r\n\r\r\n\r\"' \ -DNO_LOGIN_P" \ - INCLUDES=${KRB_INC}" -I.." \ + INCLUDES="-I.." \ LIB_OBJ="getent.o strdup.o strerror.o setsid.o \ setenv.o strftime.o strcasecmp.o herror.o" \ LIB_SRC="getent.c strdup.c strerror.c setsid.c \ @@ -407,16 +554,16 @@ sun3.5: sun4.0.3c sun4.0: @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-DFILIO_H -DTERMCAP -DUSE_TERMIO -DNO_CC_T \ -DKLUDGELINEMODE \ -DDEFAULT_IM='\"\r\nSunOS UNIX 4.0 (%h) (%t)\r\n\r\r\n\r\"' \ - -DSTREAMS -DDIAGNOSTICS \ + -DSTREAMS -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON \ " \ - INCLUDES=${KRB_INC}" -I.." \ + INCLUDES="-I.." \ LIB_OBJ="getent.o strerror.o setsid.o setenv.o \ strcasecmp.o strftime.o herror.o" \ LIB_SRC="getent.c strerror.c setsid.c setenv.c \ @@ -427,52 +574,63 @@ sun4.0.3c sun4.0: sun4.1: make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a ${AUTH_LIB}" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a ${AUTH_LIBPATH}" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-DFILIO_H -DTERMCAP -DUSE_TERMIO \ -DKLUDGELINEMODE -DSTREAMS \ - -DAUTHENTICATION -DENCRYPTION \ -DDEFAULT_IM='\"\r\nSunOS UNIX 4.1 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS " \ - INCLUDES=${KRB_INC}" -I.." \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON ${AUTH_DEF}" \ + INCLUDES="-I.. ${AUTH_INC}" \ LIB_OBJ="getent.o strerror.o setenv.o herror.o" \ LIB_SRC="getent.c strerror.c setenv.c herror.c" \ AR=ar ARFLAGS=cq RANLIB=ranlib \ LIBEXEC=${DESTDIR}/usr/etc/in.telnetd \ CC="${CC}" LCCFLAGS="-O" -sol2.0: +sun4.1.auth: + make -f ../Config.generic `basename $@ .auth` WHAT=${WHAT} \ + AUTH_LIB="-lkrb -ldes" \ + AUTH_LIBPATH="/usr/lib/libkrb.a /usr/lib/libdes.a" \ + AUTH_DEF="-DAUTHENTICATION -DENCRYPTION -DKRB4 -DDES_ENCRYPTION" + +sol2.2 solaris2.2: make -f Makefile.generic ${WHAT} \ - LIBS="/usr/ccs/lib/libtermcap.a ../libtelnet/libtelnet.a \ - -lc /usr/ucblib/libucb.a -lsocket -lnsl "${KRB_LIBS} \ - LIBPATH="/usr/ccs/lib/libtermcap.a ../libtelnet/libtelnet.a \ + LIBS="-ltermlib ../libtelnet/libtelnet.a" \ + LIBPATH="/usr/ccs/lib/libtermlib.a ../libtelnet/libtelnet.a \ /usr/lib/libc.a /usr/ucblib/libucb.a \ - /usr/lib/libsocket.a /usr/lib/libnsl.a "${KRB_LIBPATH} \ + /usr/lib/libsocket.a /usr/lib/libnsl.a" \ DEST=${DESTDIR}/usr/ucb \ - DEFINES="-DFILIO_H -DTERMCAP -DUSE_TERMIO \ - -DKLUDGELINEMODE -DSTREAMS -DSTREAMSPTY \ - -DDIAGNOSTICS -DNO_LOGIN_P -DUTMPX" \ - INCLUDES=${KRB_INC}" -I.. -I/opt/cygnus/lib/ucbinclude \ - -I/usr/ucbinclude" \ + DEFINES="-DFILIO_H -DUSE_TERMIO -DKLUDGELINEMODE \ + -DSTREAMS -DSTREAMSPTY -DDIAGNOSTICS -DSOLARIS \ + -DENV_HACK -DOLD_ENVIRON -DNO_LOGIN_P -DUTMPX \ + -DDEFAULT_IM='\"\r\n\r\nUNIX(r) System V Release 4.0 (%h)\r\n\r\n\"' \ + -DLOGIN_ARGS" \ + INCLUDES="-I.. -I/usr/ucbinclude" \ LIB_OBJ="getent.o strerror.o setenv.o herror.o" \ LIB_SRC="getent.c strerror.c setenv.c herror.c" \ - AR=ar ARFLAGS=cq RANLIB=ranlib \ + AR=ar ARFLAGS=cq RANLIB=NONE \ LIBEXEC=${DESTDIR}/usr/etc/in.telnetd \ CC="${CC}" LCCFLAGS="-O" +sol2.2.auth solaris2.2.auth: + make -f ../Config.generic `basename $@ .auth` WHAT=${WHAT} \ + AUTH_LIB="-lkrb" AUTH_LIBPATH="/usr/lib/libkrb.a" \ + AUTH_INC=-I/usr/include/kerberos \ + AUTH_DEF="-DAUTHENTICATION -DKRB4" + dynix3.0.12: @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-DTERMCAP -DKLUDGELINEMODE \ -DDEFAULT_IM='\"\r\nDYNIX(R) V3.0.12 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS -DNO_STRING_H " \ - INCLUDES=${KRB_INC}" -I.." \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON -DNO_STRING_H " \ + INCLUDES="-I.." \ LIB_OBJ="getent.o strchr.o strrchr.o strdup.o strerror.o \ setsid.o setenv.o strcasecmp.o strftime.o getopt.o \ mem.o" \ @@ -485,15 +643,15 @@ dynix3.0.12: dynix3.0.17: make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a -lseq "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a -lseq" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a /usr/lib/libseq.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a /usr/lib/libseq.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-DTERMCAP -DKLUDGELINEMODE \ - -DDIAGNOSTICS -DNO_STRING_H \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON -DNO_STRING_H \ -DDEFAULT_IM='\"\r\nDYNIX(R) V3.0.17 (%h) (%t)\r\n\r\r\n\r\"' \ " \ - INCLUDES=${KRB_INC}" -I.." \ + INCLUDES="-I.." \ LIB_OBJ="getent.o strchr.o strrchr.o strdup.o strerror.o \ setsid.o strftime.o mem.o" \ LIB_SRC="getent.c strchr.c strrchr.c strdup.c strerror.c \ @@ -503,16 +661,18 @@ dynix3.0.17: CC="${CC}" LCCFLAGS="-O" ultrix3.1: + @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-DTERMCAP -DKLUDGELINEMODE \ - -DDIAGNOSTICS -DUSE_TERMIO \ + -DNO_LOGIN_F -DNO_LOGIN_P -DNO_LOGIN_H \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON -DUSE_TERMIO \ -DDEFAULT_IM='\"\r\nULTRIX V3.1 (%h) (%t)\r\n\r\r\n\r\"' \ -YPOSIX" \ - INCLUDES=${KRB_INC}" -I.." \ + INCLUDES="-I.." \ LIB_OBJ="getent.o strdup.o strerror.o setenv.o \ strftime.o herror.o" \ LIB_SRC="getent.c strdup.c strerror.c setenv.c \ @@ -522,16 +682,18 @@ ultrix3.1: CC="${CC}" LCCFLAGS="-O" ultrix4.0: + @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a" \ DEST=${DESTDIR}/usr/ucb \ - DESTDIR=${DESTDIR} \ DEFINES=${ODEFS}"-DUSE_TERMIO -DTERMCAP \ -DDEFAULT_IM='\"\r\nULTRIX V4.0 (%h) (%t)\r\n\r\r\n\r\"' \ - -DKLUDGELINEMODE -DDIAGNOSTICS " \ - INCLUDES=${KRB_INC}" -I.." \ + -DKLUDGELINEMODE -DDIAGNOSTICS \ + -DNO_LOGIN_F -DNO_LOGIN_P -DNO_LOGIN_H \ + -DENV_HACK -DOLD_ENVIRON" \ + INCLUDES="-I.." \ LIB_OBJ="getent.o strdup.o strerror.o setsid.o \ setenv.o strftime.o" \ LIB_SRC="getent.c strdup.c strerror.c setsid.c \ @@ -539,18 +701,97 @@ ultrix4.0: AR=ar ARFLAGS=cq RANLIB=ranlib \ LIBEXEC=${DESTDIR}/usr/etc \ CC="${CC}" LCCFLAGS="-O" + +ultrix4.1: + make -f Makefile.generic ${WHAT} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ + LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ + ../libtelnet/libtelnet.a" \ + DEST=${DESTDIR}/usr/ucb \ + DEFINES=${ODEFS}"-DUSE_TERMIO -DTERMCAP \ + -DDEFAULT_IM='\"\r\nULTRIX V4.1 (%h) (%t)\r\n\r\r\n\r\"' \ + -DKLUDGELINEMODE -DDIAGNOSTICS \ + -DNO_LOGIN_F -DNO_LOGIN_P -DNO_LOGIN_H \ + -DENV_HACK -DOLD_ENVIRON" \ + INCLUDES="-I.." \ + LIB_OBJ="getent.o strdup.o" \ + LIB_SRC="getent.c strdup.c" \ + AR=ar ARFLAGS=cq RANLIB=ranlib \ + LIBEXEC=${DESTDIR}/usr/etc \ + CC="${CC}" LCCFLAGS="-O" + +ultrix4.3: + make -f Makefile.generic ${WHAT} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a ${AUTH_LIB}" \ + LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ + ../libtelnet/libtelnet.a ${AUTH_LIBPATH}" \ + DEST=${DESTDIR}/usr/ucb \ + DEFINES=${ODEFS}"-DUSE_TERMIO -DTERMCAP \ + -DDEFAULT_IM='\"\r\nULTRIX V4.3 (%h) (%t)\r\n\r\r\n\r\"' \ + -DKLUDGELINEMODE -DDIAGNOSTICS \ + -DNO_LOGIN_F -DNO_LOGIN_P -DNO_LOGIN_H \ + -DENV_HACK -DOLD_ENVIRON ${AUTH_DEF}" \ + INCLUDES="-I.. ${AUTH_INC}" \ + LIB_OBJ="getent.o strdup.o" \ + LIB_SRC="getent.c strdup.c" \ + AR=ar ARFLAGS=cq RANLIB=ranlib \ + LIBEXEC=${DESTDIR}/usr/etc \ + CC="${CC}" LCCFLAGS="-g" + +ultrix4.3.auth: + make -f ../Config.generic `basename $@ .auth` WHAT=${WHAT} \ + AUTH_LIB="-lkrb -ldes" \ + AUTH_LIBPATH="/usr/lib/libkrb.a /usr/lib/libdes.a" \ + AUTH_DEF="-DAUTHENTICATION -DKRB4" + +irix4.0.1: + @echo $@ is untested... it may or may not work..." + make -f Makefile.generic ${WHAT} \ + LIBS="-ltermlib ../libtelnet/libtelnet.a" \ + LIBPATH="/usr/lib/libc.a /usr/lib/libtermlib.a \ + ../libtelnet/libtelnet.a" \ + DEST=${DESTDIR}/usr/bin \ + DEFINES=${ODEFS}"-Dvfork=fork -DUSE_TERMIO \ + -DDEFAULT_IM='\"\r\n\r\nIRIX System V.3 (%h) (%t)\r\n\r\r\n\r\"' \ + -DNO_LOGIN_F -DNO_LOGIN_P \ + -DDIAGNOSTICS " \ + INCLUDES="-I.." \ + LIB_OBJ="getent.o setenv.o" \ + LIB_SRC="getent.c setenv.c" \ + AR=ar ARFLAGS=cq RANLIB=NONE \ + LIBEXEC=${DESTDIR}/etc \ + CC="${CC}" LCCFLAGS="-O" + +hpux8.0: + @echo $@ is untested... it may or may not work..." + make -f Makefile.generic ${WHAT} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ + LIBPATH="/lib/libc.a /usr/lib/libtermcap.a \ + ../libtelnet/libtelnet.a" \ + DEST=${DESTDIR}/usr/bin \ + DEFINES=${ODEFS}"-Dvfork=fork -DUSE_TERMIO \ + -DDEFAULT_IM='\"\r\n\r\nHP-UX 8.0 (%h) (%t)\r\n\r\r\n\r\"' \ + -DNO_LOGIN_F -DNO_LOGIN_P -DNO_LOGIN_H \ + -DDIAGNOSTICS -DLOGIN_ARGS" \ + INCLUDES="-I.." \ + LIB_OBJ="getent.o setenv.o" \ + LIB_SRC="getent.c setenv.c" \ + AR=ar ARFLAGS=cq RANLIB=NONE \ + LIBEXEC=${DESTDIR}/etc \ + CC="${CC}" LCCFLAGS="-O" + next1.0: @echo $@ is untested... it may or may not work..." make -f Makefile.generic ${WHAT} \ - LIBS="../libtelnet/libtelnet.a -ltermcap -lsys_s "${KRB_LIBS} \ + LIBS="../libtelnet/libtelnet.a -ltermcap -lsys_s ${AUTH_LIB}" \ LIBPATH="/lib/libc.a /lib/libsys_s.a /usr/lib/libtermcap.a \ - ../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + ../libtelnet/libtelnet.a ${AUTH_LIBPATH}" \ DEST=${DESTDIR}/usr/ucb \ DEFINES=${ODEFS}"-bsd -DTERMCAP -DKLUDGELINEMODE \ -DDEFAULT_IM='\"\r\nNeXT 1.0 (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS -DNO_STRING_H \ - -Dgetenv=getenv_" \ - INCLUDES=${KRB_INC}" -I.." \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON \ + -DNO_STRING_H -Dgetenv=getenv_ ${AUTH_DEF}" \ + INCLUDES="-I.. ${AUTH_INC}" \ LIB_OBJ="strdup.o setenv.o setsid.o strftime.o \ strcasecmp.o gettytab.o" \ LIB_SRC=s"trdup.c setenv.c setsid.c strftime.c \ @@ -571,15 +812,15 @@ convex: ln -s ../../rel_usr/src/lib/libc/posix/tcsetattr.c tcsetattr.c ln -s ../../rel_usr/src/lib/libc/posix/tcgetattr.c tcgetattr.c make -f Makefile.generic ${WHAT} \ - LIBS="-ltermcap ../libtelnet/libtelnet.a "${KRB_LIBS} \ - LIBPATH="../libtelnet/libtelnet.a "${KRB_LIBPATH} \ + LIBS="-ltermcap ../libtelnet/libtelnet.a" \ + LIBPATH="../libtelnet/libtelnet.a" \ AR=ar ARFLAGS=cq RANLIB=ranlib \ LIBEXEC=${DESTDIR}/usr/etc/in.telnetd \ CC="${CC}" LCCFLAGS="-g ${OPTLEV} -Dconvex" \ DEFINES=${ODEFS}"-DUSE_TERMIO -DLINEMODE \ -DDEFAULT_IM='\"\r\nConvex (%h) (%t)\r\n\r\r\n\r\"' \ - -DDIAGNOSTICS" \ - INCLUDES=${KRB_INC}" -I.." \ + -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON" \ + INCLUDES="-I.." \ LIB_OBJ="getent.o setsid.o strftime.o \ tcsetattr.o tcgetattr.o" \ LIB_SRC="getent.c setsid.c strftime.c \ diff --git a/src/appl/telnet/README b/src/appl/telnet/README index ea079006f..29d51a392 100644 --- a/src/appl/telnet/README +++ b/src/appl/telnet/README @@ -1,27 +1,126 @@ - This is a distribution of both client and server telnet. These programs have been compiled on: telnet telnetd + BSD 4.4 x x BSD 4.3 Reno X X - UNICOS 5.1 X X - UNICOS 6.0 X X - UNICOS 6.1 X X + UNICOS 8.0 X X + UNICOS 7.C X X UNICOS 7.0 X X - SunOs 3.5 X X (no linemode in server) - SunOs 4.1 X X (no linemode in server) + UNICOS 6.1 X X + BSDI 1.0 X X + Solaris 2.2 x x (no linemode in server) + Solaris 2.3 x x (no linemode in server) + SunOs 4.1.3 X X (no linemode in server) + Ultrix 4.3 X X (no linemode in server) DYNIX V3.0.17.9 X X (no linemode in server) - Ultrix 3.1 X X (no linemode in server) - Ultrix 4.0 X X (no linemode in server) + HP-UX 8.0 x x (no linemode in server) In addition, previous versions have been compiled on the following machines, but were not available for testing this version. telnet telnetd Next1.0 X X + UNICOS 6.0 X X + UNICOS 5.1 X X UNICOS 5.0 X X SunOs 4.0.3c X X (no linemode in server) BSD 4.3 X X (no linemode in server) DYNIX V3.0.12 X X (no linemode in server) + Ultrix 3.1 X X (no linemode in server) + Ultrix 4.0 X X (no linemode in server) + SunOs 3.5 X X (no linemode in server) + +This code should work, but there are no guarantees. + +January 19, 1994 + +This is a list of some of the changes since the last tar release +of telnet/telnetd. There are probably other changes that aren't +listed here, but this should hit a lot of the main ones. + + General: + Changed #define for AUTHENTICATE to AUTHENTICATION + Changed #define for ENCRYPT to ENCRYPTION + Changed #define for DES_ENCRYPT to DES_ENCRYPTION + + Added support for SPX authentication: -DSPX + + Added support for Kerberos Version 5 authentication: -DKRB5 + + Added support for ANSI C function prototypes + + Added support for the NEW-ENVIRON option (RFC-1572) + including support for USERVAR. + + Made support for the old Environment Option (RFC-1408) + conditional on -DOLD_ENVIRON + + Added #define ENV_HACK - support for RFC 1571 + + The encryption code is removed from the public distributions. + Domestic 4.4 BSD distributions contain the encryption code. + + ENV_HACK: Code to deal with systems that only implement + the old ENVIRON option, and have reversed definitions + of ENV_VAR and ENV_VAL. Also fixes ENV processing in + client to handle things besides just the default set... + + NO_BSD_SETJMP: UNICOS configuration for + UNICOS 6.1/6.0/5.1/5.0 systems. + + STREAMSPTY: Use /dev/ptmx to get a clean pty. This + is for SVr4 derivatives (Like Solaris) + + UTMPX: For systems that have /etc/utmpx. This is for + SVr4 derivatives (Like Solaris) + + Definitions for BSDI 1.0 + + Definitions for 4.3 Reno and 4.4 BSD. + + Definitions for UNICOS 8.0 and UNICOS 7.C + + Definitions for Solaris 2.0 + + Definitions for HP-UX 8.0 + + Latest Copyright notices from Berkeley. + + FLOW-CONTROL: support for RFC-XXXx + + + Client Specific: + + Fix the "send" command to not send garbage... + + Fix status message for "skiprc" + + Make sure to send NAWS after telnet has been suspended + or an external command has been run, if the window size + has changed. + + sysV88 support. + + Server Specific: + + Support flowcontrol option in non-linemode servers. + + -k Server supports Kludge Linemode, but will default to + either single character mode or real Linemode support. + The user will have to explicitly ask to switch into + kludge linemode. ("stty extproc", or escape back to + to telnet and say "mode line".) + + -u Specify the length of the hostname field in the utmp + file. Hostname longer than this length will be put + into the utmp file in dotted decimal notation, rather + than putting in a truncated hostname. + + -U Registered hosts only. If a reverse hostname lookup + fails, the connection will be refused. + + -f/-F + Allows forwarding of credentials for KRB5. Februrary 22, 1991: @@ -490,14 +589,6 @@ telnet: This directory contains the client code. No kernel changes are needed to use this code. -telnet/tmac.an: -telnet/tmac.an.old: -telnet/tmac.andoc: - Macros for use in formatting the telnet/telnet.1 man page - on non-4.3Reno systems. Just use the tmac.an, it includes - the other two. Also, these macros work with nroff and - ditroff, but not troff... - telnetd: This directory contains the server code. If LINEMODE or KLUDGELINEMODE are defined, then the kernel modifications listed above are needed. @@ -581,7 +672,7 @@ The following TELNET options are supported: but the definitions for the specific authentication schemes is still in a state of flux. - ENCRYPT: + 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, diff --git a/src/appl/telnet/arpa/telnet.h b/src/appl/telnet/arpa/telnet.h index 868be82b1..11e5a2345 100644 --- a/src/appl/telnet/arpa/telnet.h +++ b/src/appl/telnet/arpa/telnet.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)telnet.h 5.15 (Berkeley) 12/18/92 + * @(#)telnet.h 8.1 (Berkeley) 6/2/93 */ #ifndef _TELNET_H_ @@ -74,7 +74,8 @@ extern char *telcmds[]; #define TELCMD_FIRST xEOF #define TELCMD_LAST IAC -#define TELCMD_OK(x) ((x) <= TELCMD_LAST && (x) >= TELCMD_FIRST) +#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \ + (unsigned int)(x) >= TELCMD_FIRST) #define TELCMD(x) telcmds[(x)-TELCMD_FIRST] /* telnet options */ @@ -114,13 +115,14 @@ extern char *telcmds[]; #define TELOPT_LFLOW 33 /* remote flow control */ #define TELOPT_LINEMODE 34 /* Linemode option */ #define TELOPT_XDISPLOC 35 /* X Display Location */ -#define TELOPT_ENVIRON 36 /* Environment variables */ +#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */ #define TELOPT_AUTHENTICATION 37/* Authenticate */ #define TELOPT_ENCRYPT 38 /* Encryption option */ +#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */ #define TELOPT_EXOPL 255 /* extended-options-list */ -#define NTELOPTS (1+TELOPT_ENCRYPT) +#define NTELOPTS (1+TELOPT_NEW_ENVIRON) #ifdef TELOPTS char *telopts[NTELOPTS+1] = { "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", @@ -131,13 +133,13 @@ char *telopts[NTELOPTS+1] = { "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD", "TACACS UID", "OUTPUT MARKING", "TTYLOC", "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW", - "LINEMODE", "XDISPLOC", "ENVIRON", "AUTHENTICATION", - "ENCRYPT", + "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION", + "ENCRYPT", "NEW-ENVIRON", 0, }; #define TELOPT_FIRST TELOPT_BINARY -#define TELOPT_LAST TELOPT_ENCRYPT -#define TELOPT_OK(x) ((x) <= TELOPT_LAST && (x) >= TELOPT_FIRST) +#define TELOPT_LAST TELOPT_NEW_ENVIRON +#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST) #define TELOPT(x) telopts[(x)-TELOPT_FIRST] #endif @@ -213,7 +215,7 @@ extern char *slc_names[]; #define SLC_NAMES SLC_NAMELIST #endif -#define SLC_NAME_OK(x) ((x) >= 0 && (x) <= NSLC) +#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC) #define SLC_NAME(x) slc_names[x] #define SLC_NOSUPPORT 0 @@ -230,8 +232,10 @@ extern char *slc_names[]; #define SLC_FLUSHIN 0x40 #define SLC_FLUSHOUT 0x20 -#define ENV_VALUE 0 -#define ENV_VAR 1 +#define OLD_ENV_VAR 1 +#define OLD_ENV_VALUE 0 +#define NEW_ENV_VAR 0 +#define NEW_ENV_VALUE 1 #define ENV_ESC 2 #define ENV_USERVAR 3 @@ -270,7 +274,7 @@ char *authtype_names[] = { extern char *authtype_names[]; #endif -#define AUTHTYPE_NAME_OK(x) ((x) >= 0 && (x) < AUTHTYPE_CNT) +#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT) #define AUTHTYPE_NAME(x) authtype_names[x] /* @@ -307,10 +311,10 @@ extern char *enctype_names[]; #endif -#define ENCRYPT_NAME_OK(x) ((x) >= 0 && (x) < ENCRYPT_CNT) +#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT) #define ENCRYPT_NAME(x) encrypt_names[x] -#define ENCTYPE_NAME_OK(x) ((x) >= 0 && (x) < ENCTYPE_CNT) +#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT) #define ENCTYPE_NAME(x) enctype_names[x] #endif /* !_TELNET_H_ */ diff --git a/src/appl/telnet/libtelnet/Imakefile b/src/appl/telnet/libtelnet/Imakefile index fcffba7f2..94e5b2cdb 100644 --- a/src/appl/telnet/libtelnet/Imakefile +++ b/src/appl/telnet/libtelnet/Imakefile @@ -23,18 +23,37 @@ # Everything happens in ../Makefile.config and Makefile.generic # +AUTH_DEF=-DAUTHENTICATION -DKRB5 -DFORWARD -DLOGIN_CAP_F -DLOGIN_PROGRAM=KRB5_PATH_LOGIN +AUTH_INC=-I../../../include +AUTH_LIB=$(KLIB) +AUTH_LIBPATH=$(DEPKLIB); + all: @-if [ -f ../Config.local ]; \ then \ echo make -f ../Config.local WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)"; \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)"; \ make -f ../Config.local WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)"; \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)"; \ else \ echo make -f ../Config.generic WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)" $(TELNET_OPSYS); \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)" \ + $(TELNET_OPSYS); \ make -f ../Config.generic WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)" $(TELNET_OPSYS); \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)" \ + $(TELNET_OPSYS); \ fi Makefiles:: diff --git a/src/appl/telnet/libtelnet/Makefile.4.4 b/src/appl/telnet/libtelnet/Makefile.4.4 index 47f7022c6..495dd73c5 100644 --- a/src/appl/telnet/libtelnet/Makefile.4.4 +++ b/src/appl/telnet/libtelnet/Makefile.4.4 @@ -1,19 +1,33 @@ -# -# Copyright (c) 1991 The Regents of the University of California. -# All rights reserved. -# -# %sccs.include.redist.sh -# -# @(#)Makefile 5.3 (Berkeley) 3/22/91 -# +# @(#)Makefile 8.2 (Berkeley) 12/15/93 LIB= telnet -SRCS= auth.c encrypt.c genget.c getent.c gettytab.c misc.c +SRCS= auth.c encrypt.c genget.c getent.c misc.c SRCS+= kerberos.c enc_des.c #SRCS+= kerberos5.c -CFLAGS+= -DENCRYPTION -DAUTHENTICATION +CFLAGS+= -DENCRYPTION -DAUTHENTICATION -DHAS_CGETENT CFLAGS+= -DKRB4 -DDES_ENCRYPTION -I/usr/include/kerberosIV -.PATH: ${.CURDIR}/../../libexec/getty +# These are the sources that have encryption stuff in them. +CRYPT_SRC= auth.c enc-proto.h enc_des.c encrypt.c +CRYPT_SRC+= encrypt.h kerberos.c kerberos5.c krb4encpwd.c +CRYPT_SRC+= misc.c spx.c Makefile +NOCRYPT_DIR=${.CURDIR}/Nocrypt + .include +nocrypt: +#ifdef ENCRYPTION + @for i in ${CRYPT_SRC}; do \ + if [ ! -d ${NOCRYPT_DIR} ]; then \ + echo Creating subdirectory ${NOCRYPT_DIR}; \ + mkdir ${NOCRYPT_DIR}; \ + fi; \ + echo ${NOCRYPT_DIR}/$$i; \ + unifdef -UENCRYPTION ${.CURDIR}/$$i | \ + sed "s/ || defined(ENCRYPTION)//" > ${NOCRYPT_DIR}/$$i; \ + done + +placeholder: +#else /* ENCRYPTION */ + @echo "Encryption code already removed." +#endif /* ENCRYPTION */ diff --git a/src/appl/telnet/libtelnet/Makefile.generic b/src/appl/telnet/libtelnet/Makefile.generic index 3979901e6..760417f17 100644 --- a/src/appl/telnet/libtelnet/Makefile.generic +++ b/src/appl/telnet/libtelnet/Makefile.generic @@ -21,14 +21,15 @@ LIB= libtelnet.a SRCS= auth.c encrypt.c genget.c \ - misc.c enc_des.c \ + misc.c kerberos.c kerberos5.c forward.c spx.c enc_des.c \ + rsaencpwd.c krb4encpwd.c read_password.c \ setenv.c getent.c strdup.c strcasecmp.c \ strchr.c strrchr.c strftime.c strerror.c \ - kerberos5.c forward.c \ ${LIB_SRC} OBJS= auth.o encrypt.o genget.o \ - misc.o enc_des.o kerberos5.o forward.o \ + misc.o kerberos.o kerberos5.o forward.o spx.o enc_des.o \ + rsaencpwd.o krb4encpwd.o read_password.o \ ${LIB_OBJ} TELNET_H= ../arpa/telnet.h @@ -41,8 +42,6 @@ ${LIB}: ${OBJS} @if [ ${RANLIB} != NONE ]; \ then echo ${RANLIB} ${LIB}; ${RANLIB} ${LIB}; fi -install: - clean cleandir: rm -f *.o ${LIB} core a.out diff --git a/src/appl/telnet/libtelnet/Makefile.orig b/src/appl/telnet/libtelnet/Makefile.orig index 0e5389ac3..46597306c 100644 --- a/src/appl/telnet/libtelnet/Makefile.orig +++ b/src/appl/telnet/libtelnet/Makefile.orig @@ -22,9 +22,10 @@ # # Everything happens in ../Makefile.config and Makefile.generic # +SHELL=/bin/sh all: - @-if [ -f ../Config.local ]; \ + @-if test -f ../Config.local; \ then \ echo make -f ../Config.local WHAT=${WHAT} CC="${CC}"; \ make -f ../Config.local WHAT=${WHAT} CC="${CC}"; \ @@ -34,7 +35,7 @@ all: fi .DEFAULT: - @-if [ -f ../Config.local ]; \ + @-if test -f ../Config.local; \ then \ echo make -f ../Config.local WHAT=${WHAT} CC="${CC}" $@; \ make -f ../Config.local WHAT=${WHAT} CC="${CC}" $@; \ diff --git a/src/appl/telnet/libtelnet/auth-proto.h b/src/appl/telnet/libtelnet/auth-proto.h index 0d3816783..b93c9c266 100644 --- a/src/appl/telnet/libtelnet/auth-proto.h +++ b/src/appl/telnet/libtelnet/auth-proto.h @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)auth-proto.h 5.3 (Berkeley) 12/18/92 + * @(#)auth-proto.h 8.1 (Berkeley) 6/4/93 */ /* @@ -92,6 +92,5 @@ void kerberos5_is P((Authenticator *, unsigned char *, int)); void kerberos5_reply P((Authenticator *, unsigned char *, int)); int kerberos5_status P((Authenticator *, char *, int)); void kerberos5_printsub P((unsigned char *, int, unsigned char *, int)); -void kerberos5_forward P((Authenticator *)); #endif #endif diff --git a/src/appl/telnet/libtelnet/auth.c b/src/appl/telnet/libtelnet/auth.c index 9883f44e1..fc92b2bf4 100644 --- a/src/appl/telnet/libtelnet/auth.c +++ b/src/appl/telnet/libtelnet/auth.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,13 +32,13 @@ */ #ifndef lint -static char sccsid[] = "@(#)auth.c 5.3 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)auth.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ /* * Copyright (C) 1990 by the Massachusetts Institute of Technology * - * Export of this software from the United States of America may + * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. @@ -136,7 +136,7 @@ Authenticator authenticators[] = { kerberos5_reply, kerberos5_status, kerberos5_printsub }, -# endif +# endif /* ENCRYPTION */ { AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY, kerberos5_init, kerberos5_send, @@ -154,7 +154,7 @@ Authenticator authenticators[] = { kerberos4_reply, kerberos4_status, kerberos4_printsub }, -# endif +# endif /* ENCRYPTION */ { AUTHTYPE_KERBEROS_V4, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY, kerberos4_init, kerberos4_send, diff --git a/src/appl/telnet/libtelnet/auth.h b/src/appl/telnet/libtelnet/auth.h index c071f4671..2ced2c9ae 100644 --- a/src/appl/telnet/libtelnet/auth.h +++ b/src/appl/telnet/libtelnet/auth.h @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)auth.h 5.1 (Berkeley) 2/28/91 + * @(#)auth.h 8.1 (Berkeley) 6/4/93 */ /* diff --git a/src/appl/telnet/libtelnet/enc-proto.h b/src/appl/telnet/libtelnet/enc-proto.h index ebefaf152..d5f31d607 100644 --- a/src/appl/telnet/libtelnet/enc-proto.h +++ b/src/appl/telnet/libtelnet/enc-proto.h @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)enc-proto.h 5.3 (Berkeley) 12/18/92 + * @(#)enc-proto.h 8.1 (Berkeley) 6/4/93 */ /* @@ -60,7 +60,7 @@ #endif #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION void encrypt_init P((char *, int)); Encryptions *findencryption P((int)); void encrypt_send_supprt P((void)); @@ -122,4 +122,4 @@ void des_set_random_generator_seed P((Block)); void des_key_sched P((Block, Schedule)); void des_ecb_encrypt P((Block, Block, Schedule, int)); int des_string_to_key P((char *, Block)); -#endif +#endif /* ENCRYPTION */ diff --git a/src/appl/telnet/libtelnet/enc_des.c b/src/appl/telnet/libtelnet/enc_des.c index f7a9f7789..8e7b44dd3 100644 --- a/src/appl/telnet/libtelnet/enc_des.c +++ b/src/appl/telnet/libtelnet/enc_des.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,10 +32,12 @@ */ #ifndef lint -static char sccsid[] = "@(#)enc_des.c 5.2 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)enc_des.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ -#if defined(AUTHENTICATION) && defined(ENCRYPTION) && defined(DES_ENCRYPTION) +#ifdef ENCRYPTION +# ifdef AUTHENTICATION +# ifdef DES_ENCRYPTION #include #include #ifdef __STDC__ @@ -110,10 +112,10 @@ struct keyidlist { void fb64_stream_iv P((Block, struct stinfo *)); void fb64_init P((struct fb *)); -int fb64_start P((struct fb *, int, int)); +static int fb64_start P((struct fb *, int, int)); int fb64_is P((unsigned char *, int, struct fb *)); int fb64_reply P((unsigned char *, int, struct fb *)); -void fb64_session P((Session_Key *, int, struct fb *)); +static void fb64_session P((Session_Key *, int, struct fb *)); void fb64_stream_key P((Block, struct stinfo *)); int fb64_keyid P((int, unsigned char *, int *, struct fb *)); @@ -368,7 +370,7 @@ fb64_reply(data, cnt, fbp) if (state == FAILED) state = IN_PROGRESS; state &= ~NO_RECV_IV; - encrypt_send_keyid(DIR_ENCRYPT, "\0", 1, 1); + encrypt_send_keyid(DIR_ENCRYPT, (unsigned char *)"\0", 1, 1); break; case FB64_IV_BAD: @@ -717,4 +719,6 @@ ofb64_decrypt(data) return(data ^ stp->str_feed[index]); } -#endif +# endif /* DES_ENCRYPTION */ +# endif /* AUTHENTICATION */ +#endif /* ENCRYPTION */ diff --git a/src/appl/telnet/libtelnet/encrypt.c b/src/appl/telnet/libtelnet/encrypt.c index 914b8be17..b03d2a86f 100644 --- a/src/appl/telnet/libtelnet/encrypt.c +++ b/src/appl/telnet/libtelnet/encrypt.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)encrypt.c 5.3 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)encrypt.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ /* @@ -55,7 +55,7 @@ static char sccsid[] = "@(#)encrypt.c 5.3 (Berkeley) 12/18/92"; * or implied warranty. */ -#if defined(ENCRYPTION) +#ifdef ENCRYPTION #define ENCRYPT_NAMES #include @@ -104,7 +104,7 @@ static long remote_supports_encrypt = 0; static long remote_supports_decrypt = 0; static Encryptions encryptions[] = { -#if defined(DES_ENCRYPTION) +#ifdef DES_ENCRYPTION { "DES_CFB64", ENCTYPE_DES_CFB64, cfb64_encrypt, cfb64_decrypt, @@ -125,7 +125,7 @@ static Encryptions encryptions[] = { ofb64_session, ofb64_keyid, ofb64_printsub }, -#endif +#endif /* DES_ENCRYPTION */ { 0, }, }; @@ -996,4 +996,4 @@ encrypt_printsub(data, cnt, buf, buflen) else encrypt_gen_printsub(data, cnt, buf, buflen); } -#endif +#endif /* ENCRYPTION */ diff --git a/src/appl/telnet/libtelnet/encrypt.h b/src/appl/telnet/libtelnet/encrypt.h index 0999189e9..79ab0f41e 100644 --- a/src/appl/telnet/libtelnet/encrypt.h +++ b/src/appl/telnet/libtelnet/encrypt.h @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)encrypt.h 5.3 (Berkeley) 12/18/92 + * @(#)encrypt.h 8.1 (Berkeley) 6/4/93 */ /* @@ -53,8 +53,9 @@ * or implied warranty. */ -#ifndef __ENCRYPTION__ -#define __ENCRYPTION__ +#ifdef ENCRYPTION +# ifndef __ENCRYPTION__ +# define __ENCRYPTION__ #define DIR_DECRYPT 1 #define DIR_ENCRYPT 2 @@ -74,13 +75,13 @@ typedef struct { unsigned char *data; } Session_Key; -#if !defined(P) -#ifdef __STDC__ -#define P(x) x -#else -#define P(x) () -#endif -#endif +# if !defined(P) +# ifdef __STDC__ +# define P(x) x +# else +# define P(x) () +# endif +# endif typedef struct { char *name; @@ -103,4 +104,5 @@ typedef struct { extern int encrypt_debug_mode; extern int (*decrypt_input) P((int)); extern void (*encrypt_output) P((unsigned char *, int)); -#endif +# endif /* __ENCRYPTION__ */ +#endif /* ENCRYPTION */ diff --git a/src/appl/telnet/libtelnet/forward.c b/src/appl/telnet/libtelnet/forward.c index c8f9c505a..8ae34edba 100644 --- a/src/appl/telnet/libtelnet/forward.c +++ b/src/appl/telnet/libtelnet/forward.c @@ -30,7 +30,7 @@ static char *rcsid_forward_c = /* General-purpose forwarding routines. These routines may be put into */ /* libkrb5.a to allow widespread use */ -#if defined(KERBEROS) || defined(KRB5) +#if defined(KRB5) && defined(FORWARD) #include #include #include @@ -613,4 +613,4 @@ const krb5_address *recv_addr; /* optional */ #undef cleanup_mesg } -#endif /* KERBEROS */ +#endif /* defined(KRB5) && defined(FORWARD) */ diff --git a/src/appl/telnet/libtelnet/genget.c b/src/appl/telnet/libtelnet/genget.c index 5c4b836e8..a43579f82 100644 --- a/src/appl/telnet/libtelnet/genget.c +++ b/src/appl/telnet/libtelnet/genget.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)genget.c 5.1 (Berkeley) 2/28/91"; +static char sccsid[] = "@(#)genget.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ diff --git a/src/appl/telnet/libtelnet/getent.c b/src/appl/telnet/libtelnet/getent.c index 566a41e5a..4b2aeb2d7 100644 --- a/src/appl/telnet/libtelnet/getent.c +++ b/src/appl/telnet/libtelnet/getent.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,22 +32,37 @@ */ #ifndef lint -static char sccsid[] = "@(#)getent.c 5.3 (Berkeley) 1/20/93"; +static char sccsid[] = "@(#)getent.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ +static char *area; + /*ARGSUSED*/ getent(cp, name) char *cp, *name; { +#ifdef HAS_CGETENT + char *dba[2]; + + dba[0] = "/etc/gettytab"; + dba[1] = 0; + return((cgetent(&area, dba, name) == 0) ? 1 : 0); +#else return(0); +#endif } -#ifndef __svr4__ +#ifndef SOLARIS /*ARGSUSED*/ char * -getstr(cp, cpp) -char *cp, **cpp; +getstr(id, cpp) +char *id, **cpp; { +# ifdef HAS_CGETENT + char *answer; + return((cgetstr(area, id, &answer) > 0) ? answer : 0); +# else return(0); +# endif } #endif diff --git a/src/appl/telnet/libtelnet/getopt.c b/src/appl/telnet/libtelnet/getopt.c index 8c2399154..78054144e 100644 --- a/src/appl/telnet/libtelnet/getopt.c +++ b/src/appl/telnet/libtelnet/getopt.c @@ -1,48 +1,72 @@ /* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getopt.c 4.12 (Berkeley) 6/1/90"; +static char sccsid[] = "@(#)getopt.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#ifndef __STDC__ +#define const +#endif #include +#include +#include /* * get option letter from argument vector */ int opterr = 1, /* if error message should be printed */ optind = 1, /* index into parent argv vector */ - optopt; /* character checked for validity */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ char *optarg; /* argument associated with option */ #define BADCH (int)'?' +#define BADARG (int)':' #define EMSG "" +int getopt(nargc, nargv, ostr) int nargc; - char **nargv, *ostr; + char * const *nargv; + const char *ostr; { static char *place = EMSG; /* option letter processing */ register char *oli; /* option letter list index */ - char *p, *index(), *rindex(); + char *p; - if (!*place) { /* update scanning pointer */ + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; if (optind >= nargc || *(place = nargv[optind]) != '-') { place = EMSG; return(EOF); @@ -63,7 +87,7 @@ getopt(nargc, nargv, ostr) return(EOF); if (!*place) ++optind; - if (opterr) { + if (opterr && *ostr != ':') { if (!(p = rindex(*nargv, '/'))) p = *nargv; else @@ -87,6 +111,8 @@ getopt(nargc, nargv, ostr) p = *nargv; else ++p; + if (*ostr == ':') + return(BADARG); if (opterr) (void)fprintf(stderr, "%s: option requires an argument -- %c\n", diff --git a/src/appl/telnet/libtelnet/herror.c b/src/appl/telnet/libtelnet/herror.c index f724c47e8..d5301f22b 100644 --- a/src/appl/telnet/libtelnet/herror.c +++ b/src/appl/telnet/libtelnet/herror.c @@ -1,22 +1,40 @@ /* - * Copyright (c) 1988, 1990 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * Neither the name of the University nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ + #include char *h_errlist[] = { diff --git a/src/appl/telnet/libtelnet/kerberos.c b/src/appl/telnet/libtelnet/kerberos.c index 4393d2e3a..57a58b41f 100644 --- a/src/appl/telnet/libtelnet/kerberos.c +++ b/src/appl/telnet/libtelnet/kerberos.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)kerberos.c 5.3 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)kerberos.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ /* @@ -100,11 +100,11 @@ static unsigned char str_name[1024] = { IAC, SB, TELOPT_AUTHENTICATION, static KTEXT_ST auth; static char name[ANAME_SZ]; static AUTH_DAT adat = { 0 }; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION static Block session_key = { 0 }; static Schedule sched; static Block challenge = { 0 }; -#endif +#endif /* ENCRYPTION */ static int Data(ap, type, d, c) @@ -167,7 +167,9 @@ kerberos4_send(ap) Authenticator *ap; { KTEXT_ST auth; +#ifdef ENCRYPTION Block enckey; +#endif /* ENCRYPTION */ char instance[INST_SZ]; char *realm; char *krb_realmofhost(); @@ -216,7 +218,7 @@ kerberos4_send(ap) printf("Not enough room for authentication data\r\n"); return(0); } -#if defined(ENCRYPTION) +#ifdef ENCRYPTION /* * If we are doing mutual authentication, get set up to send * the challenge, and verify it when the response comes back. @@ -241,7 +243,7 @@ kerberos4_send(ap) } des_ecb_encrypt(challenge, challenge, sched, 1); } -#endif +#endif /* ENCRYPTION */ if (auth_debug_mode) { printf("CK: %d:", kerberos4_cksum(auth.dat, auth.length)); @@ -258,8 +260,10 @@ kerberos4_is(ap, data, cnt) unsigned char *data; int cnt; { +#ifdef ENCRYPTION Session_Key skey; Block datablock; +#endif /* ENCRYPTION */ char realm[REALM_SZ]; char instance[INST_SZ]; int r; @@ -293,7 +297,7 @@ kerberos4_is(ap, data, cnt) } #ifdef ENCRYPTION bcopy((void *)adat.session, (void *)session_key, sizeof(Block)); -#endif +#endif /* ENCRYPTION */ krb_kntoln(&adat, name); if (UserNameRequested && !kuserok(&adat, UserNameRequested)) @@ -305,9 +309,9 @@ kerberos4_is(ap, data, cnt) break; case KRB_CHALLENGE: -#if !defined(ENCRYPTION) +#ifndef ENCRYPTION Data(ap, KRB_RESPONSE, (void *)0, 0); -#else +#else /* ENCRYPTION */ if (!VALIDKEY(session_key)) { /* * We don't have a valid session key, so just @@ -344,7 +348,7 @@ kerberos4_is(ap, data, cnt) } des_ecb_encrypt(challenge, challenge, sched, 1); Data(ap, KRB_RESPONSE, (void *)challenge, sizeof(challenge)); -#endif +#endif /* ENCRYPTION */ break; default: @@ -361,7 +365,9 @@ kerberos4_reply(ap, data, cnt) unsigned char *data; int cnt; { +#ifdef ENCRYPTION Session_Key skey; +#endif /* ENCRYPTION */ if (cnt-- < 1) return; @@ -380,9 +386,9 @@ kerberos4_reply(ap, data, cnt) /* * Send over the encrypted challenge. */ -#if !defined(ENCRYPTION) +#ifndef ENCRYPTION Data(ap, KRB_CHALLENGE, (void *)0, 0); -#else +#else /* ENCRYPTION */ Data(ap, KRB_CHALLENGE, (void *)session_key, sizeof(session_key)); des_ecb_encrypt(session_key, session_key, sched, 1); @@ -390,13 +396,13 @@ kerberos4_reply(ap, data, cnt) skey.length = 8; skey.data = session_key; encrypt_session_key(&skey, 0); -#endif +#endif /* ENCRYPTION */ return; } auth_finished(ap, AUTH_USER); return; case KRB_RESPONSE: -#if defined(ENCRYPTION) +#ifdef ENCRYPTION /* * Verify that the response to the challenge is correct. */ @@ -404,15 +410,15 @@ kerberos4_reply(ap, data, cnt) (0 != memcmp((void *)data, (void *)challenge, sizeof(challenge)))) { -#endif +#endif /* ENCRYPTION */ printf("[ Kerberos V4 challenge failed!!! ]\r\n"); auth_send_retry(); return; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION } printf("[ Kerberos V4 challenge successful ]\r\n"); auth_finished(ap, AUTH_USER); -#endif +#endif /* ENCRYPTION */ break; default: if (auth_debug_mode) diff --git a/src/appl/telnet/libtelnet/kerberos5.c b/src/appl/telnet/libtelnet/kerberos5.c index 8021787e8..19f675ccc 100644 --- a/src/appl/telnet/libtelnet/kerberos5.c +++ b/src/appl/telnet/libtelnet/kerberos5.c @@ -82,8 +82,6 @@ static char sccsid[] = "@(#)kerberos5.c 8.1 (Berkeley) 6/4/93"; #include #include -#define FORWARD /* Do credentials forwarding.... */ - /* kerberos 5 include files (ext-proto.h) will get an appropriate stdlib.h and string.h/strings.h */ @@ -132,7 +130,7 @@ static krb5_authenticator authenticator; #define Voidptr krb5_pointer -Block session_key; +krb5_keyblock session_key; static int Data(ap, type, d, c) @@ -178,6 +176,7 @@ kerberos5_init(ap, server) str_data[3] = TELQUAL_REPLY; else str_data[3] = TELQUAL_IS; + memset(&session_key, 0, sizeof(session_key)); krb5_init_ets(); return(1); } @@ -240,7 +239,8 @@ kerberos5_send(ap) if (r = krb5_get_credentials(krb5_kdc_default_options, ccache, &creds)) { if (auth_debug_mode) { - printf("Kerberos V5: failure on credentials(%d)\r\n",r); + printf("Kerberos V5: failure on credentials(%s)\r\n", + error_message(r)); } krb5_free_cred_contents(&creds); return(0); @@ -262,19 +262,19 @@ kerberos5_send(ap) authenticator.subkey = 0; #ifdef ENCRYPTION + if (session_key.contents) + free(session_key.contents); if (newkey) { /* keep the key in our private storage, but don't use it yet---see kerberos5_reply() below */ if (newkey->keytype != KEYTYPE_DES) { if (creds.keyblock.keytype == KEYTYPE_DES) /* use the session key in credentials instead */ - memcpy((char *)session_key, - (char *)creds.keyblock.contents, sizeof(Block)); + krb5_copy_keyblocks_contents(&creds, &session_key); else /* XXX ? */; } else { - memcpy((char *)session_key, (char *)newkey->contents, - sizeof(Block)); + krb5_copy_keyblocks_contents(newkey, &session_key); } krb5_free_keyblock(newkey); } @@ -385,19 +385,23 @@ kerberos5_is(ap, data, cnt) free(name); if (authdat->authenticator->subkey && authdat->authenticator->subkey->keytype == KEYTYPE_DES) { - bcopy((Voidptr )authdat->authenticator->subkey->contents, - (Voidptr )session_key, sizeof(Block)); + if (session_key.contents) + free(session_key.contents); + krb5_copy_keyblock_contents(authdat->authenticator->subkey, + &session_key); } else if (authdat->ticket->enc_part2->session->keytype == KEYTYPE_DES) { - bcopy((Voidptr )authdat->ticket->enc_part2->session->contents, - (Voidptr )session_key, sizeof(Block)); + if (session_key.contents) + free(session_key.contents); + krb5_copy_keyblock_contents(authdat->ticket->enc_part2->session, + &session_key); } else break; #ifdef ENCRYPTION skey.type = SK_DES; skey.length = 8; - skey.data = session_key; + skey.data = session_key.contents; encrypt_session_key(&skey, 1); #endif break; @@ -435,7 +439,9 @@ kerberos5_reply(ap, data, cnt) unsigned char *data; int cnt; { +#ifdef ENCRYPTION Session_Key skey; +#endif static int mutual_complete = 0; if (cnt-- < 1) @@ -472,16 +478,17 @@ kerberos5_reply(ap, data, cnt) krb5_ap_rep_enc_part *reply; krb5_data inbuf; krb5_error_code r; - krb5_keyblock tmpkey; inbuf.length = cnt; inbuf.data = (char *)data; - tmpkey.keytype = KEYTYPE_DES; - tmpkey.contents = session_key; - tmpkey.length = sizeof(Block); - - if (r = krb5_rd_rep(&inbuf, &tmpkey, &reply)) { + if (!session_key.contents) { + printf("[ Mutual authentication failed: no session key ]\n"); + auth_send_retry(); + return; + } + + if (r = krb5_rd_rep(&inbuf, &session_key, &reply)) { printf("[ Mutual authentication failed: %s ]\n", error_message(r)); auth_send_retry(); @@ -497,7 +504,7 @@ kerberos5_reply(ap, data, cnt) #ifdef ENCRYPTION skey.type = SK_DES; skey.length = 8; - skey.data = session_key; + skey.data = session_key.contents; encrypt_session_key(&skey, 0); #endif /* ENCRYPTION */ mutual_complete = 1; @@ -627,7 +634,7 @@ kerberos5_forward(ap) return; } - if (r = krb5_sname_to_principal(RemoteHostName, "host", 1, + if (r = krb5_sname_to_principal(RemoteHostName, "host", KRB5_NT_SRV_HST, &local_creds->server)) { if (auth_debug_mode) printf("Kerberos V5: could not build server name - %s\r\n", diff --git a/src/appl/telnet/libtelnet/key-proto.h b/src/appl/telnet/libtelnet/key-proto.h index f12175f10..ffaeb86fa 100644 --- a/src/appl/telnet/libtelnet/key-proto.h +++ b/src/appl/telnet/libtelnet/key-proto.h @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)key-proto.h 5.1 (Berkeley) 2/28/91 + * @(#)key-proto.h 8.1 (Berkeley) 6/4/93 */ /* diff --git a/src/appl/telnet/libtelnet/krb4encpwd.c b/src/appl/telnet/libtelnet/krb4encpwd.c index fdbb26a5c..93cbe9535 100644 --- a/src/appl/telnet/libtelnet/krb4encpwd.c +++ b/src/appl/telnet/libtelnet/krb4encpwd.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1992 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)krb4encpwd.c 5.1 (Berkeley) 1/20/93"; +static char sccsid[] = "@(#)krb4encpwd.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ @@ -112,9 +112,9 @@ static KTEXT_ST auth; static char name[ANAME_SZ]; static char user_passwd[ANAME_SZ]; static AUTH_DAT adat = { 0 }; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION static Block session_key = { 0 }; -#endif +#endif /* ENCRYPTION */ static Schedule sched; static char challenge[REALM_SZ]; @@ -255,7 +255,7 @@ krb4encpwd_is(ap, data, cnt) /* * If we are doing mutual authentication, get set up to send - * the challange, and verify it when the response comes back. + * the challenge, and verify it when the response comes back. */ if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) { diff --git a/src/appl/telnet/libtelnet/mem.c b/src/appl/telnet/libtelnet/mem.c index 644f21829..798b4823c 100644 --- a/src/appl/telnet/libtelnet/mem.c +++ b/src/appl/telnet/libtelnet/mem.c @@ -1,30 +1,44 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)memcmp.c 5.5 (Berkeley) 5/15/90"; -static char sccsid[] = "@(#)memcpy.c 5.6 (Berkeley) 5/15/90"; -static char sccsid[] = "@(#)memmove.c 5.2 (Berkeley) 5/15/90"; -static char sccsid[] = "@(#)memset.c 5.5 (Berkeley) 5/15/90"; +static char sccsid[] = "@(#)memcmp.c 8.1 (Berkeley) 6/4/93"; +static char sccsid[] = "@(#)memset.c 8.1 (Berkeley) 6/4/93"; +static char sccsid[] = "@(#)memcpy.c 8.1 (Berkeley) 6/4/93"; +static char sccsid[] = "@(#)memmove.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #ifndef __STDC__ @@ -32,6 +46,15 @@ static char sccsid[] = "@(#)memset.c 5.5 (Berkeley) 5/15/90"; #endif typedef int size_t; +#include +#include +#ifdef NO_STRING_H +#include +#else +#include +#endif +#include + /* * Compare memory regions. */ @@ -41,15 +64,14 @@ memcmp(s1, s2, n) size_t n; { if (n != 0) { - register const unsigned char *p1 = (unsigned char *)s1, - *p2 = (unsigned char *)s2; + register const unsigned char *p1 = s1, *p2 = s2; do { if (*p1++ != *p2++) - return(*--p1 - *--p2); + return (*--p1 - *--p2); } while (--n != 0); } - return(0); + return (0); } /* @@ -78,19 +100,91 @@ memmove(dst, src, length) return(dst); } +#define wsize sizeof(u_int) +#define wmask (wsize - 1) + +#ifdef BZERO +#define RETURN return +#define VAL 0 +#define WIDEVAL 0 + +void +bzero(dst0, length) + void *dst0; + register size_t length; +#else +#define RETURN return (dst0) +#define VAL c0 +#define WIDEVAL c + void * -memset(dst, c, n) - void *dst; - register int c; - register size_t n; +memset(dst0, c0, length) + void *dst0; + register int c0; + register size_t length; +#endif { + register size_t t; + register u_int c; + register u_char *dst; - if (n != 0) { - register char *d = (char *)dst; + dst = dst0; + /* + * If not enough words, just fill bytes. A length >= 2 words + * guarantees that at least one of them is `complete' after + * any necessary alignment. For instance: + * + * |-----------|-----------|-----------| + * |00|01|02|03|04|05|06|07|08|09|0A|00| + * ^---------------------^ + * dst dst+length-1 + * + * but we use a minimum of 3 here since the overhead of the code + * to do word writes is substantial. + */ + if (length < 3 * wsize) { + while (length != 0) { + *dst++ = VAL; + --length; + } + RETURN; + } - do - *d++ = c; - while (--n != 0); +#ifndef BZERO + if ((c = (u_char)c0) != 0) { /* Fill the word. */ +#ifndef UINT_MAX + UINT_MAX must be defined, try 0xFFFFFFFF; +#endif + c = (c << 8) | c; /* u_int is 16 bits. */ +#if UINT_MAX > 0xffff + c = (c << 16) | c; /* u_int is 32 bits. */ +#endif +#if UINT_MAX > 0xffffffff + c = (c << 32) | c; /* u_int is 64 bits. */ +#endif } - return(dst); +#endif + /* Align destination by filling in bytes. */ + if ((t = (int)dst & wmask) != 0) { + t = wsize - t; + length -= t; + do { + *dst++ = VAL; + } while (--t != 0); + } + + /* Fill words. Length was >= 2*words so we know t >= 1 here. */ + t = length / wsize; + do { + *(u_int *)dst = WIDEVAL; + dst += wsize; + } while (--t != 0); + + /* Mop up trailing bytes, if any. */ + t = length & wmask; + if (t != 0) + do { + *dst++ = VAL; + } while (--t != 0); + RETURN; } diff --git a/src/appl/telnet/libtelnet/misc-proto.h b/src/appl/telnet/libtelnet/misc-proto.h index 6a25f9817..ca9ae4b1b 100644 --- a/src/appl/telnet/libtelnet/misc-proto.h +++ b/src/appl/telnet/libtelnet/misc-proto.h @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)misc-proto.h 5.1 (Berkeley) 2/28/91 + * @(#)misc-proto.h 8.1 (Berkeley) 6/4/93 */ /* diff --git a/src/appl/telnet/libtelnet/misc.c b/src/appl/telnet/libtelnet/misc.c index 392626c75..9565900a3 100644 --- a/src/appl/telnet/libtelnet/misc.c +++ b/src/appl/telnet/libtelnet/misc.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)misc.c 5.3 (Berkeley) 1/20/93"; +static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ #include "misc.h" @@ -54,9 +54,9 @@ auth_encrypt_init(local, remote, name, server) #if defined(AUTHENTICATION) auth_init(name, server); #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION encrypt_init(name, server); -#endif +#endif /* ENCRYPTION */ if (UserNameRequested) { free(UserNameRequested); UserNameRequested = 0; diff --git a/src/appl/telnet/libtelnet/misc.h b/src/appl/telnet/libtelnet/misc.h index 5a23a83d3..41ffa7f67 100644 --- a/src/appl/telnet/libtelnet/misc.h +++ b/src/appl/telnet/libtelnet/misc.h @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)misc.h 5.1 (Berkeley) 2/28/91 + * @(#)misc.h 8.1 (Berkeley) 6/4/93 */ extern char *UserNameRequested; diff --git a/src/appl/telnet/libtelnet/parsetos.c b/src/appl/telnet/libtelnet/parsetos.c new file mode 100644 index 000000000..eb34ddf43 --- /dev/null +++ b/src/appl/telnet/libtelnet/parsetos.c @@ -0,0 +1,41 @@ + +/* + * The routine parsetos() for UNICOS 6.0/6.1 systems. This + * is part of UNICOS 7.0 and later. + */ +#include +#include +#include +#include + + +#define MIN_TOS 0 +#define MAX_TOS 255 + +int +parsetos(name, proto) +char *name; +char *proto; +{ + register char *c; + int tos; + struct tosent *tosp; + + tosp = gettosbyname(name, proto); + if (tosp) { + tos = tosp->t_tos; + } else { + for (c = name; *c; c++) { + if (*c < '0' || *c > '9') { + errno = EINVAL; + return (-1); + } + } + tos = (int)strtol(name, (char **)NULL, 0); + } + if (tos < MIN_TOS || tos > MAX_TOS) { + errno = ERANGE; + return (-1); + } + return (tos); +} diff --git a/src/appl/telnet/libtelnet/read_password.c b/src/appl/telnet/libtelnet/read_password.c index 914f220bf..4179ffca2 100644 --- a/src/appl/telnet/libtelnet/read_password.c +++ b/src/appl/telnet/libtelnet/read_password.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1992 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)read_password.c 5.1 (Berkeley) 1/20/93"; +static char sccsid[] = "@(#)read_password.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ /* @@ -50,6 +50,8 @@ static char sccsid[] = "@(#)read_password.c 5.1 (Berkeley) 1/20/93"; * echoing. */ +#if defined(RSA_ENCPWD) || defined(KRB4_ENCPWD) + #include #include #include @@ -140,3 +142,4 @@ lose: s[max-1] = 0; /* force termination */ return !ok; /* return nonzero if not okay */ } +#endif /* defined(RSA_ENCPWD) || defined(KRB4_ENCPWD) */ diff --git a/src/appl/telnet/libtelnet/rsaencpwd.c b/src/appl/telnet/libtelnet/rsaencpwd.c index af54bfb4f..b82cc888b 100644 --- a/src/appl/telnet/libtelnet/rsaencpwd.c +++ b/src/appl/telnet/libtelnet/rsaencpwd.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1992 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)rsaencpwd.c 5.1 (Berkeley) 1/20/93"; +static char sccsid[] = "@(#)rsaencpwd.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ @@ -252,7 +252,7 @@ rsaencpwd_is(ap, data, cnt) /* * If we are doing mutual authentication, get set up to send - * the challange, and verify it when the response comes back. + * the challenge, and verify it when the response comes back. */ if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_ONE_WAY) { register int i; diff --git a/src/appl/telnet/libtelnet/setenv.c b/src/appl/telnet/libtelnet/setenv.c index c3b0c1d63..d4fac03a8 100644 --- a/src/appl/telnet/libtelnet/setenv.c +++ b/src/appl/telnet/libtelnet/setenv.c @@ -1,81 +1,108 @@ /* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid1[] = "@(#)setenv.c 5.3 (Berkeley) 5/16/90"; -static char sccsid2[] = "@(#)getenv.c 5.6 (Berkeley) 5/16/90"; +static char sccsid1[] = "@(#)setenv.c 8.1 (Berkeley) 6/4/93"; +static char sccsid2[] = "@(#)getenv.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#ifndef __STDC__ +#define const +#endif + +#include +#include +#include + +#ifndef __P +#define __P(x) () +#endif +char *__findenv __P((const char *, int *)); + /* * setenv -- * Set the value of the environmental variable "name" to be * "value". If rewrite is set, replace any current value. */ setenv(name, value, rewrite) - register char *name, *value; + register const char *name; + register const char *value; int rewrite; { - extern char **environ, *malloc(); + extern char **environ; static int alloced; /* if allocated space before */ - register char *C; + register char *c; int l_value, offset; - static char *_findenv(); if (*value == '=') /* no `=' in value */ ++value; l_value = strlen(value); - if ((C = _findenv(name, &offset))) { /* find if already exists */ + if ((c = __findenv(name, &offset))) { /* find if already exists */ if (!rewrite) - return(0); - if (strlen(C) >= l_value) { /* old larger; copy over */ - while (*C++ = *value++); - return(0); + return (0); + if (strlen(c) >= l_value) { /* old larger; copy over */ + while (*c++ = *value++); + return (0); } - } - else { /* create new slot */ - register int cnt; - register char **P; + } else { /* create new slot */ + register int cnt; + register char **p; - for (P = environ, cnt = 0; *P; ++P, ++cnt); + for (p = environ, cnt = 0; *p; ++p, ++cnt); if (alloced) { /* just increase size */ environ = (char **)realloc((char *)environ, - (sizeof(char *) * (cnt + 2))); + (size_t)(sizeof(char *) * (cnt + 2))); if (!environ) - return(-1); + return (-1); } else { /* get new space */ alloced = 1; /* copy old entries into it */ - P = (char **)malloc((sizeof(char *) * - (cnt + 2))); - if (!P) - return(-1); - bcopy(environ, P, cnt * sizeof(char *)); - environ = P; + p = (char **)malloc((size_t)(sizeof(char *) * (cnt + 2))); + if (!p) + return (-1); + bcopy(environ, p, cnt * sizeof(char *)); + environ = p; } - environ[cnt + 1] = 0; + environ[cnt + 1] = NULL; offset = cnt; } - for (C = name; *C && *C != '='; ++C); /* no `=' in name */ + for (c = (char *)name; *c && *c != '='; ++c); /* no `=' in name */ if (!(environ[offset] = /* name + `=' + value */ - malloc(((int)(C - name) + l_value + 2)))) - return(-1); - for (C = environ[offset]; (*C = *name++) && *C != '='; ++C); - for (*C++ = '='; *C++ = *value++;); - return(0); + malloc((size_t)((int)(c - name) + l_value + 2)))) + return (-1); + for (c = environ[offset]; (*c = *name++) && *c != '='; ++c); + for (*c++ = '='; *c++ = *value++;); + return (0); } /* @@ -84,16 +111,15 @@ setenv(name, value, rewrite) */ void unsetenv(name) - char *name; + const char *name; { extern char **environ; - register char **P; + register char **p; int offset; - static char *_findenv(); - while (_findenv(name, &offset)) /* if set multiple times */ - for (P = &environ[offset];; ++P) - if (!(*P = *(P + 1))) + while (__findenv(name, &offset)) /* if set multiple times */ + for (p = &environ[offset];; ++p) + if (!(*p = *(p + 1))) break; } @@ -103,36 +129,39 @@ unsetenv(name) */ char * getenv(name) - char *name; + const char *name; { int offset; - static char *_findenv(); - return(_findenv(name, &offset)); + return (__findenv(name, &offset)); } /* - * _findenv -- + * __findenv -- * Returns pointer to value associated with name, if any, else NULL. * Sets offset to be the offset of the name/value combination in the * environmental array, for use by setenv(3) and unsetenv(3). * Explicitly removes '=' in argument name. */ static char * -_findenv(name, offset) - register char *name; +__findenv(name, offset) + register const char *name; int *offset; { extern char **environ; register int len; - register char **P, *C; + register const char *np; + register char **p, *c; - for (C = name, len = 0; *C && *C != '='; ++C, ++len); - for (P = environ; *P; ++P) - if (!strncmp(*P, name, len)) - if (*(C = *P + len) == '=') { - *offset = P - environ; - return(++C); - } - return(0); + if (name == NULL || environ == NULL) + return (NULL); + for (np = name; *np && *np != '='; ++np) + continue; + len = np - name; + for (p = environ; (c = *p) != NULL; ++p) + if (strncmp(c, name, len) == 0 && c[len] == '=') { + *offset = p - environ; + return (c + len + 1); + } + return (NULL); } diff --git a/src/appl/telnet/libtelnet/setsid.c b/src/appl/telnet/libtelnet/setsid.c index e84a0591a..14d32566f 100644 --- a/src/appl/telnet/libtelnet/setsid.c +++ b/src/appl/telnet/libtelnet/setsid.c @@ -1,25 +1,39 @@ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * Neither the name of the University nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)setsid.c 5.1 (Berkeley) 2/28/91"; -#endif /* not lint */ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setsid.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ /* * Emulate the functionality of setsid(), called when forking diff --git a/src/appl/telnet/libtelnet/spx.c b/src/appl/telnet/libtelnet/spx.c index 8479ac56a..b4634d0a7 100644 --- a/src/appl/telnet/libtelnet/spx.c +++ b/src/appl/telnet/libtelnet/spx.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1992 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)spx.c 5.1 (Berkeley) 1/20/93"; +static char sccsid[] = "@(#)spx.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ #ifdef SPX @@ -98,11 +98,11 @@ static unsigned char str_name[1024] = { IAC, SB, TELOPT_AUTHENTICATION, #define SPX_REJECT 1 /* Rejected (reason might follow) */ #define SPX_ACCEPT 2 /* Accepted */ -#if defined(ENCRYPTION) +#ifdef ENCRYPTION static Block session_key = { 0 }; -#endif +#endif /* ENCRYPTION */ static Schedule sched; -static Block challange = { 0 }; +static Block challenge = { 0 }; /*******************************************************************/ @@ -432,7 +432,7 @@ spx_reply(ap, data, cnt) printf("[ SPX accepts you ]\n"); if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) { /* - * Send over the encrypted challange. + * Send over the encrypted challenge. */ input_token.value = (char *) data; input_token.length = cnt; diff --git a/src/appl/telnet/libtelnet/strcasecmp.c b/src/appl/telnet/libtelnet/strcasecmp.c index a398a8f78..1d06bf55e 100644 --- a/src/appl/telnet/libtelnet/strcasecmp.c +++ b/src/appl/telnet/libtelnet/strcasecmp.c @@ -1,24 +1,49 @@ /* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ +#ifndef __STDC__ +#define const +#endif + +#include +#ifdef NO_STRING_H +#include +#else +#include +#endif + #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strcasecmp.c 5.9 (Berkeley) 6/1/90"; +static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ typedef unsigned char u_char; @@ -28,7 +53,7 @@ typedef unsigned char u_char; * together for a case independent comparison. The mappings are * based upon ascii character sequences. */ -static u_char charmap[] = { +static const u_char charmap[] = { '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', @@ -65,34 +90,34 @@ static u_char charmap[] = { int strcasecmp(s1, s2) - char *s1, *s2; + const char *s1, *s2; { - register u_char *cm = charmap, - *us1 = (u_char *)s1, - *us2 = (u_char *)s2; + register const u_char *cm = charmap, + *us1 = (const u_char *)s1, + *us2 = (const u_char *)s2; while (cm[*us1] == cm[*us2++]) if (*us1++ == '\0') - return(0); - return(cm[*us1] - cm[*--us2]); + return (0); + return (cm[*us1] - cm[*--us2]); } int strncasecmp(s1, s2, n) - char *s1, *s2; - register int n; + const char *s1, *s2; + register size_t n; { if (n != 0) { - register u_char *cm = charmap, - *us1 = (u_char *)s1, - *us2 = (u_char *)s2; + register const u_char *cm = charmap, + *us1 = (const u_char *)s1, + *us2 = (const u_char *)s2; do { if (cm[*us1] != cm[*us2++]) - return(cm[*us1] - cm[*--us2]); + return (cm[*us1] - cm[*--us2]); if (*us1++ == '\0') break; } while (--n != 0); } - return(0); + return (0); } diff --git a/src/appl/telnet/libtelnet/strchr.c b/src/appl/telnet/libtelnet/strchr.c index 6fc586550..963d1834b 100644 --- a/src/appl/telnet/libtelnet/strchr.c +++ b/src/appl/telnet/libtelnet/strchr.c @@ -1,22 +1,38 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strchr.c 5.5 (Berkeley) 5/15/90"; +static char sccsid[] = "@(#)strchr.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #ifdef NO_STRING_H diff --git a/src/appl/telnet/libtelnet/strdup.c b/src/appl/telnet/libtelnet/strdup.c index 79c318a4f..7412e428e 100644 --- a/src/appl/telnet/libtelnet/strdup.c +++ b/src/appl/telnet/libtelnet/strdup.c @@ -1,44 +1,64 @@ /* - * Copyright (c) 1988 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strdup.c 5.3 (Berkeley) 6/1/90"; +static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#ifndef __STDC__ +#define const +#endif + #include + +#include +#include #ifdef NO_STRING_H #include #else #include #endif - char * strdup(str) - char *str; + const char *str; { - int len; - char *copy, *malloc(); + size_t len; + char *copy; len = strlen(str) + 1; if (!(copy = malloc((u_int)len))) - return((char *)0); + return (NULL); bcopy(str, copy, len); - return(copy); + return (copy); } diff --git a/src/appl/telnet/libtelnet/strerror.c b/src/appl/telnet/libtelnet/strerror.c index 133882463..8efe51e9f 100644 --- a/src/appl/telnet/libtelnet/strerror.c +++ b/src/appl/telnet/libtelnet/strerror.c @@ -1,24 +1,38 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * Neither the name of the University nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strerror.c 5.4 (Berkeley) 6/24/90"; +static char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #ifdef NO_STRING_H @@ -28,15 +42,30 @@ static char sccsid[] = "@(#)strerror.c 5.4 (Berkeley) 6/24/90"; #endif char * -strerror(errnum) - int errnum; +strerror(num) + int num; { extern int sys_nerr; extern char *sys_errlist[]; - static char ebuf[40]; /* 64-bit number + slop */ +#define UPREFIX "Unknown error: " + static char ebuf[40] = UPREFIX; /* 64-bit number + slop */ + register unsigned int errnum; + register char *p, *t; + char tmp[40]; - if ((unsigned int)errnum < sys_nerr) + errnum = num; /* convert to unsigned */ + if (errnum < sys_nerr) return(sys_errlist[errnum]); - (void)sprintf(ebuf, "Unknown error: %d", errnum); + + /* Do this by hand, so we don't include stdio(3). */ + t = tmp; + do { + *t++ = "0123456789"[errnum % 10]; + } while (errnum /= 10); + for (p = ebuf + sizeof(UPREFIX) - 1;;) { + *p++ = *--t; + if (t <= tmp) + break; + } return(ebuf); } diff --git a/src/appl/telnet/libtelnet/strrchr.c b/src/appl/telnet/libtelnet/strrchr.c index 93c6ed7b0..671148663 100644 --- a/src/appl/telnet/libtelnet/strrchr.c +++ b/src/appl/telnet/libtelnet/strrchr.c @@ -1,22 +1,38 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strrchr.c 5.6 (Berkeley) 5/17/90"; +static char sccsid[] = "@(#)strrchr.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #ifdef NO_STRING_H diff --git a/src/appl/telnet/telnet/Imakefile b/src/appl/telnet/telnet/Imakefile index fd3fdf183..94e5b2cdb 100644 --- a/src/appl/telnet/telnet/Imakefile +++ b/src/appl/telnet/telnet/Imakefile @@ -23,20 +23,42 @@ # Everything happens in ../Makefile.config and Makefile.generic # +AUTH_DEF=-DAUTHENTICATION -DKRB5 -DFORWARD -DLOGIN_CAP_F -DLOGIN_PROGRAM=KRB5_PATH_LOGIN +AUTH_INC=-I../../../include +AUTH_LIB=$(KLIB) +AUTH_LIBPATH=$(DEPKLIB); + all: @-if [ -f ../Config.local ]; \ then \ echo make -f ../Config.local WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)"; \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)"; \ make -f ../Config.local WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)"; \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)"; \ else \ echo make -f ../Config.generic WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)" $(TELNET_OPSYS); \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)" \ + $(TELNET_OPSYS); \ make -f ../Config.generic WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)" $(TELNET_OPSYS); \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)" \ + $(TELNET_OPSYS); \ fi +Makefiles:: + @echo "Do nothing!" + .DEFAULT: @-if [ -f ../Config.local ]; \ then \ diff --git a/src/appl/telnet/telnet/Makefile.4.4 b/src/appl/telnet/telnet/Makefile.4.4 index 835b1858f..2e38a2880 100644 --- a/src/appl/telnet/telnet/Makefile.4.4 +++ b/src/appl/telnet/telnet/Makefile.4.4 @@ -2,26 +2,41 @@ # Copyright (c) 1990 The Regents of the University of California. # All rights reserved. # -# Redistribution and use in source and binary forms are permitted provided -# that: (1) source distributions retain this entire copyright notice and -# comment, and (2) distributions including binaries display the following -# acknowledgement: ``This product includes software developed by the -# University of California, Berkeley and its contributors'' in the -# documentation or other materials provided with the distribution and in -# all advertising materials mentioning features or use of this software. -# Neither the name of the University nor the names of its contributors may -# be used to endorse or promote products derived from this software without -# specific prior written permission. -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. # -# @(#)Makefile 5.6 (Berkeley) 3/5/91 +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# @(#)Makefile 8.1 (Berkeley) 6/6/93 # PROG= telnet CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -DAUTHENTICATION -DENCRYPTION +CFLAGS+=-DENV_HACK CFLAGS+=-I${.CURDIR}/../../lib CFLAGS+= -DKRB4 @@ -33,4 +48,26 @@ DPADD= ${LIBTERMCAP} SRCS= authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \ terminal.c tn3270.c utilities.c +# These are the sources that have encryption stuff in them. +CRYPT_SRC= authenc.c commands.c externs.h main.c network.c +CRYPT_SRC+= ring.c ring.h telnet.c terminal.c utilities.c Makefile +NOCRYPT_DIR=${.CURDIR}/Nocrypt + .include + +nocrypt: +#ifdef ENCRYPTION + @for i in ${CRYPT_SRC}; do \ + if [ ! -d ${NOCRYPT_DIR} ]; then \ + echo Creating subdirectory ${NOCRYPT_DIR}; \ + mkdir ${NOCRYPT_DIR}; \ + fi; \ + echo ${NOCRYPT_DIR}/$$i; \ + unifdef -UENCRYPTION ${.CURDIR}/$$i | \ + sed "s/ || defined(ENCRYPTION)//" > ${NOCRYPT_DIR}/$$i; \ + done + +placeholder: +#else /* ENCRYPTION */ + @echo "Encryption code already removed." +#endif /* ENCRYPTION */ diff --git a/src/appl/telnet/telnet/Makefile.orig b/src/appl/telnet/telnet/Makefile.orig index 0e5389ac3..46597306c 100644 --- a/src/appl/telnet/telnet/Makefile.orig +++ b/src/appl/telnet/telnet/Makefile.orig @@ -22,9 +22,10 @@ # # Everything happens in ../Makefile.config and Makefile.generic # +SHELL=/bin/sh all: - @-if [ -f ../Config.local ]; \ + @-if test -f ../Config.local; \ then \ echo make -f ../Config.local WHAT=${WHAT} CC="${CC}"; \ make -f ../Config.local WHAT=${WHAT} CC="${CC}"; \ @@ -34,7 +35,7 @@ all: fi .DEFAULT: - @-if [ -f ../Config.local ]; \ + @-if test -f ../Config.local; \ then \ echo make -f ../Config.local WHAT=${WHAT} CC="${CC}" $@; \ make -f ../Config.local WHAT=${WHAT} CC="${CC}" $@; \ diff --git a/src/appl/telnet/telnet/authenc.c b/src/appl/telnet/telnet/authenc.c index 39d8c8d0d..545df7800 100644 --- a/src/appl/telnet/telnet/authenc.c +++ b/src/appl/telnet/telnet/authenc.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,10 +32,10 @@ */ #ifndef lint -static char sccsid[] = "@(#)authenc.c 5.2 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)authenc.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ -#if defined(ENCRYPTION) || defined(AUTHENTICATION) +#if defined(AUTHENTICATION) || defined(ENCRYPTION) #include #include #include @@ -64,12 +64,12 @@ net_write(str, len) void net_encrypt() { -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (encrypt_output) ring_encrypt(&netoring, encrypt_output); else ring_clearto(&netoring); -#endif +#endif /* ENCRYPTION */ } int @@ -108,4 +108,4 @@ telnet_gets(prompt, result, length, echo) TerminalNewMode(om); return(res); } -#endif +#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */ diff --git a/src/appl/telnet/telnet/commands.c b/src/appl/telnet/telnet/commands.c index 5d2b718b5..ec9bd0554 100644 --- a/src/appl/telnet/telnet/commands.c +++ b/src/appl/telnet/telnet/commands.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988, 1990 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1990, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)commands.c 5.8 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)commands.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #if defined(unix) @@ -69,7 +69,7 @@ static char sccsid[] = "@(#)commands.c 5.8 (Berkeley) 12/18/92"; #if !defined(CRAY) && !defined(sysV88) #include -# if (defined(tahoe) || defined(hp300)) && !defined(ultrix) +# if (defined(vax) || defined(tahoe) || defined(hp300)) && !defined(ultrix) # include # endif /* vax */ #endif /* !defined(CRAY) && !defined(sysV88) */ @@ -381,7 +381,6 @@ send_esc() send_docmd(name) char *name; { - void send_do(); return(send_tncmd(send_do, "do", name)); } @@ -389,21 +388,18 @@ send_docmd(name) send_dontcmd(name) char *name; { - void send_dont(); return(send_tncmd(send_dont, "dont", name)); } static int send_willcmd(name) char *name; { - void send_will(); return(send_tncmd(send_will, "will", name)); } static int send_wontcmd(name) char *name; { - void send_wont(); return(send_tncmd(send_wont, "wont", name)); } @@ -623,12 +619,12 @@ static int togglehelp P((void)); #if defined(AUTHENTICATION) extern int auth_togdebug P((int)); #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION extern int EncryptAutoEnc P((int)); extern int EncryptAutoDec P((int)); extern int EncryptDebug P((int)); extern int EncryptVerbose P((int)); -#endif +#endif /* ENCRYPTION */ struct togglelist { char *name; /* name of toggle */ @@ -661,7 +657,7 @@ static struct togglelist Togglelist[] = { 0, "print authentication debugging information" }, #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION { "autoencrypt", "automatic encryption of data stream", EncryptAutoEnc, @@ -682,12 +678,12 @@ static struct togglelist Togglelist[] = { EncryptDebug, 0, "print encryption debugging information" }, -#endif +#endif /* ENCRYPTION */ { "skiprc", "don't read ~/.telnetrc file", 0, &skiprc, - "read ~/.telnetrc file" }, + "skip reading of ~/.telnetrc file" }, { "binary", "sending and receiving of binary data", togbinary, @@ -1300,9 +1296,9 @@ display(argc, argv) } } /*@*/optionstatus(); -#if defined(ENCRYPTION) +#ifdef ENCRYPTION EncryptStatus(); -#endif +#endif /* ENCRYPTION */ return 1; #undef doset #undef dotog @@ -1434,6 +1430,8 @@ shell(argc, argv) } return 1; } +#else /* !defined(TN3270) */ +extern int shell(); #endif /* !defined(TN3270) */ /*VARARGS*/ @@ -1452,7 +1450,7 @@ bye(argc, argv) resettermname = 1; #if defined(AUTHENTICATION) || defined(ENCRYPTION) auth_encrypt_connect(connected); -#endif +#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */ /* reset options */ tninit(); #if defined(TN3270) @@ -1578,6 +1576,9 @@ extern void env_export P((unsigned char *)), env_unexport P((unsigned char *)), env_send P((unsigned char *)), +#if defined(OLD_ENVIRON) && defined(ENV_HACK) + env_varval P((unsigned char *)), +#endif env_list P((void)); static void env_help P((void)); @@ -1594,6 +1595,10 @@ struct envlist EnvList[] = { { "send", "Send an environment variable", env_send, 1 }, { "list", "List the current environment variables", env_list, 0 }, +#if defined(OLD_ENVIRON) && defined(ENV_HACK) + { "varval", "Reverse VAR and VALUE (auto, right, wrong, status)", + env_varval, 1 }, +#endif { "help", 0, env_help, 0 }, { "?", "Print help information", env_help, 0 }, { 0 }, @@ -1797,7 +1802,11 @@ env_send(var) { register struct env_lst *ep; - if (my_state_is_wont(TELOPT_ENVIRON)) { + if (my_state_is_wont(TELOPT_NEW_ENVIRON) +#ifdef OLD_ENVIRON + && my_state_is_wont(TELOPT_OLD_ENVIRON) +#endif + ) { fprintf(stderr, "Cannot send '%s': Telnet ENVIRON option not enabled\n", var); @@ -1855,6 +1864,44 @@ env_getvalue(var) return(NULL); } +#if defined(OLD_ENVIRON) && defined(ENV_HACK) + void +env_varval(what) + unsigned char *what; +{ + extern int old_env_var, old_env_value, env_auto; + int len = strlen((char *)what); + + if (len == 0) + goto unknown; + + if (strncasecmp((char *)what, "status", len) == 0) { + if (env_auto) + printf("%s%s", "VAR and VALUE are/will be ", + "determined automatically\n"); + if (old_env_var == OLD_ENV_VAR) + printf("VAR and VALUE set to correct definitions\n"); + else + printf("VAR and VALUE definitions are reversed\n"); + } else if (strncasecmp((char *)what, "auto", len) == 0) { + env_auto = 1; + old_env_var = OLD_ENV_VALUE; + old_env_value = OLD_ENV_VAR; + } else if (strncasecmp((char *)what, "right", len) == 0) { + env_auto = 0; + old_env_var = OLD_ENV_VAR; + old_env_value = OLD_ENV_VALUE; + } else if (strncasecmp((char *)what, "wrong", len) == 0) { + env_auto = 0; + old_env_var = OLD_ENV_VALUE; + old_env_value = OLD_ENV_VAR; + } else { +unknown: + printf("Unknown \"varval\" command. (\"auto\", \"right\", \"wrong\", \"status\")\n"); + } +} +#endif + #if defined(AUTHENTICATION) /* * The AUTHENTICATE command. @@ -1931,7 +1978,7 @@ auth_cmd(argc, argv) } #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION /* * The ENCRYPT command. */ @@ -2044,7 +2091,7 @@ encrypt_cmd(argc, argv) argc > 1 ? argv[3] : 0, argc > 2 ? argv[4] : 0)); } -#endif +#endif /* ENCRYPTION */ #if defined(unix) && defined(TN3270) static void @@ -2073,7 +2120,9 @@ filestuff(fd) perror("fcntl"); return; } +#ifdef notdef printf("\tFlags are 0x%x: %s\n", res, decodeflags(res)); +#endif } #endif /* defined(unix) && defined(TN3270) */ @@ -2109,9 +2158,9 @@ status(argc, argv) printf("%s character echo\n", (mode&MODE_ECHO) ? "Local" : "Remote"); if (my_want_state_is_will(TELOPT_LFLOW)) printf("%s flow control\n", (mode&MODE_FLOW) ? "Local" : "No"); -#if defined(ENCRYPTION) +#ifdef ENCRYPTION encrypt_display(); -#endif +#endif /* ENCRYPTION */ } } else { printf("No connection.\n"); @@ -2160,6 +2209,8 @@ ayt_status() } #endif +unsigned long inet_addr(); + int tn(argc, argv) int argc; @@ -2168,7 +2219,7 @@ tn(argc, argv) register struct hostent *host = 0; struct sockaddr_in sin; struct servent *sp = 0; - unsigned long temp, inet_addr(); + unsigned long temp; extern char *inet_ntoa(); #if defined(IP_OPTIONS) && defined(IPPROTO_IP) char *srp = 0, *strrchr(); @@ -2295,7 +2346,7 @@ tn(argc, argv) } } else { #if !defined(htons) - u_short htons(); + u_short htons P((unsigned short)); #endif /* !defined(htons) */ sin.sin_port = htons(sin.sin_port); } @@ -2366,7 +2417,7 @@ tn(argc, argv) connected++; #if defined(AUTHENTICATION) || defined(ENCRYPTION) auth_encrypt_connect(connected); -#endif +#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */ } while (connected == 0); cmdrc(hostp, hostname); if (autologin && user == NULL) { @@ -2414,9 +2465,9 @@ static char #if defined(AUTHENTICATION) authhelp[] = "turn on (off) authentication ('auth ?' for more)", #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION encrypthelp[] = "turn on (off) encryption ('encrypt ?' for more)", -#endif +#endif /* ENCRYPTION */ #if defined(unix) zhelp[] = "suspend telnet", #endif /* defined(unix) */ @@ -2445,9 +2496,9 @@ static Command cmdtab[] = { #if defined(AUTHENTICATION) { "auth", authhelp, auth_cmd, 0 }, #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION { "encrypt", encrypthelp, encrypt_cmd, 0 }, -#endif +#endif /* ENCRYPTION */ #if defined(unix) { "z", zhelp, suspend, 0 }, #endif /* defined(unix) */ diff --git a/src/appl/telnet/telnet/defines.h b/src/appl/telnet/telnet/defines.h index e6b12e825..0978173ea 100644 --- a/src/appl/telnet/telnet/defines.h +++ b/src/appl/telnet/telnet/defines.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)defines.h 5.1 (Berkeley) 9/14/90 + * @(#)defines.h 8.1 (Berkeley) 6/6/93 */ #define settimer(x) clocks.x = clocks.system++ diff --git a/src/appl/telnet/telnet/externs.h b/src/appl/telnet/telnet/externs.h index 7ec343134..11194bb54 100644 --- a/src/appl/telnet/telnet/externs.h +++ b/src/appl/telnet/telnet/externs.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988, 1990 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1990, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)externs.h 5.4 (Berkeley) 12/18/92 + * @(#)externs.h 8.1 (Berkeley) 6/6/93 */ #ifndef BSD @@ -44,17 +44,25 @@ #define BSD 43 #endif -#if (BSD > 43 || defined(SYSV_TERMIO)) && !defined(USE_TERMIO) -# define USE_TERMIO +#ifndef USE_TERMIO +# if BSD > 43 || defined(SYSV_TERMIO) +# define USE_TERMIO +# endif #endif #include #include +#if defined(CRAY) && !defined(NO_BSD_SETJMP) +#include +#endif #ifndef FILIO_H #include #else #include #endif +#ifdef CRAY +# include +#endif /* CRAY */ #ifdef USE_TERMIO # ifndef VINTR # ifdef SYSV_TERMIO @@ -91,7 +99,9 @@ typedef unsigned char cc_t; #define SUBBUFSIZE 256 +#ifndef CRAY extern int errno; /* outside this world */ +#endif /* !CRAY */ #if !defined(P) # ifdef __STDC__ @@ -152,10 +162,10 @@ extern char wont[], options[], /* All the little options */ *hostname; /* Who are we connected to? */ -#if defined(ENCRYPTION) +#ifdef ENCRYPTION extern void (*encrypt_output) P((unsigned char *, int)); extern int (*decrypt_input) P((int)); -#endif +#endif /* ENCRYPTION */ /* * We keep track of each side of the option negotiation. @@ -253,6 +263,12 @@ extern void willoption P((int)), wontoption P((int)); +extern void + send_do P((int, int)), + send_dont P((int, int)), + send_will P((int, int)), + send_wont P((int, int)); + extern void lm_will P((unsigned char *, int)), lm_wont P((unsigned char *, int)), @@ -461,5 +477,5 @@ extern int settranscom P((int, char**)); extern void - inputAvailable P((void)); + inputAvailable P((int)); #endif /* defined(TN3270) */ diff --git a/src/appl/telnet/telnet/fdset.h b/src/appl/telnet/telnet/fdset.h index 1475264f8..045bb7221 100644 --- a/src/appl/telnet/telnet/fdset.h +++ b/src/appl/telnet/telnet/fdset.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)fdset.h 5.1 (Berkeley) 9/14/90 + * @(#)fdset.h 8.1 (Berkeley) 6/6/93 */ /* diff --git a/src/appl/telnet/telnet/general.h b/src/appl/telnet/telnet/general.h index d77d5b5d8..4efa95194 100644 --- a/src/appl/telnet/telnet/general.h +++ b/src/appl/telnet/telnet/general.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)general.h 5.2 (Berkeley) 3/1/91 + * @(#)general.h 8.1 (Berkeley) 6/6/93 */ /* diff --git a/src/appl/telnet/telnet/main.c b/src/appl/telnet/telnet/main.c index 57658391e..7e2f9f35e 100644 --- a/src/appl/telnet/telnet/main.c +++ b/src/appl/telnet/telnet/main.c @@ -52,7 +52,9 @@ static char sccsid[] = "@(#)main.c 5.5 (Berkeley) 12/18/92"; #define OPTS_FORWARD_CREDS 0x00000002 #define OPTS_FORWARDABLE_CREDS 0x00000001 +#if 0 #define FORWARD +#endif /* * Initialize variables. diff --git a/src/appl/telnet/telnet/network.c b/src/appl/telnet/telnet/network.c index 0aa807970..3aa7ea76b 100644 --- a/src/appl/telnet/telnet/network.c +++ b/src/appl/telnet/telnet/network.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)network.c 5.3 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)network.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #include @@ -128,13 +128,13 @@ netflush() { register int n, n1; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (encrypt_output) ring_encrypt(&netoring, encrypt_output); -#endif +#endif /* ENCRYPTION */ if ((n1 = n = ring_full_consecutive(&netoring)) > 0) { if (!ring_at_mark(&netoring)) { - n = send(net, netoring.consume, n, 0); /* normal write */ + n = send(net, (char *)netoring.consume, n, 0); /* normal write */ } else { /* * In 4.2 (and 4.3) systems, there is some question about @@ -144,7 +144,7 @@ netflush() * we really have more the TCP philosophy of urgent data * rather than the Unix philosophy of OOB data). */ - n = send(net, netoring.consume, 1, MSG_OOB);/* URGENT data */ + n = send(net, (char *)netoring.consume, 1, MSG_OOB);/* URGENT data */ } } if (n < 0) { diff --git a/src/appl/telnet/telnet/ring.c b/src/appl/telnet/telnet/ring.c index 9b5e82880..1080d121a 100644 --- a/src/appl/telnet/telnet/ring.c +++ b/src/appl/telnet/telnet/ring.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)ring.c 5.3 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)ring.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ /* @@ -112,9 +112,9 @@ Ring *ring; ring->top = ring->bottom+ring->size; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION ring->clearto = 0; -#endif +#endif /* ENCRYPTION */ return 1; } @@ -185,7 +185,7 @@ ring_consumed(ring, count) (ring_subtract(ring, ring->mark, ring->consume) < count)) { ring->mark = 0; } -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (ring->consume < ring->clearto && ring->clearto <= ring->consume + count) ring->clearto = 0; @@ -193,7 +193,7 @@ ring_consumed(ring, count) ring->bottom <= ring->clearto && ring->bottom + ((ring->consume + count) - ring->top)) ring->clearto = 0; -#endif +#endif /* ENCRYPTION */ ring->consume = ring_increment(ring, ring->consume, count); ring->consumetime = ++ring_clock; /* @@ -325,7 +325,7 @@ ring_consume_data(ring, buffer, count) } #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION void ring_encrypt(ring, encryptor) Ring *ring; @@ -359,4 +359,4 @@ ring_clearto(ring) else ring->clearto = 0; } -#endif +#endif /* ENCRYPTION */ diff --git a/src/appl/telnet/telnet/ring.h b/src/appl/telnet/telnet/ring.h index f69d8ff53..2a36781e5 100644 --- a/src/appl/telnet/telnet/ring.h +++ b/src/appl/telnet/telnet/ring.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)ring.h 5.3 (Berkeley) 12/18/92 + * @(#)ring.h 8.1 (Berkeley) 6/6/93 */ #if defined(P) @@ -59,10 +59,10 @@ typedef struct { *bottom, /* lowest address in buffer */ *top, /* highest address+1 in buffer */ *mark; /* marker (user defined) */ -#if defined(ENCRYPTION) +#ifdef ENCRYPTION unsigned char *clearto; /* Data to this point is clear text */ unsigned char *encryyptedto; /* Data is encrypted to here */ -#endif +#endif /* ENCRYPTION */ int size; /* size in bytes of buffer */ u_long consumetime, /* help us keep straight full, empty, etc. */ supplytime; @@ -94,11 +94,11 @@ extern int ring_full_count P((Ring *ring)), ring_full_consecutive P((Ring *ring)); -#if defined(ENCRYPTION) +#ifdef ENCRYPTION extern void ring_encrypt P((Ring *ring, void (*func)())), ring_clearto P((Ring *ring)); -#endif +#endif /* ENCRYPTION */ extern void ring_clear_mark(), diff --git a/src/appl/telnet/telnet/sys_bsd.c b/src/appl/telnet/telnet/sys_bsd.c index 362166048..1e40c81d0 100644 --- a/src/appl/telnet/telnet/sys_bsd.c +++ b/src/appl/telnet/telnet/sys_bsd.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988, 1990 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1990, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)sys_bsd.c 5.3 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)sys_bsd.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ /* @@ -63,6 +63,10 @@ static char sccsid[] = "@(#)sys_bsd.c 5.3 (Berkeley) 12/18/92"; #define SIG_FUNC_RET int #endif +#ifdef SIGINFO +extern SIG_FUNC_RET ayt_status(); +#endif + int tout, /* Output file descriptor */ tin, /* Input file descriptor */ @@ -174,12 +178,12 @@ extern int kludgelinemode; * 1 Do add this character */ +extern void xmitAO(), xmitEL(), xmitEC(), intp(), sendbrk(); + int TerminalSpecialChars(c) int c; { - void xmitAO(), xmitEL(), xmitEC(), intp(), sendbrk(); - if (c == termIntChar) { intp(); return 0; @@ -607,18 +611,18 @@ TerminalNewMode(f) if (f != -1) { #ifdef SIGTSTP - static SIG_FUNC_RET susp(); + SIG_FUNC_RET susp(); #endif /* SIGTSTP */ #ifdef SIGINFO - static SIG_FUNC_RET ayt(); -#endif SIGINFO + SIG_FUNC_RET ayt(); +#endif #ifdef SIGTSTP (void) signal(SIGTSTP, susp); #endif /* SIGTSTP */ #ifdef SIGINFO (void) signal(SIGINFO, ayt); -#endif SIGINFO +#endif #if defined(USE_TERMIO) && defined(NOKERNINFO) tmp_tc.c_lflag |= NOKERNINFO; #endif @@ -662,7 +666,7 @@ TerminalNewMode(f) SIG_FUNC_RET ayt_status(); (void) signal(SIGINFO, ayt_status); -#endif SIGINFO +#endif #ifdef SIGTSTP (void) signal(SIGTSTP, SIG_DFL); (void) sigsetmask(sigblock(0) & ~(1<<(SIGTSTP-1))); @@ -806,7 +810,7 @@ NetSetPgrp(fd) */ /* ARGSUSED */ - static SIG_FUNC_RET + SIG_FUNC_RET deadpeer(sig) int sig; { @@ -815,7 +819,7 @@ deadpeer(sig) } /* ARGSUSED */ - static SIG_FUNC_RET + SIG_FUNC_RET intr(sig) int sig; { @@ -828,7 +832,7 @@ intr(sig) } /* ARGSUSED */ - static SIG_FUNC_RET + SIG_FUNC_RET intr2(sig) int sig; { @@ -845,7 +849,7 @@ intr2(sig) #ifdef SIGTSTP /* ARGSUSED */ - static SIG_FUNC_RET + SIG_FUNC_RET susp(sig) int sig; { @@ -858,7 +862,7 @@ susp(sig) #ifdef SIGWINCH /* ARGSUSED */ - static SIG_FUNC_RET + SIG_FUNC_RET sendwin(sig) int sig; { @@ -870,7 +874,7 @@ sendwin(sig) #ifdef SIGINFO /* ARGSUSED */ - static SIG_FUNC_RET + SIG_FUNC_RET ayt(sig) int sig; { @@ -1109,7 +1113,7 @@ process_rings(netin, netout, netex, ttyin, ttyout, poll) } settimer(didnetreceive); #else /* !defined(SO_OOBINLINE) */ - c = recv(net, netiring.supply, canread, 0); + c = recv(net, (char *)netiring.supply, canread, 0); #endif /* !defined(SO_OOBINLINE) */ if (c < 0 && errno == EWOULDBLOCK) { c = 0; diff --git a/src/appl/telnet/telnet/telnet.0 b/src/appl/telnet/telnet/telnet.0 deleted file mode 100644 index c00f77952..000000000 --- a/src/appl/telnet/telnet/telnet.0 +++ /dev/null @@ -1,333 +0,0 @@ -protocol The command is used to communicate with another host -using the protocol. If is invoked without the argument, it -enters command mode, indicated by its prompt In this mode, it -accepts and executes the commands listed below. If it is invoked -with arguments, it performs an command with those arguments. -Options: Use an eight bit data path. This will cause an attempt -to negotiate the BINARY option on both input and output. The -option stops any character from being recognized as an escape -character. Do not attempt to do automatic login to the remote -system. Use an eight bit data path on output. This causes the -BINARY option to be negotiated on output. Disable the type of -authentication. Attempt automatic login. Currently, this sends -the user name via the USER variable of the ENVIRON option if sup- -ported by the remote system. The name used is that of the -current user as returned by if it agrees with the current user -ID, otherwise it is the name associated with the user ID. The -flag disables the reading of the users (See the command below.) -Sets the initial value of the toggle to Sets the initial telnet -escape character to If is ommitted, then there will be no escape -character. If Kerberos authentication is being used, the option -requests that obtain tickets for the remote host in realm instead -of the remote host's realm as determined by When connecting to -the remote system, if the remote system understands the ENVIRON -option, then will be sent to the remote system as the value for -the variable USER. This option implies the option. This option -may also be used with the command. Opens for recording trace -information. See the command below. Use a user interface simi- -lar to In this mode, the escape character is set to the tilde -(``~'') character, unless modified by the flag. Turn on encryp- -tion of the data stream, if possible. Indicates the official -name, an alias, or the Internet address of a remote host. Indi- -cates a port number (address of an application) or name. If a -number is not specified, the default port is used. Port names -are mapped to port numbers via the /etc/services file. Normally -when a port number is specified, will not send out any initial -option negotiation. If the port number/name is preceded by a -minus sign, then the initial option negotiation will be sent. -When in mode, a line of the form ``~.'' disconnects from the -remote host, where ``~'' is the escape character. Similarly, the -line ``~^Z'' will suspend the session. The line ``~^]'' will -escape to the normal escape prompt. Once a connection has been -opened, will attempt to enable the option. If this fails, then -will revert to one of two input modes: either character at a time -or old line by line depending on what the remote system supports. -When is enabled, character processing is done on the local sys- -tem, under the control of the remote system. When input editing -or character echoing is to be disabled, the remote system will -relay that information. The remote system will also relay -changes to any special characters that happen on the remote sys- -tem, so that they can take effect on the local system. In char- -acter at a time mode, most text typed is immediately sent to the -remote host for processing. In old line by line mode, all text -is echoed locally, and (normally) only completed lines are sent -to the remote host. The local echo character (initially ^E) may -be used to turn off and on the local echo (this would mostly be -used to enter passwords without the password being echoed). If -the option is enabled, or if the toggle is TRUE (the default for -old line by line; see below), the user's and characters are -trapped locally, and sent as protocol sequences to the remote -side. If has ever been enabled, then the user's and are also -sent as protocol sequences, and is sent as a instead of There are -options (see and below) which cause this action to flush subse- -quent output to the terminal (until the remote host acknowledges -the sequence) and flush previous terminal input (in the case of -and While connected to a remote host, command mode may be entered -by typing the escape character (initially ^ ). When in command -mode, the normal terminal editing conventions are available. The -following commands are available. Only enough of each command to -uniquely identify it need be typed (this is also true for most of -the arguments to the commands). The command is used to manipu- -late the the information that my be sent through the option. -Valid arguments for the auth command are: Disable the specified -of authentication. A list of available types can be gotten by -doing an command. Enable the specified of authentication. A -list of available types can be gotten by doing an command. List -the current status of the various types of authentication. Close -a session and return to command mode. Displays all, or some, of -the and values (see below). The command is used to manipulate -the the information that my be sent through the option. -Valid arguments for the encrypt command are: Disable the speci- -fied of encryption. If the or is not specified, both input and -output will be disabled. A list of available types can be gotten -by doing an command. Enable the specified of encryption. If or -is not specified, both input and output will be enabled. A list -of available types can be gotten by doing an command. Set the -default type of encryption to be used with later or commands. -Attempt to start encryption. If or is not specified, encryption -of both input and output will be attempted. The command must -have been used to set the encryption type. Stop encryption. If -or is not specified, encryption will be stopped on both input and -output. This is the same as the command. This is the same as -the command. This is the same as the command. This is the same -as the command. List the current status of encryption. The com- -mand is used to manipulate the the variables that my be sent -through the option. The initial set of variables is taken from -the users environment, with only the and variables being exported -by default. The variable is also exported if the or options are -used. -Valid arguments for the environ command are: Define the variable -to have a value of Any variables defined by this command are -automatically exported. The may be enclosed in single or double -quotes so that tabs and spaces may be included. Remove from the -list of environment variables. Mark the variable to be exported -to the remote side. Mark the variable to not be exported unless -explicitly asked for by the remote side. List the current set of -environment variables. Those marked with a * will be sent -automatically, other variables will only be sent if explicitly -requested. Prints out help information for the command. Send -the option to the remote side. This is similar to doing a com- -mand, however if the remote side does not support the option, -then nothing will happen. If, however, the remote side does sup- -port the option, then this command should cause the remote side -to close the connection. In addition, if the remote side sup- -ports the concept of suspending a users session for later re- -attachement, the option indicates that the session should be ter- -minated immediately. is one of several options, depending on the -state of the session. The remote host is asked for permission to -go into the requested mode. If the remote host is capable of -entering that mode, the requested mode will be entered. Disable -the option, or, if the remote side does not understand the -option, then enter character at a time mode. Enable the option, -or, if the remote side does not understand the option, then -attempt to enter old-line-by-line mode. Attempt to enable (dis- -able) the mode of the option. This requires that the option be -enabled. Attempt to enable (disable) the mode of the option. -This requires that the option be enabled. Attempt to enable -(disable) the mode of the option. This requires that the option -be enabled. Attempt to enable (disable) the mode of the option. -This requires that the option be enabled. Prints out help infor- -mation for the command. Open a connection to the named host. If -no port number is specified, will attempt to contact a server at -the default port. The host specification may be either a host -name (see or an Internet address specified in the dot notation -(see The option may be used to specify the user name to be passed -to the remote system via the option. When connecting to a non- -standard port, omits any automatic initiation of options. When -the port number is preceded by a minus sign, the initial option -negotiation is done. After establishing a connection, if the -variable is not enabled (see the command below), the file in the -users home directory is opened. Lines beginning with a # are -comment lines. Blank lines are ignored. Lines that begin -without whitespace are the start of a machine entry. The first -thing on the line is the name of the machine that is being con- -nected to. The rest of the line, and successive lines that begin -with whitespace are assumed to be commands and are processed as -if they had been typed in manually to the command prompt. The -special machine name is used to specify commands that should be -executed for all machines. There may be more than one entry for -a machine; all matches will the specified machine name will be -executed. Close any open session and exit An end of file (in -command mode) will also close a session and exit. Sends one or -more special character sequences to the remote host. The follow- -ing are the arguments which may be specified (more than one argu- -ment may be specified at a time): Sends the (ABORT processes) -sequence. Sends the (Abort Output) sequence, which should cause -the remote system to flush all output the remote system the -user's terminal. Sends the (Are You There) sequence, to which -the remote system may or may not choose to respond. Sends the -(Break) sequence, which may have significance to the remote sys- -tem. Sends the (Erase Character) sequence, which should cause -the remote system to erase the last character entered. Sends the -(Erase Line) sequence, which should cause the remote system to -erase the line currently being entered. Sends the (End Of File) -sequence. Sends the (End of Record) sequence. Sends the current -escape character (initially ^). Sends the (Go Ahead) sequence, -which likely has no significance to the remote system. If the -remote side supports the command, will send the subnegotiation to -request that the server send its current option status. Sends -the (Interrupt Process) sequence, which should cause the remote -system to abort the currently running process. Sends the (No -OPeration) sequence. Sends the (SUSPend process) sequence. -Sends the sequence. This sequence causes the remote system to -discard all previously typed (but not yet read) input. This -sequence is sent as TCP urgent data (and may not work if the -remote system is a 4.2 BSD system -- if it doesn't work, a lower -case r may be echoed on the terminal). Prints out help informa- -tion for the command. The command will set any one of a number -of variables to a specific value or to TRUE. The special value -turns off the function associated with the variable, this is -equivalent to using the command. The command will disable or set -to FALSE any of the specified functions. The values of variables -may be interrogated with the command. The variables which may be -set or unset, but not toggled, are listed here. In addition, any -of the variables for the command may be explicitly set or unset -using the and commands. If is in mode, or is enabled, and the -character is typed, a sequence (see above) is sent to the remote -host. The initial value for the ayt character is taken to be the -terminal's character. This is the value (initially ^E) which, -when in line by line mode, toggles between doing local echoing of -entered characters (for normal processing), and suppressing echo- -ing of entered characters (for entering, say, a password). If is -operating in or old line by line mode, entering this character as -the first character on a line will cause this character to be -sent to the remote system. The initial value of the eof charac- -ter is taken to be the terminal's character. If is in mode (see -below), if is operating in character at a time mode, then when -this character is typed, a sequence (see above) is sent to the -remote system. The initial value for the erase character is -taken to be the terminal's character. This is the escape charac- -ter (initially ^[) which causes entry into command mode (when -connected to a remote system). If is in mode (see below) and the -character is typed, a sequence (see above) is sent to the remote -host. The initial value for the flush character is taken to be -the terminal's character. If is operating in these are the char- -acters that, when typed, cause partial lines to be forwarded to -the remote system. The initial value for the forw1 and forw2 -characters are taken from the terminal's and characters. If is -in mode (see below) and the character is typed, a sequence (see -above) is sent to the remote host. The initial value for the -interrupt character is taken to be the terminal's character. If -is in mode (see below), if is operating in character at a time -mode, then when this character is typed, a sequence (see above) -is sent to the remote system. The initial value for the kill -character is taken to be the terminal's character. If is operat- -ing in or old line by line mode, then this character is taken to -be the terminal's character. The initial value for the lnext -character is taken to be the terminal's character. If is in mode -(see below) and the character is typed, a sequence (see above) is -sent to the remote host. The initial value for the quit charac- -ter is taken to be the terminal's character. If is operating in -or old line by line mode, then this character is taken to be the -terminal's character. The initial value for the reprint charac- -ter is taken to be the terminal's character. This is the rlogin -escape character. If set, the normal character will be ignored -unless it is preceded by this character at the beginning of a -line. This character, at the beginning of a line, followed by a -``.'' will close the connection; when followed by a ``^Z'' it -will suspend the command. The initial state is to have the -escape character disabled. If the option has been enabled, then -this character is taken to be the terminal's character. The ini- -tial value for the kill character is taken to be the terminal's -character. If the option has been enabled, then this character -is taken to be the terminal's character. The initial value for -the kill character is taken to be the terminal's character. If -is in mode, or is enabled, and the character is typed, a sequence -(see above) is sent to the remote host. The initial value for -the suspend character is taken to be the terminal's character. -This is the file to which the output, caused by or tracing being -TRUE, will be written. If it is set to then tracing information -will be written to standard output (the default). If is operat- -ing in or old line by line mode, then this character is taken to -be the terminal's character. The initial value for the worderase -character is taken to be the terminal's character. Displays the -legal commands. The command (Set Local Characters) is used to -set or change the state of the the special characters when the -option has been enabled. Special characters are characters that -get mapped to commands sequences (like or or line editing charac- -ters (like and By default, the local special characters are -exported. Switch to the local defaults for the special charac- -ters. The local default characters are those of the local termi- -nal at the time when was started. Switch to the remote defaults -for the special characters. The remote default characters are -those of the remote system at the time when the connection was -established. Verify the current settings for the current special -characters. The remote side is requested to send all the current -special character settings, and if there are any discrepancies -with the local side, the local side will switch to the remote -value. Prints out help information for the command. Show the -current status of This includes the peer one is connected to, as -well as the current mode. Toggle (between TRUE and FALSE) vari- -ous flags that control how responds to events. These flags may -be set explicitly to TRUE or FALSE using the and commands listed -above. More than one argument may be specified. The state of -these flags may be interrogated with the command. Valid -arguments are: Turn on debugging information for the authentica- -tion code. If and are both TRUE, then when the or characters are -recognized (and transformed into sequences; see above for -details), refuses to display any data on the user's terminal -until the remote system acknowledges (via a option) that it has -processed those sequences. The initial value for this toggle is -TRUE if the terminal user had not done an "stty noflsh", other- -wise FALSE (see When the option is negotiated, by default the -actual encryption (decryption) of the data stream does not -automatically start. The command states that encryption of the -output (input) stream should be enabled as soon as possible. If -the option is supported by the remote side, then will attempt to -use it to perform automatic authentication. If the option is not -supported, then the users login name will be propagated via the -option. This command is the same as specifying option on the -command. If and are both TRUE, then when either the or charac- -ters is typed (see above for descriptions of the and characters), -the resulting sequence sent is followed by the sequence. This -procedure cause the remote system to begin throwing away all pre- -viously typed input until both of the sequences have been read -and acted upon. The initial value of this toggle is FALSE. -Enable or disable the option on both input and output. Enable or -disable the option on input. Enable or disable the option on -output. If this is TRUE, then carriage returns will be sent as -. If this is FALSE, then carriage returns will be send -as . The initial value for this toggle is FALSE. Tog- -gle carriage return mode. When this mode is enabled, most car- -riage return characters received from the remote host will be -mapped into a carriage return followed by a line feed. This mode -does not affect those characters typed by the user, only those -received from the remote host. This mode is not very useful -unless the remote host only sends carriage return, but never line -feed. The initial value for this toggle is FALSE. Toggles -socket level debugging (useful only to the The initial value for -this toggle is FALSE. Turn on debugging information for the -encryption code. If this is TRUE, then the and characters (see -above) are recognized locally, and transformed into (hopefully) -appropriate control sequences (respectively and see above). The -initial value for this toggle is TRUE in old line by line mode, -and FALSE in character at a time mode. When the option is -enabled, the value of is ignored, and assumed to always be TRUE. -If has ever been enabled, then is sent as and suspend are sent as -see above). Toggles the display of all network data (in hexade- -cimal format). The initial value for this toggle is FALSE. Tog- -gles the display of some internal protocol processing (having to -do with options). The initial value for this toggle is FALSE. -When the or toggle is enabled, if is enabled the output from the -and command will be formated in a more user readable format. -Spaces are put between each character in the output, and the -beginning of any escape sequence is preceded by a '*' to aid in -locating them. When the toggle is TRUE, then will skip the read- -ing of the file in the users home directory when connections are -opened. The initial value for this toggle is FALSE. Toggles the -display of all terminal data (in hexadecimal format). The ini- -tial value for this toggle is FALSE. When the toggle is TRUE, -then will print out a message each time encryption is enabled or -disabled. The initial value for this toggle is FALSE. Displays -the legal commands. Suspend This command only works when the -user is using the Execute a single command in a subshell on the -local system. If is omitted, then an interactive subshell is -invoked. Get help. With no arguments, prints a help summary. -If a command is specified, will print the help information for -just that command. uses at least the and environment variables. -Other environment variables may be propagated to the other side -via the option. user customized telnet startup values appeared -in 4.2 BSD. On some remote systems, echo has to be turned off -manually when in old line by line mode. In old line by line mode -or the terminal's character is only recognized (and sent to the -remote system) when it is the first character on a line. diff --git a/src/appl/telnet/telnet/telnet.0.ps b/src/appl/telnet/telnet/telnet.0.ps new file mode 100644 index 000000000..9edd0b321 --- /dev/null +++ b/src/appl/telnet/telnet/telnet.0.ps @@ -0,0 +1,1008 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.08 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Courier-Bold +%%+ font Courier-Oblique +%%+ font Courier +%%+ font Symbol +%%+ font Times-Italic +%%DocumentSuppliedResources: procset grops 1.08 0 +%%Pages: 10 +%%PageOrder: Ascend +%%Orientation: Portrait +%%EndComments +%%BeginProlog +%%BeginResource: procset grops 1.08 0 +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}bind def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/FL{ +currentgray exch setgray fill setgray +}bind def +/BL/fill load def +/LW/setlinewidth load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +}bind def +/PEND{ +clear +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Courier-Bold +%%IncludeResource: font Courier-Oblique +%%IncludeResource: font Courier +%%IncludeResource: font Symbol +%%IncludeResource: font Times-Italic +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL +792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron +/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space +/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft +/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four +/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C +/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash +/bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q +/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase +/guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger +/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar +/section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus +/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu +/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright +/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde +/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute +/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls +/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute +/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve +/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex +/udieresis/yacute/thorn/ydieresis]def/Times-Italic@0 ENC0/Times-Italic RE +/Courier@0 ENC0/Courier RE/Courier-Oblique@0 ENC0/Courier-Oblique RE +/Courier-Bold@0 ENC0/Courier-Bold RE/Times-Bold@0 ENC0/Times-Bold RE +/Times-Roman@0 ENC0/Times-Roman RE +%%EndProlog +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R/F1 10/Times-Bold@0 SF -.2(NA)72 +108 S(ME).2 E/F2 10/Courier-Bold@0 SF(telnet)102 120 Q F0 2.52.5 G +(ser interf)153.64 120 Q(ace to the)-.1 E/F3 9/Times-Roman@0 SF(TELNET)2.5 E F0 +(protocol)2.5 E F1(SYNOPSIS)72 144 Q F2(telnet)102 156 Q F0([)3.333 E F2 +2.499 E F0 3.333(][).833 G F2-.834 E F0 3.333(][).833 G F2-.834 E +F0 3.333(][).833 G F2-.834 E F0 3.333(][).833 G F2-.834 E F0 3.333 +(][).833 G F2-.834 E/F4 10/Courier-Oblique@0 SF(tos)6 E F0 3.333(][).833 +G F2-.834 E F4(authtype)6 E F0 3.333(][).833 G F2-.834 E F0 3.333 +(][).833 G F2-.834 E F0 3.333(][).833 G F2-.834 E F0 3.333(][).833 +G F2-.834 E F4(escapechar)144 168 Q F0 3.333(][).833 G F2-.834 E F0 +3.333(][).833 G F2-.834 E F4(realm)6 E F0 3.333(][).833 G F2-.834 E +F4(user)6 E F0 3.333(][).833 G F2-.834 E F4(tracefile)6 E F0 3.333(][) +.833 G F2-.834 E F0 3.333(][).833 G F2-.834 E F0 2.5(][).833 G F4 +(host)491.943 168 Q F0 .833([p)144.833 180 S -1.667(ort ]])-.833 F F1 +(DESCRIPTION)72 204 Q F0(The)102 216 Q F2(telnet)2.523 E F0 .023 +(command is used to communicate with another host using the)2.523 F F3(TELNET) +2.523 E F0 2.523(protocol. If)2.523 F F2(telnet)2.523 E F0(is)2.522 E(in)102 +228 Q -.2(vo)-.4 G -.1(ke).2 G 2.693(dw).1 G .193(ithout the)143.433 228 R F4 +(host)2.693 E F0(ar)2.693 E .194 +(gument, it enters command mode, indicated by its prompt)-.18 F(\()4.36 E F2 +(telnet>)1.666 E F0 -3.138 1.666(\). I)1.666 H 2.694(nt)-1.666 G(his)528.33 228 +Q 1.07(mode, it accepts and e)102 240 R -.15(xe)-.15 G 1.07 +(cutes the commands listed belo).15 F 4.87 -.65(w. I)-.25 H 3.57(fi).65 G 3.57 +(ti)361.18 240 S 3.57(si)370.31 240 S -1.9 -.4(nv o)380.55 240 T -.1(ke).4 G +3.57(dw).1 G 1.07(ith ar)420.08 240 R 1.07(guments, it performs an)-.18 F F2 +(open)102 252 Q F0(command with those ar)2.5 E(guments.)-.18 E(Options:)102 270 +Q F2103.666 288 Q F0 .352(Speci\214es an 8-bit data path.)143 288 R .353 +(This causes an attempt to ne)5.352 F .353(gotiate the)-.15 F/F5 10/Courier@0 +SF .353(TELNET BINARY)2.853 F F0 .353(option on)2.853 F(both input and output.) +143 300 Q F2103.666 318 Q F0(Stops an)143 318 Q 2.5(yc)-.15 G +(haracter from being recognized as an escape character)188.96 318 Q(.)-.55 E F2 +103.666 336 Q F0 .691(If K)143 336 R .691 +(erberos V5 authentication is being used, the)-.25 F F24.856 E F0 .69 +(option allo)3.19 F .69(ws the local credentials to be for)-.25 F(-)-.2 E -.1 +(wa)143 348 S .615(rded to the remote system, including an).1 F 3.116(yc)-.15 G +.616(redentials that ha)328.698 348 R .916 -.15(ve a)-.2 H .616 +(lready been forw).15 F .616(arded into the)-.1 F(local en)143 360 Q +(vironment.)-.4 E F2103.666 378 Q F0 +(Speci\214es no automatic login to the remote system.)143 378 Q F2103.666 +396 Q F0 .147(Speci\214es an 8-bit data path on output.)143 396 R .146 +(This causes the BIN)5.146 F(AR)-.35 E 2.646(Yo)-.65 G .146(ption to be ne) +409.42 396 R .146(gotiated on output.)-.15 F F2103.666 414 Q F4(tos)6 E +F0 .288(Sets the IP type-of-service \(T)143 426 R .288 +(OS\) option for the telnet connection to the v)-.18 F(alue)-.25 E F4(tos,) +2.788 E F0 .289(which can be)2.788 F 3.12(an)143 438 S .62(umeric T)155.56 438 +R .62(OS v)-.18 F .62(alue or)-.25 F 3.12(,o)-.4 G 3.12(ns)251.36 438 S .619 +(ystems that support it, a symbolic T)263.37 438 R .619 +(OS name found in the /etc/iptos)-.18 F(\214le.)143 450 Q F2103.666 468 Q +F4(atype)6 E F0(Disables the)143 480 Q F4(atype)2.5 E F0 +(type of authentication.)2.5 E F2103.666 498 Q F0 2.562 +(Attempt automatic login.)143 498 R(Currently)7.563 E 5.063(,t)-.65 G 2.563 +(his sends the user name via the)303.99 498 R F5(USER)5.063 E F0 -.25(va)5.063 +G 2.563(riable of the).25 F F5(ENVIRON)143 510 Q F0 .444 +(option if supported by the remote system.)2.945 F .444 +(The name used is that of the current user as)5.444 F .168(returned by)143 522 +R F5(getlogin)2.668 E F0 .168(\(2\) if it agrees with the current user ID, oth\ +erwise it is the name associated)B(with the user ID.)143 534 Q F2103.666 +552 Q F0 .022(Disables the reading of the user')143 552 R(s)-.55 E F5 +(.telnetrc)2.522 E F0 2.522(\214le. \(See)2.522 F(the)2.522 E F2 .022 +(toggle skiprc)2.522 F F0 .022(command on this)2.522 F(man page.\))143 564 Q F2 +103.666 582 Q F0(Sets the initial v)143 582 Q(alue of the)-.25 E F2 +(debug)2.5 E F0(toggle to)2.5 E F5(TRUE)2.5 E F2103.666 600 Q F4 +(escape char)6 E F0 1.759(Sets the initial)143 612 R F2 -1.741(telnet telnet) +4.259 F F0 1.759(escape character to)4.259 F F4 1.759(escape char.)4.259 F F0 +(If)4.259 E F4 1.76(escape char)4.26 F F0(is)4.26 E +(omitted, then there will be no escape character)143 624 Q(.)-.55 E F2 +103.666 642 Q F0 .691(If K)143 642 R .691 +(erberos V5 authentication is being used, the)-.25 F F24.856 E F0 .69 +(option allo)3.19 F .69(ws the local credentials to be for)-.25 F(-)-.2 E -.1 +(wa)143 654 S(rded to the remote system.).1 E F2103.666 672 Q F4(realm)6 +E F0 .008(If K)143 684 R .008(erberos authentication is being used, the)-.25 F +F24.174 E F0 .009(option requests that telnet obtain tick)2.508 F .009 +(ets for the re-)-.1 F 6.61 +(mote host in realm realm instead of the remote host')143 696 R 9.11(sr)-.55 G +6.61(ealm, as determined by)427.41 696 R(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD) +-.15 G(istrib)132.57 750 Q 95.71(ution February)-.2 F(3, 1994)2.5 E(1)535 750 Q +EP +%%Page: 2 2 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R/F1 10/Courier@0 SF +(krb_realmofhost)143 96 Q F0(\(3\).)A/F2 10/Courier-Bold@0 SF103.666 114 +Q/F3 10/Courier-Oblique@0 SF(user)6 E F0 1.135 +(When connecting to the remote system, if the remote system understands the)143 +126 R F1(ENVIRON)3.636 E F0(option,)3.636 E(then)143 138 Q F3(user)2.974 E F0 +.474(will be sent to the remote system as the v)2.974 F .474(alue for the v) +-.25 F .474(ariable USER.)-.25 F .473(This option im-)5.474 F(plies the)143 150 +Q F24.166 E F0 2.5(option. This)2.5 F(option may also be used with the) +2.5 E F2(open)2.5 E F0(command.)2.5 E F2103.666 168 Q F3(tracefile)6 E F0 +(Opens)143 180 Q F3(tracefile)2.561 E F0 .062(for recording trace information.) +2.561 F .062(See the)5.062 F F2 .062(set tracefile)2.562 F F0 .062 +(command belo)2.562 F -.65(w.)-.25 G F2103.666 198 Q F0 .936 +(Speci\214es a user interf)143 198 R .936(ace similar to)-.1 F F1(rlogin)3.435 +E F0 4.37(\(1\). In)B .935(this mode, the escape character is set to the)3.435 +F(tilde \(~\) character)143 210 Q 2.5(,u)-.4 G +(nless modi\214ed by the -e option.)222.01 210 Q F2103.666 228 Q F0 -.45 +(Tu)143 228 S .123(rns on encryption of the data stream if possible.).45 F .124 +(This option is not a)5.124 F -.25(va)-.2 G .124(ilable outside of the Unit-) +.25 F(ed States and Canada.)143 240 Q F3(host)102 258 Q F0(Indicates the of)143 +258 Q(\214cial name, an alias, or the Internet address of a remote host.)-.25 E +F3(port)102 276 Q F0 1.96 +(Indicates a port number \(address of an application\).)143 276 R 1.96 +(If a number is not speci\214ed, the def)6.96 F(ault)-.1 E F2(telnet)143 288 Q +F0(port is used.)2.5 E .237(When in rlogin mode, a line of the form ~.)102 306 +R .238(disconnects from the remote host; ~ is the telnet escape character)5.237 +F(.)-.55 E(Similarly)102 318 Q 2.5(,t)-.65 G +(he line ~^Z suspends the telnet session.)146.36 318 Q +(The line ~^] escapes to the normal telnet escape prompt.)5 E 1.008 +(Once a connection has been opened,)102 336 R F2(telnet)3.507 E F0 1.007 +(will attempt to enable the)3.507 F F1 1.007(TELNET LINEMODE)3.507 F F0 3.507 +(option. If)3.507 F .73(this f)102 348 R .73(ails, then)-.1 F F2(telnet)3.23 E +F0 .73(will re)3.23 F -.15(ve)-.25 G .73(rt to one of tw).15 F 3.23(oi)-.1 G +.731(nput modes: either `)308.3 348 R .731(`character at a time')-.74 F 3.231 +('o)-.74 G 3.231(r`)483.277 348 S .731(`old line by)492.428 348 R(line')102 360 +Q 2.5('d)-.74 G(epending on what the remote system supports.)130.42 360 Q(When) +102 378 Q F1(LINEMODE)3.143 E F0 .642(is enabled, character processing is done\ + on the local system, under the control of the re-)3.143 F .123(mote system.) +102 390 R .123(When input editing or character echoing is to be disabled, the \ +remote system will relay that in-)5.123 F 3.397(formation. The)102 402 R .897 +(remote system will also relay changes to an)3.397 F 3.397(ys)-.15 G .897 +(pecial characters that happen on the remote)361.34 402 R(system, so that the) +102 414 Q 2.5(yc)-.15 G(an tak)187.68 414 Q 2.5(ee)-.1 G -.25(ff)223.12 414 S +(ect on the local system.).25 E(In `)102 432 Q(`character at a time')-.74 E 2.5 +('m)-.74 G(ode, most te)208.53 432 Q +(xt typed is immediately sent to the remote host for processing.)-.15 E .323 +(In `)102 450 R .323(`old line by line')-.74 F 2.823('m)-.74 G .323 +(ode, all te)196.845 450 R .323(xt is echoed locally)-.15 F 2.823(,a)-.65 G +.323(nd \(normally\) only completed lines are sent to the re-)324.073 450 R +.757(mote host.)102 462 R .757(The `)5.757 F .757(`local echo character')-.74 F +3.257('\()-.74 G .756(initially `)268.892 462 R(`^E')-.74 E .756 +('\) may be used to turn of)-.74 F 3.256(fa)-.25 G .756 +(nd on the local echo \(this)435.4 462 R -.1(wo)102 474 S +(uld mostly be used to enter passw).1 E(ords without the passw)-.1 E +(ord being echoed\).)-.1 E 1.076(If the)102 492 R F1(LINEMODE)3.576 E F0 1.076 +(option is enabled, or if the)3.576 F F2(localchars)3.577 E F0 1.077(toggle is) +3.577 F F1(TRUE)3.577 E F0 1.077(\(the def)3.577 F 1.077(ault for `)-.1 F 1.077 +(`old line by)-.74 F(line`)102 504 Q .866(`; see belo)-.74 F .866 +(w\), the user')-.25 F(s)-.55 E F2(quit)3.366 E F0(,)A F2(intr)3.366 E F0 3.366 +(,a)C(nd)285.042 504 Q F2(flush)3.365 E F0 .865(characters are trapped locally) +3.365 F 3.365(,a)-.65 G .865(nd sent as)461.472 504 R/F4 9/Times-Roman@0 SF +(TELNET)3.365 E F0 .368(protocol sequences to the remote side.)102 516 R(If) +5.368 E F1(LINEMODE)2.868 E F0 .368(has e)2.868 F -.15(ve)-.25 G 2.868(rb).15 G +.368(een enabled, then the user')363.23 516 R(s)-.55 E F2(susp)2.869 E F0(and) +2.869 E F2(eof)2.869 E F0 1.308(are also sent as)102 528 R F4(TELNET)3.808 E F0 +1.308(protocol sequences, and)3.808 F F2(quit)3.808 E F0 1.307(is sent as a) +3.807 F F1 1.307(TELNET ABORT)3.807 F F0 1.307(instead of)3.807 F F1(BREAK) +3.807 E F0 .474(There are options \(see)102 540 R F2 -3.026(toggle autoflush) +2.974 F F0(and)2.974 E F2 -3.026(toggle autosynch)2.974 F F0(belo)2.974 E .475 +(w\) which cause this action to)-.25 F .194 +(\215ush subsequent output to the terminal \(until the remote host ackno)102 +552 R .194(wledges the)-.25 F F4(TELNET)2.694 E F0 .193(sequence\) and \215ush) +2.693 F(pre)102 564 Q(vious terminal input \(in the case of)-.25 E F2(quit)2.5 +E F0(and)2.5 E F2(intr)2.5 E F0(\).)A .235(While connected to a remote host,) +102 582 R F2(telnet)2.735 E F0 .235(command mode may be entered by typing the) +2.735 F F2(telnet)2.735 E F0 -.74(``)2.735 G(escape).74 E(character')102 594 Q +2.5('\()-.74 G(initially `)150.39 594 Q(`^]')-.74 E 2.5('\). When)-.74 F +(in command mode, the normal terminal editing con)2.5 E -.15(ve)-.4 G +(ntions are a).15 E -.25(va)-.2 G(ilable.).25 E .018(The follo)102 612 R(wing) +-.25 E F2(telnet)2.518 E F0 .018(commands are a)2.518 F -.25(va)-.2 G 2.517 +(ilable. Only).25 F .017(enough of each command to uniquely identify it need) +2.517 F 2.478(be typed \(this is also true for ar)102 624 R 2.478 +(guments to the)-.18 F F2(mode)4.978 E F0(,)A F2(set)4.978 E F0(,)A F2(toggle) +4.978 E F0(,)A F2(unset)4.978 E F0(,)A F2(slc)4.978 E F0(,)A F2(environ)4.979 E +F0 4.979(,a)C(nd)530 624 Q F2(display)102 636 Q F0(commands\).)2.5 E F2(auth) +102 654 Q F3(argument ...)6 E F0 .308 +(The auth command manipulates the information sent through the)161 666 R F1 +.308(TELNET AUTHENTICATE)2.808 F F0 2.5(option. V)161 678 R(alid ar)-1.11 E +(guments for the auth command are as follo)-.18 E(ws:)-.25 E(4.2 Berk)72 750 Q +(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71(ution February)-.2 F +(3, 1994)2.5 E(2)535 750 Q EP +%%Page: 3 3 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R/F1 10/Courier-Bold@0 SF(disable) +161 96 Q/F2 10/Courier-Oblique@0 SF(type)6.76 E F0 .76 +(Disables the speci\214ed type of authentication.)5 F 2.36 -.8(To o)5.76 H .76 +(btain a list of a).8 F -.25(va)-.2 G(ilable).25 E(types, use the)238 108 Q F1 +(auth disable ?)2.5 E F0(command.)2.5 E F1(enable)161 126 Q F2(type)6.992 E F0 +.992(Enables the speci\214ed type of authentication.)238.992 126 R 2.592 -.8 +(To o)5.992 H .991(btain a list of a).8 F -.25(va)-.2 G(ilable).25 E +(types, use the)238 138 Q F1(auth enable ?)2.5 E F0(command.)2.5 E F1(status) +161 156 Q F0(Lists the current status of the v)238 156 Q +(arious types of authentication.)-.25 E F1(close)102 174 Q F0(Close a)161 174 Q +/F3 9/Times-Roman@0 SF(TELNET)2.5 E F0(session and return to command mode.)2.5 +E F1(display)102 192 Q F2(argument ...)6 E F0(Displays all, or some, of the)161 +204 Q F1(set)2.5 E F0(and)2.5 E F1(toggle)2.5 E F0 -.25(va)2.5 G +(lues \(see belo).25 E(w\).)-.25 E F1(encrypt)102 222 Q F2(argument ...)6 E F0 +.407(The encrypt command manipulates the information sent through the)161 234 R +/F4 10/Courier@0 SF .408(TELNET ENCRYPT)2.908 F F0(op-)2.908 E(tion.)161 246 Q +2.856(Note: Because)161 264 R .356(of e)2.856 F .356(xport controls, the)-.15 F +F4 .355(TELNET ENCRYPT)2.855 F F0 .355(option is not supported outside of)2.855 +F(the United States and Canada.)161 276 Q -1.11(Va)161 294 S(lid ar)1.11 E +(guments for the encrypt command are as follo)-.18 E(ws:)-.25 E F1(disable)161 +312 Q F2(type)6 E F1([input|output])6 E F0 1.099 +(Disables the speci\214ed type of encryption.)226 324 R 1.099 +(If you omit the input and output,)6.099 F .357 +(both input and output are disabled.)226 336 R 1.957 -.8(To o)5.357 H .357 +(btain a list of a).8 F -.25(va)-.2 G .357(ilable types, use the).25 F F1 +(encrypt disable ?)226 348 Q F0(command.)2.5 E F1(enable)161 366 Q F2(type)6 E +F1([input|output])6 E F0 .867(Enables the speci\214ed type of encryption.)226 +378 R .868(If you omit input and output, both)5.867 F 2.117 +(input and output are enabled.)226 390 R 3.716 -.8(To o)7.116 H 2.116 +(btain a list of a).8 F -.25(va)-.2 G 2.116(ilable types, use the).25 F F1 +(encrypt enable ?)226 402 Q F0(command.)2.5 E F1(input)161 420 Q F0 +(This is the same as the)226 420 Q F1(encrypt start input)2.5 E F0(command.)2.5 +E F1(-input)161 438 Q F0(This is the same as the)226 438 Q F1 +(encrypt stop input)2.5 E F0(command.)2.5 E F1(output)161 456 Q F0 +(This is the same as the)226 456 Q F1(encrypt start output)2.5 E F0(command.) +2.5 E F1(-output)161 474 Q F0(This is the same as the)226 474 Q F1 +(encrypt stop output)2.5 E F0(command.)2.5 E F1(start [input|output])161 492 Q +F0 1.116(Attempts to start encryption.)226 504 R 1.116(If you omit)6.116 F F1 +(input)3.616 E F0(and)3.617 E F1(output,)3.617 E F0 1.117(both input)3.617 F +.467(and output are enabled.)226 516 R 2.067 -.8(To o)5.467 H .467 +(btain a list of a).8 F -.25(va)-.2 G .467(ilable types, use the).25 F F1 +(encrypt)2.966 E(enable ?)226 528 Q F0(command.)2.5 E F1(status)161 546 Q F0 +(Lists the current status of encryption.)226 546 Q F1(stop [input|output])161 +564 Q F0 1.096(Stops encryption.)226 576 R 1.097 +(If you omit input and output, encryption is on both input)6.096 F(and output.) +226 588 Q F1(type)161 606 Q F2(type)6.121 E F0 .121(Sets the def)226.121 606 R +.121(ault type of encryption to be used with later)-.1 F F1 .12(encrypt start) +2.62 F F0(or)2.62 E F1(encrypt stop)226 618 Q F0(commands.)2.5 E F1(environ)102 +636 Q F2(arguments...)6 E F0(The)161 648 Q F1(environ)3.189 E F0 .689 +(command is used to manipulate the the v)3.189 F .69 +(ariables that my be sent through the)-.25 F F4 .552(TELNET ENVIRON)161 660 R +F0 3.052(option. The)3.052 F .552(initial set of v)3.052 F .551 +(ariables is tak)-.25 F .551(en from the users en)-.1 F(vironment,)-.4 E .501 +(with only the)161 672 R F4(DISPLAY)3.001 E F0(and)3.001 E F4(PRINTER)3.001 E +F0 -.25(va)3.001 G .502(riables being e).25 F .502(xported by def)-.15 F 3.002 +(ault. The)-.1 F F4(USER)3.002 E F0 -.25(va)3.002 G(ri-).25 E(able is also e) +161 684 Q(xported if the)-.15 E F14.166 E F0(or)2.5 E F14.166 E F0 +(options are used.)2.5 E(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib) +132.57 750 Q 95.71(ution February)-.2 F(3, 1994)2.5 E(3)535 750 Q EP +%%Page: 4 4 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R -1.11(Va)161 96 S(lid ar)1.11 E +(guments for the)-.18 E/F1 10/Courier-Bold@0 SF(environ)2.5 E F0(command are:) +2.5 E F1(define)161 114 Q/F2 10/Courier-Oblique@0 SF(variable value)6 E F0 +1.082(De\214ne the v)216 126 R(ariable)-.25 E F2(variable)3.582 E F0 1.082 +(to ha)3.582 F 1.382 -.15(ve a v)-.2 H 1.082(alue of)-.1 F F2(value.)3.581 E F0 +(An)3.581 E 3.581(yv)-.15 G 1.081(ariables de-)492.549 126 R 1.922 +(\214ned by this command are automatically e)216 138 R 4.422(xported. The)-.15 +F F2(value)4.422 E F0 1.922(may be en-)4.422 F +(closed in single or double quotes so that tabs and spaces may be included.)216 +150 Q F1(undefine)161 168 Q F2(variable)6 E F0(Remo)216 180 Q -.15(ve)-.15 G F2 +(variable)2.65 E F0(from the list of en)2.5 E(vironment v)-.4 E(ariables.)-.25 +E F1(export)161 198 Q F2(variable)6 E F0(Mark the v)216 210 Q(ariable)-.25 E F2 +(variable)2.5 E F0(to be e)2.5 E(xported to the remote side.)-.15 E F1 +(unexport)161 228 Q F2(variable)6 E F0 .697(Mark the v)216 240 R(ariable)-.25 E +F2(variable)3.197 E F0 .697(to not be e)3.197 F .697(xported unless e)-.15 F +.696(xplicitly ask)-.15 F .696(ed for by)-.1 F(the remote side.)216 252 Q F1 +(list)161 270 Q F0 1.416(List the current set of en)216 270 R 1.416 +(vironment v)-.4 F 3.916(ariables. Those)-.25 F(mark)3.916 E 1.416(ed with a) +-.1 F/F3 10/Symbol SF(*)3.916 E F0 1.417(will be)3.917 F(sent automatically)216 +282 Q 2.5(,o)-.65 G(ther v)298.4 282 Q(ariables will only be sent if e)-.25 E +(xplicitly requested.)-.15 E F1(?)161 300 Q F0 +(Prints out help information for the)216 300 Q F1(environ)2.5 E F0(command.)2.5 +E F1(logout)102 318 Q F0 .104(Sends the)161 318 R/F4 10/Courier@0 SF .104 +(TELNET LOGOUT)2.604 F F0 .104(option to the remote side.)2.604 F .104 +(This command is similar to a)5.104 F F1(close)2.604 E F0 .228(command; ho)161 +330 R(we)-.25 E -.15(ve)-.25 G 1.028 -.4(r, i).15 H 2.728(ft).4 G .228 +(he remote side does not support the)256.174 330 R F4(LOGOUT)2.729 E F0 .229 +(option, nothing happens.)2.729 F .233(If, ho)161 342 R(we)-.25 E -.15(ve)-.25 +G 1.033 -.4(r, t).15 H .233(he remote side does support the).4 F F4(LOGOUT) +2.733 E F0 .233(option, this command should cause the)2.733 F .652 +(remote side to close the)161 354 R/F5 9/Times-Roman@0 SF(TELNET)3.152 E F0 +3.152(connection. If)3.152 F .653(the remote side also supports the concept of) +3.152 F 1.904(suspending a user')161 366 R 4.404(ss)-.55 G 1.903 +(ession for later reattachment, the logout ar)250.872 366 R 1.903 +(gument indicates that you)-.18 F(should terminate the session immediately)161 +378 Q(.)-.65 E F1(mode)102 396 Q F2 -1(type Type)6.889 F F0 .889(is one of se) +3.389 F -.15(ve)-.25 G .889(ral options, depending on the state of the).15 F F5 +(TELNET)3.389 E F0 3.39(session. The)3.39 F(remote)3.39 E .882(host is ask)161 +408 R .881(ed for permission to go into the requested mode.)-.1 F .881 +(If the remote host is capable of)5.881 F +(entering that mode, the requested mode will be entered.)161 420 Q F1 +(character)161 438 Q F0 .715(Disable the)226 438 R F4 .716(TELNET LINEMODE) +3.215 F F0 .716(option, or)3.216 F 3.216(,i)-.4 G 3.216(ft)416.834 438 S .716 +(he remote side does not un-)426.16 438 R(derstand the)226 450 Q F4(LINEMODE) +2.5 E F0(option, then enter `)2.5 E(`character at a time`)-.74 E 2.5(`m)-.74 G +(ode.)496.07 450 Q F1(line)161 468 Q F0 .948(Enable the)226 468 R F4 .948 +(TELNET LINEMODE)3.448 F F0 .948(option, or)3.448 F 3.448(,i)-.4 G 3.447(ft) +415.448 468 S .947(he remote side does not un-)425.005 468 R 2.78(derstand the) +226 480 R F4(LINEMODE)5.28 E F0 2.78(option, then attempt to enter `)5.28 F +(`old-line-by-line`)-.74 E(`)-.74 E(mode.)226 492 Q F1(isig)161 510 Q F0(\() +7.666 E F1(\255isig)1.666 E F0(\))1.666 E 1.43 +(Attempt to enable \(disable\) the)226 522 R F4(TRAPSIG)3.93 E F0 1.43 +(mode of the)3.93 F F4(LINEMODE)3.93 E F0(option.)3.93 E +(This requires that the)226 534 Q F4(LINEMODE)2.5 E F0(option be enabled.)2.5 E +F1(edit)161 552 Q F0(\()7.666 E F1(\255edit)1.666 E F0(\))1.666 E .865 +(Attempt to enable \(disable\) the)226 564 R F4(EDIT)3.365 E F0 .866 +(mode of the)3.365 F F4(LINEMODE)3.366 E F0 3.366(option. This)3.366 F +(requires that the)226 576 Q F4(LINEMODE)2.5 E F0(option be enabled.)2.5 E F1 +(softtabs)161 594 Q F0(\()7.666 E F1(\255softtabs)1.666 E F0(\))1.666 E .83 +(Attempt to enable \(disable\) the)226 606 R F4(SOFT_TAB)3.33 E F0 .83 +(mode of the)3.33 F F4(LINEMODE)3.33 E F0(option.)3.33 E +(This requires that the)226 618 Q F4(LINEMODE)2.5 E F0(option be enabled.)2.5 E +F1(litecho)161 636 Q F0(\()7.666 E F1(\255litecho)1.666 E F0(\))1.666 E .83 +(Attempt to enable \(disable\) the)226 648 R F4(LIT_ECHO)3.33 E F0 .83 +(mode of the)3.33 F F4(LINEMODE)3.33 E F0(option.)3.33 E +(This requires that the)226 660 Q F4(LINEMODE)2.5 E F0(option be enabled.)2.5 E +F1(?)161 678 Q F0(Prints out help information for the)226 678 Q F1(mode)2.5 E +F0(command.)2.5 E(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q +95.71(ution February)-.2 F(3, 1994)2.5 E(4)535 750 Q EP +%%Page: 5 5 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R/F1 10/Courier-Bold@0 SF(open)102 +102 Q/F2 10/Courier-Oblique@0 SF(host)6 E F0 .833([[)2.5 G F11.666 E F0 +(]).833 E F2(user)6 E F0(][)A F11.666 E F2(port)A F0(])A .207 +(Open a connection to the named host.)161 114 R .207 +(If no port number is speci\214ed,)5.207 F F1(telnet)2.707 E F0 .206 +(will attempt to)2.707 F .263(contact a)161 126 R/F3 9/Times-Roman@0 SF(TELNET) +2.763 E F0(serv)2.763 E .263(er at the def)-.15 F .263(ault port.)-.1 F .264 +(The host speci\214cation may be either a host name)5.264 F(\(see)161 138 Q/F4 +10/Courier@0 SF(hosts)3.531 E F0 4.562(\(5\)\) or)B 1.031 +(an Internet address speci\214ed in the `)3.531 F 1.03(`dot notation')-.74 F +3.53('\()-.74 G(see)459.6 138 Q F4(inet)3.53 E F0 4.56(\(3\)\). The)B([)161.833 +150 Q F12.499 E F0 3.03(]o).833 G .531(ption may be used to specify the \ +user name to be passed to the remote system via the)191.855 150 R F4(ENVIRON) +161 162 Q F0 3.971(option. When)3.971 F 1.471 +(connecting to a non-standard port,)3.971 F F1(telnet)3.971 E F0 1.471 +(omits an)3.971 F 3.97(ya)-.15 G(utomatic)505 162 Q .631(initiation of)161 174 +R F3(TELNET)3.131 E F0 3.131(options. When)3.131 F .631 +(the port number is preceded by a minus sign, the initial)3.131 F .441 +(option ne)161 186 R .441(gotiation is done.)-.15 F .441 +(After establishing a connection, the \214le)5.441 F F4(.telnetrc)2.941 E F0 +.44(in the users)2.94 F .928(home directory is opened.)161 198 R .928(Lines be) +5.928 F .928(ginning with a # are comment lines.)-.15 F .928 +(Blank lines are ig-)5.928 F 3.255(nored. Lines)161 210 R .755(that be)3.255 F +.755(gin without white space are the start of a machine entry)-.15 F 5.755(.T) +-.65 G .755(he \214rst thing)487.93 210 R .022 +(on the line is the name of the machine that is being connected to.)161 222 R +.023(The rest of the line, and suc-)5.023 F(cessi)161 234 Q .856 -.15(ve l)-.25 +H .556(ines that be).15 F .556(gin with white space are assumed to be)-.15 F F1 +(telnet)3.056 E F0 .556(commands and are pro-)3.056 F(cessed as if the)161 246 +Q 2.5(yh)-.15 G(ad been typed in manually to the)233.61 246 Q F1(telnet)2.5 E +F0(command prompt.)2.5 E F1(quit)102 264 Q F0 .114(Close an)161 264 R 2.614(yo) +-.15 G(pen)208.298 264 Q F3(TELNET)2.614 E F0 .115(session and e)2.615 F(xit) +-.15 E F1(telnet)2.615 E F0 2.615(.A)C 2.615(ne)376.32 264 S .115 +(nd of \214le \(in command mode\) will al-)388.375 264 R +(so close a session and e)161 276 Q(xit.)-.15 E F1(send)102 294 Q F2(arguments) +6 E F0 .024(Sends one or more special character sequences to the remote host.) +161 306 R .024(The follo)5.024 F .024(wing are the ar)-.25 F(gu-)-.18 E +(ments which may be speci\214ed \(more than one ar)161 318 Q +(gument may be speci\214ed at a time\):)-.18 E F1(abort)161 336 Q F0(Sends the) +202 336 Q F4(TELNET ABORT)2.5 E F0(\(Abort processes\) sequence.)2.5 E F1(ao) +161 354 Q F0 1.15(Sends the)202 354 R F4 1.151(TELNET AO)3.651 F F0 1.151 +(\(Abort Output\) sequence, which should cause the remote)3.651 F +(system to \215ush all output)202 366 Q/F5 10/Times-Italic@0 SF(fr)2.5 E(om) +-.45 E F0(the remote system)2.5 E F5(to)2.5 E F0(the user')2.5 E 2.5(st)-.55 G +(erminal.)454.89 366 Q F1(ayt)161 384 Q F0 1.18(Sends the)202 384 R F4 1.18 +(TELNET AYT)3.68 F F0 1.18(\(Are Y)3.68 F 1.18 +(ou There\) sequence, to which the remote system)-1.1 F +(may or may not choose to respond.)202 396 Q F1(brk)161 414 Q F0 .47(Sends the) +202 414 R F4 .47(TELNET BRK)2.97 F F0 .47(\(Break\) sequence, which may ha)2.97 +F .77 -.15(ve s)-.2 H .47(igni\214cance to the re-).15 F(mote system.)202 426 Q +F1(ec)161 444 Q F0 .245(Sends the)202 444 R F4 .245(TELNET EC)2.745 F F0 .244 +(\(Erase Character\) sequence, which should cause the remote)2.745 F +(system to erase the last character entered.)202 456 Q F1(el)161 474 Q F0 .385 +(Sends the)202 474 R F4 .385(TELNET EL)2.885 F F0 .385 +(\(Erase Line\) sequence, which should cause the remote sys-)2.885 F +(tem to erase the line currently being entered.)202 486 Q F1(eof)161 504 Q F0 +(Sends the)202 504 Q F4(TELNET EOF)2.5 E F0(\(End Of File\) sequence.)2.5 E F1 +(eor)161 522 Q F0(Sends the)202 522 Q F4(TELNET EOR)2.5 E F0 +(\(End of Record\) sequence.)2.5 E F1(escape)161 540 Q F0(Sends the current)5 E +F1(telnet)2.5 E F0(escape character \(initially `)2.5 E(`^')-.74 E('\).)-.74 E +F1(ga)161 558 Q F0 .855(Sends the)202 558 R F4 .855(TELNET GA)3.355 F F0 .855 +(\(Go Ahead\) sequence, which lik)3.355 F .855(ely has no signi\214cance to)-.1 +F(the remote system.)202 570 Q F1(getstatus)161 588 Q F0 1.713 +(If the remote side supports the)202 600 R F4 1.713(TELNET STATUS)4.213 F F0 +(command,)4.213 E F1(getstatus)4.213 E F0(will)4.213 E(send the subne)202 612 Q +(gotiation to request that the serv)-.15 E(er send its current option status.) +-.15 E F1(ip)161 630 Q F0 1.355(Sends the)202 630 R F4 1.355(TELNET IP)3.855 F +F0 1.354(\(Interrupt Process\) sequence, which should cause the re-)3.855 F +(mote system to abort the currently running process.)202 642 Q F1(nop)161 660 Q +F0(Sends the)202 660 Q F4(TELNET NOP)2.5 E F0(\(No OPeration\) sequence.)2.5 E +F1(susp)161 678 Q F0(Sends the)202 678 Q F4(TELNET SUSP)2.5 E F0 +(\(SUSPend process\) sequence.)2.5 E(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G +(istrib)132.57 750 Q 95.71(ution February)-.2 F(3, 1994)2.5 E(5)535 750 Q EP +%%Page: 6 6 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R/F1 10/Courier-Bold@0 SF(synch) +161 96 Q F0 .65(Sends the)202 96 R/F2 10/Courier@0 SF .651(TELNET SYNCH)3.151 F +F0 3.151(sequence. This)3.151 F .651(sequence causes the remote system to)3.151 +F .777(discard all pre)202 108 R .777(viously typed \(b)-.25 F .777 +(ut not yet read\) input.)-.2 F .776(This sequence is sent as)5.777 F/F3 9 +/Times-Roman@0 SF(TCP)3.276 E F0(ur)202 120 Q 1.665(gent data \(and may not w) +-.18 F 1.665(ork if the remote system is a 4.2)-.1 F F3(BSD)A F0 1.666 +(system -- if it)4.166 F(doesn')202 132 Q 2.5(tw)-.18 G(ork, a lo)240.88 132 Q +(wer case `)-.25 E(`r')-.74 E 2.5('m)-.74 G(ay be echoed on the terminal\).) +336.33 132 Q F1(do)161 150 Q/F4 10/Courier-Oblique@0 SF(cmd)6 E F1(dont)161 168 +Q F4(cmd)6 E F1(will)161 186 Q F4(cmd)6 E F1(wont)161 204 Q F4(cmd)6 E F0 1.134 +(Sends the)202 216 R F2 1.133(TELNET DO)3.633 F F4(cmd)3.633 E F0(sequence.) +3.633 E F4(Cmd)6.133 E F0 1.133(can be either a decimal number be-)3.633 F .865 +(tween 0 and 255, or a symbolic name for a speci\214c)202 228 R F2(TELNET)3.365 +E F0(command.)3.365 E F4(Cmd)5.865 E F0(can)3.365 E 1.181(also be either)202 +240 R F1(help)3.681 E F0(or)3.681 E F1(?)3.681 E F0 1.18 +(to print out help information, including a list of kno)3.681 F(wn)-.25 E +(symbolic names.)202 252 Q F1(?)161 270 Q F0 +(Prints out help information for the)202 270 Q F1(send)2.5 E F0(command.)2.5 E +F1(set)102 288 Q F4(argument value)6 E F1(unset)102 306 Q F4(argument value)6 E +F0(The)161 318 Q F1(set)2.601 E F0 .101(command will set an)2.601 F 2.601(yo) +-.15 G .101(ne of a number of)295.556 318 R F1(telnet)2.601 E F0 -.25(va)2.601 +G .101(riables to a speci\214c v).25 F .102(alue or to)-.25 F F2(TRUE)161 330 Q +F0 2.722(.T)C .222(he special v)196.332 330 R(alue)-.25 E F1(off)2.722 E F0 +.222(turns of)2.722 F 2.722(ft)-.25 G .222(he function associated with the v) +323.474 330 R .222(ariable, this is equi)-.25 F(v-)-.25 E .37 +(alent to using the)161 342 R F1(unset)2.87 E F0 2.871(command. The)2.87 F F1 +(unset)2.871 E F0 .371(command will disable or set to)2.871 F F2(FALSE)2.871 E +F0(an)2.871 E(y)-.15 E 1.248(of the speci\214ed functions.)161 354 R 1.248 +(The v)6.248 F 1.248(alues of v)-.25 F 1.248(ariables may be interrog)-.25 F +1.247(ated with the)-.05 F F1(display)3.747 E F0 2.886(command. The)161 366 R +-.25(va)2.886 G .386(riables which may be set or unset, b).25 F .386 +(ut not toggled, are listed here.)-.2 F .387(In addi-)5.387 F .763(tion, an)161 +378 R 3.263(yo)-.15 G 3.263(ft)204.876 378 S .763(he v)214.249 378 R .763 +(ariables for the)-.25 F F1(toggle)3.263 E F0 .762(command may be e)3.263 F +.762(xplicitly set or unset using the)-.15 F F1(set)161 390 Q F0(and)2.5 E F1 +(unset)2.5 E F0(commands.)2.5 E F1(ayt)161 408 Q F0(If)202 408 Q F3(TELNET) +2.689 E F0 .189(is in localchars mode, or)2.689 F F2(LINEMODE)2.689 E F0 .189 +(is enabled, and the status character)2.689 F 1.056(is typed, a)202 420 R F2 +1.056(TELNET AYT)3.556 F F0 1.056(sequence \(see)3.556 F F1 1.056(send ayt) +3.556 F F0 1.055(preceding\) is sent to the re-)3.556 F .327(mote host.)202 432 +R .328(The initial v)5.327 F .328(alue for the "Are Y)-.25 F .328 +(ou There" character is the terminal')-1.1 F 2.828(ss)-.55 G(ta-)529.45 432 Q +(tus character)202 444 Q(.)-.55 E F1(echo)161 462 Q F0 .805(This is the v)202 +462 R .805(alue \(initially `)-.25 F(`^E')-.74 E .804('\) which, when in `)-.74 +F .804(`line by line')-.74 F 3.304('m)-.74 G .804(ode, toggles be-)474.792 462 +R .988(tween doing local echoing of entered characters \(for normal processing\ +\), and sup-)202 474 R +(pressing echoing of entered characters \(for entering, say)202 486 Q 2.5(,ap) +-.65 G(assw)442.66 486 Q(ord\).)-.1 E F1(eof)161 504 Q F0(If)202 504 Q F1 +(telnet)3.864 E F0 1.364(is operating in)3.864 F F2(LINEMODE)3.864 E F0 1.364 +(or `)3.864 F 1.364(`old line by line')-.74 F 3.864('m)-.74 G 1.363 +(ode, entering this)468.114 504 R .199(character as the \214rst character on a\ + line will cause this character to be sent to the re-)202 516 R .12 +(mote system.)202 528 R .12(The initial v)5.12 F .119 +(alue of the eof character is tak)-.25 F .119(en to be the terminal')-.1 F(s) +-.55 E F1(eof)2.619 E F0(character)202 540 Q(.)-.55 E F1(erase)161 558 Q F0(If) +202 558 Q F1(telnet)3.12 E F0 .62(is in)3.12 F F1(localchars)3.12 E F0 .62 +(mode \(see)3.12 F F1 -2.88(toggle localchars)3.12 F F0(belo)3.12 E(w\),)-.25 E +/F5 10/Times-Bold@0 SF(and)3.12 E F0(if)3.12 E F1(telnet)202 570 Q F0 1.385 +(is operating in `)3.885 F 1.385(`character at a time')-.74 F 3.885('m)-.74 G +1.384(ode, then when this character is)407 570 R .417(typed, a)202 582 R F2 +.418(TELNET EC)2.917 F F0 .418(sequence \(see)2.918 F F1 -3.082(send ec)2.918 F +F0(abo)2.918 E -.15(ve)-.15 G 2.918(\)i).15 G 2.918(ss)427.36 582 S .418 +(ent to the remote system.)438.058 582 R .325(The initial v)202 594 R .325 +(alue for the erase character is tak)-.25 F .325(en to be the terminal')-.1 F +(s)-.55 E F1(erase)2.825 E F0(charac-)2.825 E(ter)202 606 Q(.)-.55 E F1(escape) +161 624 Q F0 2.873(This is the)5 F F1(telnet)5.373 E F0 2.874 +(escape character \(initially `)5.373 F(`^[')-.74 E 2.874 +('\) which causes entry into)-.74 F F1(telnet)202 636 Q F0 +(command mode \(when connected to a remote system\).)2.5 E F1(flushoutput)161 +654 Q F0(If)202 666 Q F1(telnet)2.945 E F0 .445(is in)2.945 F F1(localchars) +2.945 E F0 .445(mode \(see)2.945 F F1 -3.056(toggle localchars)2.944 F F0(belo) +2.944 E .444(w\) and the)-.25 F F1(flushoutput)202 678 Q F0 .442 +(character is typed, a)2.942 F F2 .443(TELNET AO)2.943 F F0 .443 +(sequence \(see)2.943 F F1 -3.057(send ao)2.943 F F0(abo)2.943 E -.15(ve)-.15 G +(\)).15 E .314(is sent to the remote host.)202 690 R .314(The initial v)5.314 F +.314(alue for the \215ush character is tak)-.25 F .314(en to be the)-.1 F +(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71 +(ution February)-.2 F(3, 1994)2.5 E(6)535 750 Q EP +%%Page: 7 7 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R(terminal')202 96 Q(s)-.55 E/F1 +10/Courier-Bold@0 SF(flush)2.5 E F0(character)2.5 E(.)-.55 E F1(forw1)161 114 Q +(forw2)161 132 Q F0(If)202 132 Q/F2 9/Times-Roman@0 SF(TELNET)3.769 E F0 1.269 +(is operating in)3.769 F/F3 10/Courier@0 SF(LINEMODE)3.77 E F0 3.77(,t)C 1.27 +(hese are the characters that, when typed,)370.77 132 R .958 +(cause partial lines to be forw)202 144 R .958(arded to the remote system.)-.1 +F .958(The initial v)5.958 F .957(alue for the)-.25 F(forw)202 156 Q +(arding characters are tak)-.1 E(en from the terminal')-.1 E 2.5(se)-.55 G +(ol and eol2 characters.)414.23 156 Q F1(interrupt)161 174 Q F0(If)202 186 Q F1 +(telnet)2.944 E F0 .444(is in)2.944 F F1(localchars)2.944 E F0 .445(mode \(see) +2.944 F F1 -3.055(toggle localchars)2.945 F F0(belo)2.945 E .445(w\) and the) +-.25 F F1(interrupt)202 198 Q F0 .642(character is typed, a)3.142 F F3 .642 +(TELNET IP)3.142 F F0 .642(sequence \(see)3.142 F F1 -2.859(send ip)3.141 F F0 +(abo)3.141 E -.15(ve)-.15 G 3.141(\)i).15 G(s)536.11 198 Q .949 +(sent to the remote host.)202 210 R .949(The initial v)5.949 F .949 +(alue for the interrupt character is tak)-.25 F .95(en to be)-.1 F +(the terminal')202 222 Q(s)-.55 E F1(intr)2.5 E F0(character)2.5 E(.)-.55 E F1 +(kill)161 240 Q F0(If)202 240 Q F1(telnet)2.95 E F0 .449(is in)2.949 F F1 +(localchars)2.949 E F0 .449(mode \(see)2.949 F F1 -3.051(toggle localchars) +2.949 F F0(belo)2.949 E(w\),)-.25 E F1(and)2.949 E F0(if)2.949 E F1(telnet)202 +252 Q F0 1.384(is operating in `)3.884 F 1.385(`character at a time')-.74 F +3.885('m)-.74 G 1.385(ode, then when this character is)406.995 252 R .418 +(typed, a)202 264 R F3 .418(TELNET EL)2.918 F F0 .418(sequence \(see)2.918 F F1 +-3.082(send el)2.918 F F0(abo)2.918 E -.15(ve)-.15 G 2.918(\)i).15 G 2.918(ss) +427.362 264 S .418(ent to the remote system.)438.06 264 R(The initial v)202 276 +Q(alue for the kill character is tak)-.25 E(en to be the terminal')-.1 E(s)-.55 +E F1(kill)2.5 E F0(character)2.5 E(.)-.55 E F1(lnext)161 294 Q F0(If)202 294 Q +F1(telnet)2.597 E F0 .097(is operating in)2.597 F F3(LINEMODE)2.597 E F0 .097 +(or `)2.597 F .097(`old line by line`)-.74 F 2.597(`m)-.74 G .098 +(ode, then this charac-)454.177 294 R 1.405(ter is tak)202 306 R 1.405 +(en to be the terminal')-.1 F(s)-.55 E F1(lnext)3.904 E F0(character)3.904 E +6.404(.T)-.55 G 1.404(he initial v)422.56 306 R 1.404(alue for the lne)-.25 F +(xt)-.15 E(character is tak)202 318 Q(en to be the terminal')-.1 E(s)-.55 E F1 +(lnext)2.5 E F0(character)2.5 E(.)-.55 E F1(quit)161 336 Q F0(If)202 336 Q F1 +(telnet)2.944 E F0 .444(is in)2.944 F F1(localchars)2.944 E F0 .445(mode \(see) +2.944 F F1 -3.055(toggle localchars)2.945 F F0(belo)2.945 E .445(w\) and the) +-.25 F F1(quit)202 348 Q F0 .546(character is typed, a)3.046 F F3 .545 +(TELNET BRK)3.046 F F0 .545(sequence \(see)3.045 F F1 -2.955(send brk)3.045 F +F0(abo)3.045 E -.15(ve)-.15 G 3.045(\)i).15 G 3.045(ss)516.955 348 S(ent)527.78 +348 Q .629(to the remote host.)202 360 R .629(The initial v)5.629 F .629 +(alue for the quit character is tak)-.25 F .63(en to be the termi-)-.1 F(nal') +202 372 Q(s)-.55 E F1(quit)2.5 E F0(character)2.5 E(.)-.55 E F1(reprint)161 390 +Q F0(If)202 402 Q F1(telnet)2.598 E F0 .097(is operating in)2.598 F F3 +(LINEMODE)2.597 E F0 .097(or `)2.597 F .097(`old line by line`)-.74 F 2.597(`m) +-.74 G .097(ode, then this charac-)454.179 402 R .06(ter is tak)202 414 R .06 +(en to be the terminal')-.1 F(s)-.55 E F1(reprint)2.561 E F0(character)2.561 E +5.061(.T)-.55 G .061(he initial v)422.465 414 R .061(alue for the reprint)-.25 +F(character is tak)202 426 Q(en to be the terminal')-.1 E(s)-.55 E F1(reprint) +2.5 E F0(character)2.5 E(.)-.55 E F1(rlogin)161 444 Q F0 .956 +(This is the rlogin escape character)5 F 5.956(.I)-.55 G 3.456(fs)354.366 444 S +.956(et, the normal)365.042 444 R F2(TELNET)3.456 E F0 .956 +(escape character is)3.456 F .357 +(ignored unless it is preceded by this character at the be)202 456 R .358 +(ginning of a line.)-.15 F .358(This char)5.358 F(-)-.2 E(acter)202 468 Q 3.14 +(,a)-.4 G 3.14(tt)231.11 468 S .64(he be)239.81 468 R .64 +(ginning of a line follo)-.15 F .639(wed by a ".")-.25 F .639 +(closes the connection; when fol-)5.639 F(lo)202 480 Q 1.31 +(wed by a ^Z it suspends the telnet command.)-.25 F 1.311 +(The initial state is to disable the)6.311 F(rlogin escape character)202 492 Q +(.)-.55 E F1(start)161 510 Q F0 2.232(If the)202 510 R F3 2.231 +(TELNET TOGGLE-FLOW-CONTROL)4.731 F F0 2.231 +(option has been enabled, then this)4.731 F .005(character is tak)202 522 R +.005(en to be the terminal')-.1 F(s)-.55 E F1(start)2.506 E F0(character)2.506 +E 5.006(.T)-.55 G .006(he initial v)436.06 522 R .006(alue for the kill)-.25 F +(character is tak)202 534 Q(en to be the terminal')-.1 E(s)-.55 E F1(start)2.5 +E F0(character)2.5 E(.)-.55 E F1(stop)161 552 Q F0 2.232(If the)202 552 R F3 +2.231(TELNET TOGGLE-FLOW-CONTROL)4.731 F F0 2.231 +(option has been enabled, then this)4.731 F .434(character is tak)202 564 R +.434(en to be the terminal')-.1 F(s)-.55 E F1(stop)2.934 E F0(character)2.934 E +5.434(.T)-.55 G .434(he initial v)433.916 564 R .435(alue for the kill)-.25 F +(character is tak)202 576 Q(en to be the terminal')-.1 E(s)-.55 E F1(stop)2.5 E +F0(character)2.5 E(.)-.55 E F1(susp)161 594 Q F0(If)202 594 Q F1(telnet)2.576 E +F0 .076(is in)2.576 F F1(localchars)2.576 E F0 .076(mode, or)2.576 F F3 +(LINEMODE)2.576 E F0 .076(is enabled, and the)2.576 F F1(suspend)2.575 E F0 .87 +(character is typed, a)202 606 R F3 .87(TELNET SUSP)3.37 F F0 .87 +(sequence \(see)3.37 F F1 -2.63(send susp)3.37 F F0(abo)3.37 E -.15(ve)-.15 G +3.37(\)i).15 G 3.37(ss)505.48 606 S .87(ent to)516.63 606 R .246 +(the remote host.)202 618 R .246(The initial v)5.246 F .246 +(alue for the suspend character is tak)-.25 F .246(en to be the termi-)-.1 F +(nal')202 630 Q(s)-.55 E F1(suspend)2.5 E F0(character)2.5 E(.)-.55 E F1 +(tracefile)161 648 Q F0 .537(This is the \214le to which the output, caused by) +202 660 R F1(netdata)3.037 E F0(or)3.037 E F1(option)3.037 E F0 .538 +(tracing being)3.038 F F3(TRUE)202 672 Q F0 3.079(,w)C .579(ill be written.) +238.799 672 R .579(If it is set to `)5.579 F(`)-.74 E F11.666 E F0 -.74('') +1.666 G 3.078(,t).74 G .578(hen tracing information will be written)381.85 672 +R(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71 +(ution February)-.2 F(3, 1994)2.5 E(7)535 750 Q EP +%%Page: 8 8 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R(to standard output \(the def)202 +96 Q(ault\).)-.1 E/F1 10/Courier-Bold@0 SF(worderase)161 114 Q F0(If)202 126 Q +F1(telnet)2.597 E F0 .097(is operating in)2.597 F/F2 10/Courier@0 SF(LINEMODE) +2.597 E F0 .097(or `)2.597 F .097(`old line by line`)-.74 F 2.597(`m)-.74 G +.098(ode, then this charac-)454.177 126 R 1.386(ter is tak)202 138 R 1.386 +(en to be the terminal')-.1 F(s)-.55 E F1(worderase)3.885 E F0(character)3.885 +E 6.385(.T)-.55 G 1.385(he initial v)446.39 138 R 1.385(alue for the)-.25 F -.1 +(wo)202 150 S(rderase character is tak).1 E(en to be the terminal')-.1 E(s)-.55 +E F1(worderase)2.5 E F0(character)2.5 E(.)-.55 E F1(?)161 168 Q F0 +(Displays the le)202 168 Q -.05(ga)-.15 G(l).05 E F1(set)2.5 E F0(\()4.166 E F1 +(unset)1.666 E F0 4.166(\)c)1.666 G(ommands.)346.724 168 Q F1(slc)102 186 Q/F3 +10/Courier-Oblique@0 SF(state)6.383 E F0(The)5 E F1(slc)2.883 E F0 .384(comman\ +d \(Set Local Characters\) is used to set or change the state of the the speci\ +al)2.884 F 1.231(characters when the)161 198 R F2 1.231(TELNET LINEMODE)3.731 F +F0 1.231(option has been enabled.)3.731 F 1.231(Special characters are)6.231 F +.139(characters that get mapped to)161 210 R/F4 9/Times-Roman@0 SF(TELNET)2.639 +E F0 .139(commands sequences \(lik)2.639 F(e)-.1 E F1(ip)2.639 E F0(or)2.639 E +F1(quit)2.639 E F0 2.639(\)o)C 2.639(rl)488.611 210 S .14(ine editing)497.36 +210 R(characters \(lik)161 222 Q(e)-.1 E F1(erase)2.5 E F0(and)2.5 E F1(kill) +2.5 E F0(\). By def)A(ault, the local special characters are e)-.1 E(xported.) +-.15 E F1(check)161 240 Q F0 -1.11(Ve)216 240 S .526 +(rify the current settings for the current special characters.)1.11 F .525 +(The remote side is)5.526 F .925(requested to send all the current special cha\ +racter settings, and if there are an)216 252 R(y)-.15 E +(discrepancies with the local side, the local side will switch to the remote v) +216 264 Q(alue.)-.25 E F1(export)161 282 Q F0 .497(Switch to the local def)216 +282 R .497(aults for the special characters.)-.1 F .496(The local def)5.496 F +.496(ault charac-)-.1 F(ters are those of the local terminal at the time when) +216 294 Q F1(telnet)2.5 E F0 -.1(wa)2.5 G 2.5(ss).1 G(tarted.)483.8 294 Q F1 +(import)161 312 Q F0 1.929(Switch to the remote def)216 312 R 1.929 +(aults for the special characters.)-.1 F 1.929(The remote def)6.929 F(ault)-.1 +E .37(characters are those of the remote system at the time when the)216 324 R +F4(TELNET)2.869 E F0(connec-)2.869 E(tion w)216 336 Q(as established.)-.1 E F1 +(?)161 354 Q F0(Prints out help information for the)216 354 Q F1(slc)2.5 E F0 +(command.)2.5 E F1(status)102 372 Q F0(Sho)161 372 Q 2.808(wt)-.25 G .308 +(he current status of)189.118 372 R F1(telnet)2.809 E F0 2.809(.T)C .309 +(his includes the peer one is connected to, as well as the)316.641 372 R +(current mode.)161 384 Q F1(toggle)102 402 Q F3(arguments ...)6 E F0 -.8(To)161 +414 S 2.112(ggle \(between).8 F F2(TRUE)4.612 E F0(and)4.612 E F2(FALSE)4.612 E +F0 4.612(\)v)C 2.112(arious \215ags that control ho)324.76 414 R(w)-.25 E F1 +(telnet)4.611 E F0 2.111(responds to)4.611 F -2.15 -.25(ev e)161 426 T 2.73 +(nts. These).25 F .23(\215ags may be set e)2.73 F .231(xplicitly to)-.15 F F2 +(TRUE)2.731 E F0(or)2.731 E F2(FALSE)2.731 E F0 .231(using the)2.731 F F1(set) +2.731 E F0(and)2.731 E F1(unset)2.731 E F0(com-)2.731 E .544(mands listed abo) +161 438 R -.15(ve)-.15 G 5.544(.M).15 G .544(ore than one ar)255.382 438 R .543 +(gument may be speci\214ed.)-.18 F .543(The state of these \215ags may)5.543 F +(be interrog)161 450 Q(ated with the)-.05 E F1(display)2.5 E F0 2.5(command. V) +2.5 F(alid ar)-1.11 E(guments are:)-.18 E F1(authdebug)161 468 Q F0 -.45(Tu)226 +468 S(rns on deb).45 E(ugging information for the authentication code.)-.2 E F1 +(autoflush)161 486 Q F0(If)226 486 Q F1(autoflush)4.407 E F0(and)4.407 E F1 +(localchars)4.407 E F0 1.907(are both)4.407 F F2(TRUE)4.407 E F0 4.407(,t)C +1.907(hen when the)451.219 486 R F1(ao)4.408 E F0 4.408(,o)C(r)536.67 486 Q F1 +(quit)226 498 Q F0 1.803(characters are recognized \(and transformed into)4.304 +F F4(TELNET)4.303 E F0(sequences;)4.303 E(see)226 510 Q F1(set)2.966 E F0(abo) +2.966 E .766 -.15(ve f)-.15 H .466(or details\),).15 F F1(telnet)2.966 E F0 +.466(refuses to display an)2.966 F 2.966(yd)-.15 G .467(ata on the user')473.89 +510 R(s)-.55 E 2.241(terminal until the remote system ackno)226 522 R 2.241 +(wledges \(via a)-.25 F F2 2.241(TELNET TIMING)4.741 F(MARK)226 534 Q F0 .496 +(option\) that it has processed those)2.996 F F4(TELNET)2.996 E F0 2.996 +(sequences. The)2.996 F .497(initial v)2.996 F(al-)-.25 E .754 +(ue for this toggle is)226 546 R F2(TRUE)3.254 E F0 .753 +(if the terminal user had not done an "stty no\215sh",)3.253 F(otherwise)226 +558 Q F2(FALSE)2.5 E F0(\(see)2.5 E F2(stty)2.5 E F0(\(1\)\).)A F1(autodecrypt) +161 576 Q F0 .556(When the)226 588 R F2 .556(TELNET ENCRYPT)3.056 F F0 .556 +(option is ne)3.056 F .556(gotiated, by def)-.15 F .557(ault the actual en-)-.1 +F .403(cryption \(decryption\) of the data stream does not start automatically) +226 600 R 5.402(.T)-.65 G .402(he au-)514.888 600 R .789(toencrypt \(autodecry\ +pt\) command states that encryption of the output \(input\))226 612 R +(stream should be enabled as soon as possible.)226 624 Q 2.87(Note: Because)226 +642 R .369(of e)2.869 F .369(xport controls, the)-.15 F F2 .369(TELNET ENCRYPT) +2.869 F F0 .369(option is not sup-)2.869 F +(ported outside the United States and Canada.)226 654 Q F1(autologin)161 672 Q +F0 4.509(If the remote side supports the)226 672 R F2 4.509 +(TELNET AUTHENTICATION)7.009 F F0(option)7.009 E F4(TELNET)226 684 Q F0 3.448 +(attempts to use it to perform automatic authentication.)5.948 F 3.447(If the) +8.447 F F2(AUTHENTICATION)226 696 Q F0 .197(option is not supported, the user') +2.697 F 2.697(sl)-.55 G .197(ogin name are propa-)454.159 696 R -.05(ga)226 708 +S .41(ted through the).05 F F2 .41(TELNET ENVIRON)2.91 F F0 2.91(option. This) +2.91 F .41(command is the same as)2.91 F(4.2 Berk)72 756 Q(ele)-.1 E 2.5(yD) +-.15 G(istrib)132.57 756 Q 95.71(ution February)-.2 F(3, 1994)2.5 E(8)535 756 Q +EP +%%Page: 9 9 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R(specifying)226 96 Q/F1 10 +/Courier-Oblique@0 SF(a)2.5 E F0(option on the)2.5 E/F2 10/Courier-Bold@0 SF +(open)2.5 E F0(command.)2.5 E F2(autosynch)161 114 Q F0(If)226 114 Q F2 +(autosynch)4.854 E F0(and)4.854 E F2(localchars)4.854 E F0 2.354(are both)4.854 +F/F3 10/Courier@0 SF(TRUE)4.854 E F0 4.854(,t)C 2.354(hen when either the) +454.348 114 R F2(intr)226 126 Q F0(or)4.17 E F2(quit)4.17 E F0 1.669 +(characters is typed \(see)4.169 F F2(set)4.169 E F0(abo)4.169 E 1.969 -.15 +(ve f)-.15 H 1.669(or descriptions of the).15 F F2(intr)226 138 Q F0(and)2.925 +E F2(quit)2.925 E F0 .426(characters\), the resulting)2.925 F/F4 9 +/Times-Roman@0 SF(TELNET)2.926 E F0 .426(sequence sent is follo)2.926 F(wed) +-.25 E 1.634(by the)226 150 R F3 1.634(TELNET SYNCH)4.134 F F0 4.134 +(sequence. This)4.134 F(procedure)4.134 E F2(should)4.134 E F0 1.634 +(cause the re-)4.134 F .871(mote system to be)226 162 R .871(gin thro)-.15 F +.872(wing a)-.25 F -.1(wa)-.15 G 3.372(ya).1 G .872(ll pre)385.008 162 R .872 +(viously typed input until both of)-.25 F(the)226 174 Q F4(TELNET)3.622 E F0 +1.122(sequences ha)3.622 F 1.422 -.15(ve b)-.2 H 1.121 +(een read and acted upon.).15 F 1.121(The initial v)6.121 F 1.121(alue of)-.25 +F(this toggle is)226 186 Q F3(FALSE)2.5 E F0(.)A F2(binary)161 204 Q F0 +(Enable or disable the)226 204 Q F3(TELNET BINARY)2.5 E F0 +(option on both input and output.)2.5 E F2(inbinary)161 222 Q F0 +(Enable or disable the)226 222 Q F3(TELNET BINARY)2.5 E F0(option on input.)2.5 +E F2(outbinary)161 240 Q F0(Enable or disable the)226 240 Q F3(TELNET BINARY) +2.5 E F0(option on output.)2.5 E F2(crlf)161 258 Q F0 1.415(If this is)226 258 +R F3(TRUE)3.915 E F0 3.915(,t)C 1.415(hen carriage returns will be sent as) +298.72 258 R F3()3.915 E F0 3.915(.I)C 3.915(ft)507.72 258 S 1.415 +(his is)517.745 258 R F3(FALSE)226 270 Q F0 3.26(,t)C .759 +(hen carriage returns will be send as)264.54 270 R F3()3.259 E F0 +3.259(.T)C .759(he initial v)479.292 270 R(alue)-.25 E(for this toggle is)226 +282 Q F3(FALSE)2.5 E F0(.)A F2(crmod)161 300 Q F0 -.8(To)226 300 S 1.1 +(ggle carriage return mode.).8 F 1.1 +(When this mode is enabled, most carriage re-)6.1 F .745(turn characters recei) +226 312 R -.15(ve)-.25 G 3.244(df).15 G .744 +(rom the remote host will be mapped into a carriage)329.174 312 R 1.492 +(return follo)226 324 R 1.492(wed by a line feed.)-.25 F 1.493 +(This mode does not af)6.492 F 1.493(fect those characters)-.25 F .207 +(typed by the user)226 336 R 2.707(,o)-.4 G .207(nly those recei)305.028 336 R +-.15(ve)-.25 G 2.706(df).15 G .206(rom the remote host.)383.838 336 R .206 +(This mode is not)5.206 F -.15(ve)226 348 S 1.026 +(ry useful unless the remote host only sends carriage return, b).15 F 1.026 +(ut ne)-.2 F -.15(ve)-.25 G 3.526(rl).15 G(ine)527.78 348 Q 2.5(feed. The)226 +360 R(initial v)2.5 E(alue for this toggle is)-.25 E F3(FALSE)2.5 E F0(.)A F2 +(debug)161 378 Q F0 -.8(To)226 378 S .073(ggles sock).8 F .073(et le)-.1 F -.15 +(ve)-.25 G 2.573(ld).15 G(eb)314.629 378 Q .073(ugging \(useful only to the)-.2 +F F2 .072(super user)2.573 F F0 .072(\). The initial)B -.25(va)226 390 S +(lue for this toggle is).25 E F3(FALSE)2.5 E F0(.)A F2(encdebug)161 408 Q F0 +-.45(Tu)226 408 S(rns on deb).45 E(ugging information for the encryption code.) +-.2 E F2(localchars)161 426 Q F0 1.485(If this is)5 F F3(TRUE)3.985 E F0 3.985 +(,t)C 1.485(hen the)299 426 R F2(flush)3.985 E F0(,)A F2(interrupt)3.986 E F0 +(,)A F2(quit)3.986 E F0(,)A F2(erase)3.986 E F0 3.986(,a)C(nd)502.014 426 Q F2 +(kill)3.986 E F0 2.944(characters \(see)226 438 R F2(set)5.444 E F0(abo)5.444 E +-.15(ve)-.15 G 5.443(\)a).15 G 2.943(re recognized locally)353.755 438 R 5.443 +(,a)-.65 G 2.943(nd transformed into)455.234 438 R 3.265 +(\(hopefully\) appropriate)226 450 R F4(TELNET)5.765 E F0 3.265 +(control sequences \(respecti)5.765 F -.15(ve)-.25 G(ly).15 E F2(ao)5.766 E F0 +(,)A F2(ip)5.766 E F0(,)A F2(brk)226 462 Q F0(,)A F2(ec)2.788 E F0 2.788(,a)C +(nd)271.016 462 Q F2(el)2.787 E F0 2.787(;s)C(ee)305.26 462 Q F2(send)2.787 E +F0(abo)2.787 E -.15(ve)-.15 G 2.787(\). The).15 F .287(initial v)2.787 F .287 +(alue for this toggle is)-.25 F F3(TRUE)2.787 E F0 .045(in `)226 474 R .045 +(`old line by line')-.74 F 2.546('m)-.74 G .046(ode, and)318.906 474 R F3 +(FALSE)2.546 E F0 .046(in `)2.546 F .046(`character at a time')-.74 F 2.546('m) +-.74 G 2.546(ode. When)494.134 474 R(the)226 486 Q F3(LINEMODE)2.894 E F0 .394 +(option is enabled, the v)2.894 F .394(alue of)-.25 F F2(localchars)2.893 E F0 +.393(is ignored, and)2.893 F 2.388(assumed to al)226 498 R -.1(wa)-.1 G 2.388 +(ys be).1 F F3(TRUE)4.888 E F0 4.888(.I)C(f)359.5 498 Q F3(LINEMODE)4.888 E F0 +2.388(has e)4.888 F -.15(ve)-.25 G 4.888(rb).15 G 2.389(een enabled, then) +465.522 498 R F2(quit)226 510 Q F0 1.574(is sent as)4.074 F F2(abort)4.074 E F0 +4.074(,a)C(nd)338.42 510 Q F2 1.574(eof and)4.074 F F0 1.573(are sent as)4.074 +F F2 1.573(eof and)4.073 F(susp)4.073 E F0 4.073(,s)C(ee)531.12 510 Q F2(send) +226 522 Q F0(abo)2.5 E -.15(ve)-.15 G(\).).15 E F2(netdata)161 540 Q F0 -.8(To) +226 540 S .993(ggles the display of all netw).8 F .994(ork data \(in he)-.1 F +.994(xadecimal format\).)-.15 F .994(The initial)5.994 F -.25(va)226 552 S +(lue for this toggle is).25 E F3(FALSE)2.5 E F0(.)A F2(options)161 570 Q F0 -.8 +(To)226 570 S .625(ggles the display of some internal).8 F F2(telnet)3.125 E F0 +.625(protocol processing \(ha)3.125 F .625(ving to)-.2 F(do with)226 582 Q F4 +(TELNET)2.5 E F0 2.5(options\). The)2.5 F(initial v)2.5 E +(alue for this toggle is)-.25 E F3(FALSE)2.5 E F0(.)A F2(prettydump)161 600 Q +F0 .133(When the)5 F F2(netdata)2.633 E F0 .134(toggle is enabled, if)2.633 F +F2(prettydump)2.634 E F0 .134(is enabled the output)2.634 F .745(from the)226 +612 R F2(netdata)3.245 E F0 .744 +(command will be formatted in a more user readable for)3.244 F(-)-.2 E 3.199 +(mat. Spaces)226 624 R .699 +(are put between each character in the output, and the be)3.199 F(ginning)-.15 +E(of an)226 636 Q(y)-.15 E F4(TELNET)2.5 E F0 +(escape sequence is preceded by a ')2.5 E/F5 10/Symbol SF(*)A F0 2.5('t)C 2.5 +(oa)442.553 636 S(id in locating them.)454.493 636 Q F2(skiprc)161 654 Q F0 +4.589(When the skiprc toggle is)226 654 R F3(TRUE)7.089 E F0(,)A F4(TELNET) +7.089 E F0 4.589(skips the reading of the)7.089 F F3(.telnetrc)226 666 Q F0 +1.033(\214le in the users home directory when connections are opened.)3.533 F +(The initial v)226 678 Q(alue for this toggle is)-.25 E F3(FALSE.)2.5 E F0 +(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71 +(ution February)-.2 F(3, 1994)2.5 E(9)535 750 Q EP +%%Page: 10 10 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNET \( 1 \))72 48 R(BSD Reference Manual) +258.235 48 Q -.834(TELNET \( 1 \))485.572 48 R/F1 10/Courier-Bold@0 SF +(termdata)161 96 Q F0 -.8(To)226 96 S .934 +(ggles the display of all terminal data \(in he).8 F .933(xadecimal format\).) +-.15 F .933(The initial)5.933 F -.25(va)226 108 S(lue for this toggle is).25 E +/F2 10/Courier@0 SF(FALSE)2.5 E F0(.)A F1(verbose_encrypt)161 126 Q F0 1.129 +(When the)226 138 R F1(verbose_encrypt)3.629 E F0 1.13(toggle is)3.629 F F2 +(TRUE)3.63 E F0(,)A/F3 9/Times-Roman@0 SF(TELNET)3.63 E F0 1.13 +(prints out a mes-)3.63 F 1.377 +(sage each time encryption is enabled or disabled.)226 150 R 1.376 +(The initial v)6.377 F 1.376(alue for this)-.25 F 1.223(toggle is)226 162 R F2 +(FALSE.)3.723 E F0 3.723(Note: Because)3.723 F 1.224(of e)3.724 F 1.224 +(xport controls, data encryption is not)-.15 F +(supported outside of the United States and Canada.)226 174 Q F1(?)161 192 Q F0 +(Displays the le)226 192 Q -.05(ga)-.15 G(l).05 E F1(toggle)2.5 E F0(commands.) +2.5 E F1(z)102 210 Q F0(Suspend)161 210 Q F1(telnet)2.5 E F0 2.5(.T)C +(his command only w)244.5 210 Q(orks when the user is using the)-.1 E F2(csh) +2.5 E F0(\(1\).)A F1(!)102 228 Q F0([)6.833 E/F4 10/Courier-Oblique@0 SF +(command).833 E F0(]).833 E(Ex)161 240 Q .293 +(ecute a single command in a subshell on the local system.)-.15 F(If)5.292 E F1 +(command)2.792 E F0 .292(is omitted, then an)2.792 F(interacti)161 252 Q .3 +-.15(ve s)-.25 H(ubshell is in).15 E -.2(vo)-.4 G -.1(ke).2 G(d.).1 E F1(?)102 +270 Q F0([)6.833 E F4(command).833 E F0(]).833 E 1.177(Get help.)161 282 R -.4 +(Wi)6.177 G 1.178(th no ar).4 F(guments,)-.18 E F1(telnet)3.678 E F0 1.178 +(prints a help summary)3.678 F 6.178(.I)-.65 G 3.678(fac)433.358 282 S 1.178 +(ommand is speci\214ed,)452.924 282 R F1(telnet)161 294 Q F0 +(will print the help information for just that command.)2.5 E/F5 10 +/Times-Bold@0 SF(ENVIR)72 318 Q(ONMENT)-.3 E F1(Telnet)102 330 Q F0 .666 +(uses at least the)3.166 F F2(HOME)3.166 E F0(,)A F2(SHELL)3.165 E F0(,)A F2 +(DISPLAY)3.165 E F0 3.165(,a)C(nd)326.255 330 Q F2(TERM)3.165 E F0(en)3.165 E +.665(vironment v)-.4 F 3.165(ariables. Other)-.25 F(en)3.165 E(vironment)-.4 E +-.25(va)102 342 S(riables may be propag).25 E(ated to the other side via the) +-.05 E F2(TELNET ENVIRON)2.5 E F0(option.)2.5 E F5(FILES)72 366 Q F2 +(~/.telnetrc)102 378 Q F0(user customized telnet startup v)5 E(alues)-.25 E F5 +(HIST)72 402 Q(OR)-.18 E(Y)-.35 E F0(The)102 414 Q F1(Telnet)2.5 E F0 +(command appeared in 4.2)2.5 E F3(BSD)A F0(.)A F5(NO)72 438 Q(TES)-.4 E F0 +(On some remote systems, echo has to be turned of)102 450 Q 2.5(fm)-.25 G +(anually when in `)316.44 450 Q(`old line by line')-.74 E 2.5('m)-.74 G(ode.) +465.22 450 Q .691(In `)102 468 R .691(`old line by line')-.74 F 3.191('m)-.74 G +.691(ode or)198.685 468 R F2(LINEMODE)3.191 E F0 .691(the terminal')3.191 F(s) +-.55 E F1(eof)3.191 E F0 .691(character is only recognized \(and sent to the) +3.191 F(remote system\) when it is the \214rst character on a line.)102 480 Q +(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71 +(ution February)-.2 F(3, 1994)2.5 E(10)530 750 Q EP +%%Trailer +end +%%EOF diff --git a/src/appl/telnet/telnet/telnet.0.txt b/src/appl/telnet/telnet/telnet.0.txt new file mode 100644 index 000000000..41d410bab --- /dev/null +++ b/src/appl/telnet/telnet/telnet.0.txt @@ -0,0 +1,718 @@ +TELNET(1) BSD Reference Manual TELNET(1) + +NNAAMMEE + tteellnneett - user interface to the TELNET protocol + +SSYYNNOOPPSSIISS + tteellnneett [--88] [--EE] [--FF] [--KK] [--LL] [--SS _t_o_s] [--XX _a_u_t_h_t_y_p_e] [--aa] [--cc] [--dd] [--ee + _e_s_c_a_p_e_c_h_a_r] [--ff] [--kk _r_e_a_l_m] [--ll _u_s_e_r] [--nn _t_r_a_c_e_f_i_l_e] [--rr] [--xx] + [_h_o_s_t [port]] + +DDEESSCCRRIIPPTTIIOONN + The tteellnneett command is used to communicate with another host using the + TELNET protocol. If tteellnneett is invoked without the _h_o_s_t argument, it en- + ters command mode, indicated by its prompt (tteellnneett>>). In this mode, it + accepts and executes the commands listed below. If it is invoked with + arguments, it performs an ooppeenn command with those arguments. + + Options: + + --88 Specifies an 8-bit data path. This causes an attempt to negoti- + ate the TELNET BINARY option on both input and output. + + --EE Stops any character from being recognized as an escape character. + + --FF If Kerberos V5 authentication is being used, the --FF option allows + the local credentials to be forwarded to the remote system, in- + cluding any credentials that have already been forwarded into the + local environment. + + --KK Specifies no automatic login to the remote system. + + --LL Specifies an 8-bit data path on output. This causes the BINARY + option to be negotiated on output. + + --SS _t_o_s Sets the IP type-of-service (TOS) option for the telnet connec- + tion to the value _t_o_s_, which can be a numeric TOS value or, on + systems that support it, a symbolic TOS name found in the + /etc/iptos file. + + --XX _a_t_y_p_e + Disables the _a_t_y_p_e type of authentication. + + --aa Attempt automatic login. Currently, this sends the user name via + the USER variable of the ENVIRON option if supported by the re- + mote system. The name used is that of the current user as re- + turned by getlogin(2) if it agrees with the current user ID, oth- + erwise it is the name associated with the user ID. + + --cc Disables the reading of the user's _._t_e_l_n_e_t_r_c file. (See the + ttooggggllee sskkiipprrcc command on this man page.) + + --dd Sets the initial value of the ddeebbuugg toggle to TRUE + + --ee _e_s_c_a_p_e _c_h_a_r + Sets the initial tteellnneett tteellnneett escape character to _e_s_c_a_p_e _c_h_a_r_. + If _e_s_c_a_p_e _c_h_a_r is omitted, then there will be no escape charac- + ter. + + --ff If Kerberos V5 authentication is being used, the --ff option allows + the local credentials to be forwarded to the remote system. + + --kk _r_e_a_l_m + If Kerberos authentication is being used, the --kk option requests + that telnet obtain tickets for the remote host in realm realm in- + stead of the remote host's realm, as determined by + + krb_realmofhost(3). + + --ll _u_s_e_r + When connecting to the remote system, if the remote system under- + stands the ENVIRON option, then _u_s_e_r will be sent to the remote + system as the value for the variable USER. This option implies + the --aa option. This option may also be used with the ooppeenn com- + mand. + + --nn _t_r_a_c_e_f_i_l_e + Opens _t_r_a_c_e_f_i_l_e for recording trace information. See the sseett + ttrraacceeffiillee command below. + + --rr Specifies a user interface similar to rlogin(1). In this mode, + the escape character is set to the tilde (~) character, unless + modified by the -e option. + + --xx Turns on encryption of the data stream if possible. This option + is not available outside of the United States and Canada. + + _h_o_s_t Indicates the official name, an alias, or the Internet address of + a remote host. + + _p_o_r_t Indicates a port number (address of an application). If a number + is not specified, the default tteellnneett port is used. + + When in rlogin mode, a line of the form ~. disconnects from the remote + host; ~ is the telnet escape character. Similarly, the line ~^Z suspends + the telnet session. The line ~^] escapes to the normal telnet escape + prompt. + + Once a connection has been opened, tteellnneett will attempt to enable the + TELNET LINEMODE option. If this fails, then tteellnneett will revert to one of + two input modes: either ``character at a time'' or ``old line by line'' + depending on what the remote system supports. + + When LINEMODE is enabled, character processing is done on the local sys- + tem, under the control of the remote system. When input editing or char- + acter echoing is to be disabled, the remote system will relay that infor- + mation. The remote system will also relay changes to any special charac- + ters that happen on the remote system, so that they can take effect on + the local system. + + In ``character at a time'' mode, most text typed is immediately sent to + the remote host for processing. + + In ``old line by line'' mode, all text is echoed locally, and (normally) + only completed lines are sent to the remote host. The ``local echo char- + acter'' (initially ``^E'') may be used to turn off and on the local echo + (this would mostly be used to enter passwords without the password being + echoed). + + If the LINEMODE option is enabled, or if the llooccaallcchhaarrss toggle is TRUE + (the default for ``old line by line``; see below), the user's qquuiitt, iinnttrr, + and fflluusshh characters are trapped locally, and sent as TELNET protocol se- + quences to the remote side. If LINEMODE has ever been enabled, then the + user's ssuusspp and eeooff are also sent as TELNET protocol sequences, and qquuiitt + is sent as a TELNET ABORT instead of BREAK There are options (see ttooggggllee + aauuttoofflluusshh and ttooggggllee aauuttoossyynncchh below) which cause this action to flush + subsequent output to the terminal (until the remote host acknowledges the + TELNET sequence) and flush previous terminal input (in the case of qquuiitt + and iinnttrr). + + While connected to a remote host, tteellnneett command mode may be entered by + typing the tteellnneett ``escape character'' (initially ``^]''). When in com- + mand mode, the normal terminal editing conventions are available. + + The following tteellnneett commands are available. Only enough of each command + to uniquely identify it need be typed (this is also true for arguments to + the mmooddee, sseett, ttooggggllee, uunnsseett, ssllcc, eennvviirroonn, and ddiissppllaayy commands). + + aauutthh _a_r_g_u_m_e_n_t _._._. + The auth command manipulates the information sent through the + TELNET AUTHENTICATE option. Valid arguments for the auth com- + mand are as follows: + + ddiissaabbllee _t_y_p_e Disables the specified type of authentication. + To obtain a list of available types, use the + aauutthh ddiissaabbllee ?? command. + + eennaabbllee _t_y_p_e Enables the specified type of authentication. + To obtain a list of available types, use the + aauutthh eennaabbllee ?? command. + + ssttaattuuss Lists the current status of the various types of + authentication. + + cclloossee Close a TELNET session and return to command mode. + + ddiissppllaayy _a_r_g_u_m_e_n_t _._._. + Displays all, or some, of the sseett and ttooggggllee values (see be- + low). + + eennccrryypptt _a_r_g_u_m_e_n_t _._._. + The encrypt command manipulates the information sent through + the TELNET ENCRYPT option. + + Note: Because of export controls, the TELNET ENCRYPT option + is not supported outside of the United States and Canada. + + Valid arguments for the encrypt command are as follows: + + ddiissaabbllee _t_y_p_e [[iinnppuutt||oouuttppuutt]] + Disables the specified type of encryption. If + you omit the input and output, both input and + output are disabled. To obtain a list of avail- + able types, use the eennccrryypptt ddiissaabbllee ?? command. + + eennaabbllee _t_y_p_e [[iinnppuutt||oouuttppuutt]] + Enables the specified type of encryption. If + you omit input and output, both input and output + are enabled. To obtain a list of available + types, use the eennccrryypptt eennaabbllee ?? command. + + iinnppuutt This is the same as the eennccrryypptt ssttaarrtt iinnppuutt com- + mand. + + --iinnppuutt This is the same as the eennccrryypptt ssttoopp iinnppuutt com- + mand. + + oouuttppuutt This is the same as the eennccrryypptt ssttaarrtt oouuttppuutt + command. + + --oouuttppuutt This is the same as the eennccrryypptt ssttoopp oouuttppuutt com- + mand. + + ssttaarrtt [[iinnppuutt||oouuttppuutt]] + Attempts to start encryption. If you omit iinnppuutt + and oouuttppuutt,, both input and output are enabled. + To obtain a list of available types, use the + + eennccrryypptt eennaabbllee ?? command. + + ssttaattuuss Lists the current status of encryption. + + ssttoopp [[iinnppuutt||oouuttppuutt]] + Stops encryption. If you omit input and output, + encryption is on both input and output. + + ttyyppee _t_y_p_e Sets the default type of encryption to be used + with later eennccrryypptt ssttaarrtt or eennccrryypptt ssttoopp com- + mands. + + eennvviirroonn _a_r_g_u_m_e_n_t_s_._._. + The eennvviirroonn command is used to manipulate the the variables + that my be sent through the TELNET ENVIRON option. The ini- + tial set of variables is taken from the users environment, + with only the DISPLAY and PRINTER variables being exported by + default. The USER variable is also exported if the --aa or --ll + options are used. + Valid arguments for the eennvviirroonn command are: + + ddeeffiinnee _v_a_r_i_a_b_l_e _v_a_l_u_e + Define the variable _v_a_r_i_a_b_l_e to have a value of + _v_a_l_u_e_. Any variables defined by this command are + automatically exported. The _v_a_l_u_e may be enclosed + in single or double quotes so that tabs and spaces + may be included. + + uunnddeeffiinnee _v_a_r_i_a_b_l_e + Remove _v_a_r_i_a_b_l_e from the list of environment vari- + ables. + + eexxppoorrtt _v_a_r_i_a_b_l_e + Mark the variable _v_a_r_i_a_b_l_e to be exported to the + remote side. + + uunneexxppoorrtt _v_a_r_i_a_b_l_e + Mark the variable _v_a_r_i_a_b_l_e to not be exported un- + less explicitly asked for by the remote side. + + lliisstt List the current set of environment variables. + Those marked with a ** will be sent automatically, + other variables will only be sent if explicitly + requested. + + ?? Prints out help information for the eennvviirroonn com- + mand. + + llooggoouutt Sends the TELNET LOGOUT option to the remote side. This com- + mand is similar to a cclloossee command; however, if the remote + side does not support the LOGOUT option, nothing happens. If, + however, the remote side does support the LOGOUT option, this + command should cause the remote side to close the TELNET con- + nection. If the remote side also supports the concept of sus- + pending a user's session for later reattachment, the logout + argument indicates that you should terminate the session imme- + diately. + + mmooddee _t_y_p_e _T_y_p_e is one of several options, depending on the state of the + TELNET session. The remote host is asked for permission to go + into the requested mode. If the remote host is capable of en- + tering that mode, the requested mode will be entered. + + cchhaarraacctteerr Disable the TELNET LINEMODE option, or, if the + remote side does not understand the LINEMODE op- + + tion, then enter ``character at a time`` mode. + + lliinnee Enable the TELNET LINEMODE option, or, if the + remote side does not understand the LINEMODE op- + tion, then attempt to enter ``old-line-by-line`` + mode. + + iissiigg (--iissiigg) Attempt to enable (disable) the TRAPSIG mode of + the LINEMODE option. This requires that the + LINEMODE option be enabled. + + eeddiitt (--eeddiitt) Attempt to enable (disable) the EDIT mode of the + LINEMODE option. This requires that the + LINEMODE option be enabled. + + ssooffttttaabbss (--ssooffttttaabbss) + Attempt to enable (disable) the SOFT_TAB mode of + the LINEMODE option. This requires that the + LINEMODE option be enabled. + + lliitteecchhoo (--lliitteecchhoo) + Attempt to enable (disable) the LIT_ECHO mode of + the LINEMODE option. This requires that the + LINEMODE option be enabled. + + ?? Prints out help information for the mmooddee com- + mand. + + ooppeenn _h_o_s_t [[--ll] _u_s_e_r][--_p_o_r_t] + Open a connection to the named host. If no port number is + specified, tteellnneett will attempt to contact a TELNET server at + the default port. The host specification may be either a host + name (see hosts(5)) or an Internet address specified in the + ``dot notation'' (see inet(3)). The [--ll] option may be used + to specify the user name to be passed to the remote system via + the ENVIRON option. When connecting to a non-standard port, + tteellnneett omits any automatic initiation of TELNET options. When + the port number is preceded by a minus sign, the initial op- + tion negotiation is done. After establishing a connection, + the file _._t_e_l_n_e_t_r_c in the users home directory is opened. + Lines beginning with a # are comment lines. Blank lines are + ignored. Lines that begin without white space are the start + of a machine entry. The first thing on the line is the name + of the machine that is being connected to. The rest of the + line, and successive lines that begin with white space are as- + sumed to be tteellnneett commands and are processed as if they had + been typed in manually to the tteellnneett command prompt. + + qquuiitt Close any open TELNET session and exit tteellnneett. An end of file + (in command mode) will also close a session and exit. + + sseenndd _a_r_g_u_m_e_n_t_s + Sends one or more special character sequences to the remote + host. The following are the arguments which may be specified + (more than one argument may be specified at a time): + + aabboorrtt Sends the TELNET ABORT (Abort processes) sequence. + + aaoo Sends the TELNET AO (Abort Output) sequence, which + should cause the remote system to flush all output + _f_r_o_m the remote system _t_o the user's terminal. + + aayytt Sends the TELNET AYT (Are You There) sequence, to + which the remote system may or may not choose to re- + + + spond. + + bbrrkk Sends the TELNET BRK (Break) sequence, which may have + significance to the remote system. + + eecc Sends the TELNET EC (Erase Character) sequence, which + should cause the remote system to erase the last char- + acter entered. + + eell Sends the TELNET EL (Erase Line) sequence, which + should cause the remote system to erase the line cur- + rently being entered. + + eeooff Sends the TELNET EOF (End Of File) sequence. + + eeoorr Sends the TELNET EOR (End of Record) sequence. + + eessccaappee Sends the current tteellnneett escape character (initially + ``^''). + + ggaa Sends the TELNET GA (Go Ahead) sequence, which likely + has no significance to the remote system. + + ggeettssttaattuuss + If the remote side supports the TELNET STATUS command, + ggeettssttaattuuss will send the subnegotiation to request that + the server send its current option status. + + iipp Sends the TELNET IP (Interrupt Process) sequence, + which should cause the remote system to abort the cur- + rently running process. + + nnoopp Sends the TELNET NOP (No OPeration) sequence. + + ssuusspp Sends the TELNET SUSP (SUSPend process) sequence. + + ssyynncchh Sends the TELNET SYNCH sequence. This sequence causes + the remote system to discard all previously typed (but + not yet read) input. This sequence is sent as TCP ur- + gent data (and may not work if the remote system is a + 4.2BSD system -- if it doesn't work, a lower case + ``r'' may be echoed on the terminal). + + ddoo _c_m_d + + ddoonntt _c_m_d + + wwiillll _c_m_d + + wwoonntt _c_m_d + Sends the TELNET DO _c_m_d sequence. _C_m_d can be either a + decimal number between 0 and 255, or a symbolic name + for a specific TELNET command. _C_m_d can also be either + hheellpp or ?? to print out help information, including a + list of known symbolic names. + + ?? Prints out help information for the sseenndd command. + + sseett _a_r_g_u_m_e_n_t _v_a_l_u_e + + uunnsseett _a_r_g_u_m_e_n_t _v_a_l_u_e + The sseett command will set any one of a number of tteellnneett vari- + ables to a specific value or to TRUE. The special value ooffff + turns off the function associated with the variable, this is + equivalent to using the uunnsseett command. The uunnsseett command will + disable or set to FALSE any of the specified functions. The + values of variables may be interrogated with the ddiissppllaayy com- + mand. The variables which may be set or unset, but not tog- + gled, are listed here. In addition, any of the variables for + the ttooggggllee command may be explicitly set or unset using the + sseett and uunnsseett commands. + + aayytt If TELNET is in localchars mode, or LINEMODE is en- + abled, and the status character is typed, a TELNET AYT + sequence (see sseenndd aayytt preceding) is sent to the re- + mote host. The initial value for the "Are You There" + character is the terminal's status character. + + eecchhoo This is the value (initially ``^E'') which, when in + ``line by line'' mode, toggles between doing local + echoing of entered characters (for normal processing), + and suppressing echoing of entered characters (for en- + tering, say, a password). + + eeooff If tteellnneett is operating in LINEMODE or ``old line by + line'' mode, entering this character as the first + character on a line will cause this character to be + sent to the remote system. The initial value of the + eof character is taken to be the terminal's eeooff char- + acter. + + eerraassee If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss + below), aanndd if tteellnneett is operating in ``character at a + time'' mode, then when this character is typed, a + TELNET EC sequence (see sseenndd eecc above) is sent to the + remote system. The initial value for the erase char- + acter is taken to be the terminal's eerraassee character. + + eessccaappee This is the tteellnneett escape character (initially ``^['') + which causes entry into tteellnneett command mode (when con- + nected to a remote system). + + fflluusshhoouuttppuutt + If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss + below) and the fflluusshhoouuttppuutt character is typed, a + TELNET AO sequence (see sseenndd aaoo above) is sent to the + remote host. The initial value for the flush charac- + ter is taken to be the terminal's fflluusshh character. + + ffoorrww11 + + ffoorrww22 If TELNET is operating in LINEMODE, these are the + characters that, when typed, cause partial lines to be + forwarded to the remote system. The initial value for + the forwarding characters are taken from the termi- + nal's eol and eol2 characters. + + iinntteerrrruupptt + If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss + below) and the iinntteerrrruupptt character is typed, a TELNET + IP sequence (see sseenndd iipp above) is sent to the remote + host. The initial value for the interrupt character + is taken to be the terminal's iinnttrr character. + + kkiillll If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss + below), aanndd if tteellnneett is operating in ``character at a + time'' mode, then when this character is typed, a + TELNET EL sequence (see sseenndd eell above) is sent to the + remote system. The initial value for the kill charac- + ter is taken to be the terminal's kkiillll character. + + llnneexxtt If tteellnneett is operating in LINEMODE or ``old line by + line`` mode, then this character is taken to be the + terminal's llnneexxtt character. The initial value for the + lnext character is taken to be the terminal's llnneexxtt + character. + + qquuiitt If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss + below) and the qquuiitt character is typed, a TELNET BRK + sequence (see sseenndd bbrrkk above) is sent to the remote + host. The initial value for the quit character is + taken to be the terminal's qquuiitt character. + + rreepprriinntt + If tteellnneett is operating in LINEMODE or ``old line by + line`` mode, then this character is taken to be the + terminal's rreepprriinntt character. The initial value for + the reprint character is taken to be the terminal's + rreepprriinntt character. + + rrllooggiinn This is the rlogin escape character. If set, the nor- + mal TELNET escape character is ignored unless it is + preceded by this character at the beginning of a line. + This character, at the beginning of a line followed by + a "." closes the connection; when followed by a ^Z it + suspends the telnet command. The initial state is to + disable the rlogin escape character. + + ssttaarrtt If the TELNET TOGGLE-FLOW-CONTROL option has been en- + abled, then this character is taken to be the termi- + nal's ssttaarrtt character. The initial value for the kill + character is taken to be the terminal's ssttaarrtt charac- + ter. + + ssttoopp If the TELNET TOGGLE-FLOW-CONTROL option has been en- + abled, then this character is taken to be the termi- + nal's ssttoopp character. The initial value for the kill + character is taken to be the terminal's ssttoopp charac- + ter. + + ssuusspp If tteellnneett is in llooccaallcchhaarrss mode, or LINEMODE is en- + abled, and the ssuussppeenndd character is typed, a TELNET + SUSP sequence (see sseenndd ssuusspp above) is sent to the re- + mote host. The initial value for the suspend charac- + ter is taken to be the terminal's ssuussppeenndd character. + + ttrraacceeffiillee + This is the file to which the output, caused by + nneettddaattaa or ooppttiioonn tracing being TRUE, will be written. + If it is set to ``--'', then tracing information will + be written to standard output (the default). + + wwoorrddeerraassee + If tteellnneett is operating in LINEMODE or ``old line by + line`` mode, then this character is taken to be the + terminal's wwoorrddeerraassee character. The initial value for + the worderase character is taken to be the terminal's + wwoorrddeerraassee character. + + ?? Displays the legal sseett (uunnsseett) commands. + + ssllcc _s_t_a_t_e The ssllcc command (Set Local Characters) is used to set or + change the state of the the special characters when the TELNET + LINEMODE option has been enabled. Special characters are + characters that get mapped to TELNET commands sequences (like + iipp or qquuiitt) or line editing characters (like eerraassee and kkiillll). + + + By default, the local special characters are exported. + + cchheecckk Verify the current settings for the current spe- + cial characters. The remote side is requested to + send all the current special character settings, + and if there are any discrepancies with the local + side, the local side will switch to the remote + value. + + eexxppoorrtt Switch to the local defaults for the special char- + acters. The local default characters are those of + the local terminal at the time when tteellnneett was + started. + + iimmppoorrtt Switch to the remote defaults for the special + characters. The remote default characters are + those of the remote system at the time when the + TELNET connection was established. + + ?? Prints out help information for the ssllcc command. + + ssttaattuuss Show the current status of tteellnneett. This includes the peer one + is connected to, as well as the current mode. + + ttooggggllee _a_r_g_u_m_e_n_t_s _._._. + Toggle (between TRUE and FALSE) various flags that control how + tteellnneett responds to events. These flags may be set explicitly + to TRUE or FALSE using the sseett and uunnsseett commands listed + above. More than one argument may be specified. The state of + these flags may be interrogated with the ddiissppllaayy command. + Valid arguments are: + + aauutthhddeebbuugg Turns on debugging information for the authenti- + cation code. + + aauuttoofflluusshh If aauuttoofflluusshh and llooccaallcchhaarrss are both TRUE, then + when the aaoo, or qquuiitt characters are recognized + (and transformed into TELNET sequences; see sseett + above for details), tteellnneett refuses to display + any data on the user's terminal until the remote + system acknowledges (via a TELNET TIMING MARK + option) that it has processed those TELNET se- + quences. The initial value for this toggle is + TRUE if the terminal user had not done an "stty + noflsh", otherwise FALSE (see stty(1)). + + aauuttooddeeccrryypptt When the TELNET ENCRYPT option is negotiated, by + default the actual encryption (decryption) of + the data stream does not start automatically. + The autoencrypt (autodecrypt) command states + that encryption of the output (input) stream + should be enabled as soon as possible. + + Note: Because of export controls, the TELNET + ENCRYPT option is not supported outside the + United States and Canada. + + aauuttoollooggiinn If the remote side supports the TELNET + AUTHENTICATION option TELNET attempts to use it + to perform automatic authentication. If the + AUTHENTICATION option is not supported, the us- + er's login name are propagated through the + TELNET ENVIRON option. This command is the same + as specifying _a option on the ooppeenn command. + + aauuttoossyynncchh If aauuttoossyynncchh and llooccaallcchhaarrss are both TRUE, then + when either the iinnttrr or qquuiitt characters is typed + (see sseett above for descriptions of the iinnttrr and + qquuiitt characters), the resulting TELNET sequence + sent is followed by the TELNET SYNCH sequence. + This procedure sshhoouulldd cause the remote system to + begin throwing away all previously typed input + until both of the TELNET sequences have been + read and acted upon. The initial value of this + toggle is FALSE. + + bbiinnaarryy Enable or disable the TELNET BINARY option on + both input and output. + + iinnbbiinnaarryy Enable or disable the TELNET BINARY option on + input. + + oouuttbbiinnaarryy Enable or disable the TELNET BINARY option on + output. + + ccrrllff If this is TRUE, then carriage returns will be + sent as . If this is FALSE, then car- + riage returns will be send as . The + initial value for this toggle is FALSE. + + ccrrmmoodd Toggle carriage return mode. When this mode is + enabled, most carriage return characters re- + ceived from the remote host will be mapped into + a carriage return followed by a line feed. This + mode does not affect those characters typed by + the user, only those received from the remote + host. This mode is not very useful unless the + remote host only sends carriage return, but nev- + er line feed. The initial value for this toggle + is FALSE. + + ddeebbuugg Toggles socket level debugging (useful only to + the ssuuppeerr uusseerr). The initial value for this tog- + gle is FALSE. + + eennccddeebbuugg Turns on debugging information for the encryp- + tion code. + + llooccaallcchhaarrss If this is TRUE, then the fflluusshh, iinntteerrrruupptt, + qquuiitt, eerraassee, and kkiillll characters (see sseett above) + are recognized locally, and transformed into + (hopefully) appropriate TELNET control sequences + (respectively aaoo, iipp, bbrrkk, eecc, and eell; see sseenndd + above). The initial value for this toggle is + TRUE in ``old line by line'' mode, and FALSE in + ``character at a time'' mode. When the LINEMODE + option is enabled, the value of llooccaallcchhaarrss is + ignored, and assumed to always be TRUE. If + LINEMODE has ever been enabled, then qquuiitt is + sent as aabboorrtt, and eeooff aanndd are sent as eeooff aanndd + ssuusspp, see sseenndd above). + + nneettddaattaa Toggles the display of all network data (in hex- + adecimal format). The initial value for this + toggle is FALSE. + + ooppttiioonnss Toggles the display of some internal tteellnneett pro- + tocol processing (having to do with TELNET op- + tions). The initial value for this toggle is + FALSE. + + pprreettttyydduummpp When the nneettddaattaa toggle is enabled, if + pprreettttyydduummpp is enabled the output from the + nneettddaattaa command will be formatted in a more user + readable format. Spaces are put between each + character in the output, and the beginning of + any TELNET escape sequence is preceded by a '*' + to aid in locating them. + + sskkiipprrcc When the skiprc toggle is TRUE, TELNET skips the + reading of the _._t_e_l_n_e_t_r_c file in the users home + directory when connections are opened. The ini- + tial value for this toggle is FALSE. + + tteerrmmddaattaa Toggles the display of all terminal data (in + hexadecimal format). The initial value for this + toggle is FALSE. + + vveerrbboossee__eennccrryypptt + When the vveerrbboossee__eennccrryypptt toggle is TRUE, TELNET + prints out a message each time encryption is en- + abled or disabled. The initial value for this + toggle is FALSE. Note: Because of export con- + trols, data encryption is not supported outside + of the United States and Canada. + + ?? Displays the legal ttooggggllee commands. + + zz Suspend tteellnneett. This command only works when the user is using + the csh(1). + + !! [_c_o_m_m_a_n_d] + Execute a single command in a subshell on the local system. + If ccoommmmaanndd is omitted, then an interactive subshell is in- + voked. + + ?? [_c_o_m_m_a_n_d] + Get help. With no arguments, tteellnneett prints a help summary. + If a command is specified, tteellnneett will print the help informa- + tion for just that command. + +EENNVVIIRROONNMMEENNTT + TTeellnneett uses at least the HOME, SHELL, DISPLAY, and TERM environment vari- + ables. Other environment variables may be propagated to the other side + via the TELNET ENVIRON option. + +FFIILLEESS + ~/.telnetrc user customized telnet startup values + +HHIISSTTOORRYY + The TTeellnneett command appeared in 4.2BSD. + +NNOOTTEESS + On some remote systems, echo has to be turned off manually when in ``old + line by line'' mode. + + In ``old line by line'' mode or LINEMODE the terminal's eeooff character is + only recognized (and sent to the remote system) when it is the first + character on a line. + +4.2 Berkeley Distribution February 3, 1994 11 diff --git a/src/appl/telnet/telnet/telnet.1 b/src/appl/telnet/telnet/telnet.1 index 52ba4cda9..21b3a0642 100644 --- a/src/appl/telnet/telnet/telnet.1 +++ b/src/appl/telnet/telnet/telnet.1 @@ -1,56 +1,73 @@ -.\" Copyright (c) 1983, 1990 The Regents of the University of California. -.\" All rights reserved. +.\" Copyright (c) 1983, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. .\" -.\" Redistribution and use in source and binary forms are permitted provided -.\" that: (1) source distributions retain this entire copyright notice and -.\" comment, and (2) distributions including binaries display the following -.\" acknowledgement: ``This product includes software developed by the -.\" University of California, Berkeley and its contributors'' in the -.\" documentation or other materials provided with the distribution and in -.\" all advertising materials mentioning features or use of this software. -.\" Neither the name of the University nor the names of its contributors may -.\" be used to endorse or promote products derived from this software without -.\" specific prior written permission. -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. .\" -.\" @(#)telnet.1 6.13 (Berkeley) 7/28/90 +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" -.Dd July 28, 1990 +.\" @(#)telnet.1 8.4 (Berkeley) 2/3/94 +.\" +.Dd February 3, 1994 .Dt TELNET 1 .Os BSD 4.2 .Sh NAME .Nm telnet -.Nd User interface to the -.Li TELNET +.Nd user interface to the +.Tn TELNET protocol .Sh SYNOPSIS .Nm telnet .Op Fl 8 .Op Fl E +.Op Fl F .Op Fl K .Op Fl L -.Op Fl X Ar atype +.Op Fl S Ar tos +.Op Fl X Ar authtype .Op Fl a .Op Fl c .Op Fl d .Op Fl e Ar escapechar +.Op Fl f .Op Fl k Ar realm .Op Fl l Ar user .Op Fl n Ar tracefile .Op Fl r .Op Fl x -.Ob +.Oo .Ar host .Op port -.Oe +.Oc .Sh DESCRIPTION The .Nm telnet command is used to communicate with another host using the -.Li TELNET +.Tn TELNET protocol. If .Nm telnet @@ -65,83 +82,85 @@ If it is invoked with arguments, it performs an command with those arguments. .Pp Options: -.Tw Fl -.Tp Fl 8 -Use an eight bit data path. This will cause -an attempt to negotiate the BINARY option on both -input and output. -.Tp Fl E -The -.Fl E -option stops any character from being recognized as an escape character. -.Tp Fl K -Do not attempt to do automatic login to the -remote system. -.Tp Fl L -Use an eight bit data path on output. -This causes the BINARY option to be negotiated -on output. -.Tp Cx Fl X -.Cx \&\ \& -.Ar atype -.Cx -Disable the +.Bl -tag -width indent +.It Fl 8 +Specifies an 8-bit data path. This causes an attempt to +negotiate the +.Dv TELNET BINARY +option on both input and output. +.It Fl E +Stops any character from being recognized as an escape character. +.It Fl F +If Kerberos V5 authentication is being used, the +.Fl F +option allows the local credentials to be forwarded +to the remote system, including any credentials that +have already been forwarded into the local environment. +.It Fl K +Specifies no automatic login to the remote system. +.It Fl L +Specifies an 8-bit data path on output. This causes the +BINARY option to be negotiated on output. +.It Fl S Ar tos +Sets the IP type-of-service (TOS) option for the telnet +connection to the value +.Ar tos, +which can be a numeric TOS value +or, on systems that support it, a symbolic +TOS name found in the /etc/iptos file. +.It Fl X Ar atype +Disables the .Ar atype type of authentication. -.Tp Fl a +.It Fl a Attempt automatic login. -Currently, this sends the user name via the USER variable -of the ENVIRON option if supported by the remote system. +Currently, this sends the user name via the +.Ev USER +variable +of the +.Ev ENVIRON +option if supported by the remote system. The name used is that of the current user as returned by .Xr getlogin 2 if it agrees with the current user ID, otherwise it is the name associated with the user ID. -.Tp Fl c -The -.Fl c -flag disables the reading of the users -.Pa \&.telnetrc. -(See the -.Ic toggle -.Ic skiprc -command below.) -.Tp Fl d +.It Fl c +Disables the reading of the user's +.Pa \&.telnetrc +file. (See the +.Ic toggle skiprc +command on this man page.) +.It Fl d Sets the initial value of the .Ic debug toggle to -.Li TRUE -.Tp Cx Fl e -.Cx \&\ \& -.Ar escape char -.Cx +.Dv TRUE +.It Fl e Ar escape char Sets the initial .Nm -.B telnet +.Nm telnet escape character to .Ar escape char. If .Ar escape char -is ommitted, then +is omitted, then there will be no escape character. -.Tp Cx Fl k -.Cx \&\ \& -.Ar realm -.Cx +.It Fl f +If Kerberos V5 authentication is being used, the +.Fl f +option allows the local credentials to be forwarded to the remote system. +.It Fl k Ar realm If Kerberos authentication is being used, the .Fl k -option requests that -.Nm telnet -obtain tickets for the remote host in realm -.Ar realm -instead of the remote host's -realm as determined by -.Xr krb_realmofhost 3 . -.Tp Cx Fl l -.Cx \&\ \& -.Ar user -.Cx +option requests that telnet obtain tickets for the remote host in +realm realm instead of the remote host's realm, as determined +by +.Xr krb_realmofhost 3 . +.It Fl l Ar user When connecting to the remote system, if the remote system -understands the ENVIRON option, then +understands the +.Ev ENVIRON +option, then .Ar user will be sent to the remote system as the value for the variable USER. This option implies the @@ -150,65 +169,42 @@ option. This option may also be used with the .Ic open command. -.Tp Cx Fl n -.Cx \&\ \& -.Ar tracefile -.Cx +.It Fl n Ar tracefile Opens .Ar tracefile for recording trace information. See the .Ic set tracefile command below. -.Tp Fl r -Use a user interface similar to -.Xr rlogin 1 . -In this mode, the escape character is set to the tilde (``~'') -character, unless modified by the -.Fl e -flag. -.Tp Fl x -Turn on encryption of the data stream, if possible. -.Tp Ar host +.It Fl r +Specifies a user interface similar to +.Xr rlogin 1 . +In this +mode, the escape character is set to the tilde (~) character, +unless modified by the -e option. +.It Fl x +Turns on encryption of the data stream if possible. This +option is not available outside of the United States and +Canada. +.It Ar host Indicates the official name, an alias, or the Internet address of a remote host. -.Tp Ar port -Indicates a port number (address of an application) or name. If a number is +.It Ar port +Indicates a port number (address of an application). If a number is not specified, the default .Nm telnet port is used. -Port names are mapped to port numbers via the -/etc/services -file. -Normally when a port number is specified, -.Nm telnet -will not send out any initial -.Li TELNET -option negotiation. -If the port number/name is preceded by -a minus sign, then -the initial -.Li TELNET -option negotiation will be sent. -.Tp +.El .Pp -When in -.Nm rlogin -mode, a line of the form ``~.'' disconnects from the remote host, -where ``~'' is the -.Nm -escape character. -Similarly, the line ``~^Z'' will suspend the -.Nm telnet -session. -The line ``~^]'' will escape to the normal -.Nm telnet -escape prompt. +When in rlogin mode, a line of the form ~. disconnects from the +remote host; ~ is the telnet escape character. +Similarly, the line ~^Z suspends the telnet session. +The line ~^] escapes to the normal telnet escape prompt. .Pp Once a connection has been opened, .Nm telnet will attempt to enable the -.Li TELNET LINEMODE +.Dv TELNET LINEMODE option. If this fails, then .Nm telnet @@ -218,7 +214,7 @@ or \*(Lqold line by line\*(Rq depending on what the remote system supports. .Pp When -.Li LINEMODE +.Dv LINEMODE is enabled, character processing is done on the local system, under the control of the remote system. When input editing or character echoing is to be disabled, the remote system @@ -237,33 +233,35 @@ to turn off and on the local echo without the password being echoed). .Pp If the -.Li LINEMODE +.Dv LINEMODE option is enabled, or if the .Ic localchars -toggle is TRUE (the default for \*(Lqold line by line\*(Lq; see below), +toggle is +.Dv TRUE +(the default for \*(Lqold line by line\*(Lq; see below), the user's .Ic quit , .Ic intr , and .Ic flush characters are trapped locally, and sent as -.Li TELNET +.Tn TELNET protocol sequences to the remote side. If -.Li LINEMODE +.Dv LINEMODE has ever been enabled, then the user's .Ic susp and .Ic eof are also sent as -.Li TELNET +.Tn TELNET protocol sequences, and .Ic quit is sent as a -.Li TELNET ABORT +.Dv TELNET ABORT instead of -.Li BREAK +.Dv BREAK There are options (see .Ic toggle .Ic autoflush @@ -273,7 +271,7 @@ and below) which cause this action to flush subsequent output to the terminal (until the remote host acknowledges the -.Li TELNET +.Tn TELNET sequence) and flush previous terminal input (in the case of .Ic quit @@ -284,196 +282,123 @@ While connected to a remote host, .Nm telnet command mode may be entered by typing the .Nm telnet -\*(Lqescape character\*(Rq (initially \*(Lq^ -\*(Rq). +\*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq). When in command mode, the normal terminal editing conventions are available. .Pp The following .Nm telnet commands are available. Only enough of each command to uniquely identify it need be typed -(this is also true for most of the arguments to the +(this is also true for arguments to the +.Ic mode , +.Ic set , +.Ic toggle , +.Ic unset , +.Ic slc , +.Ic environ , +and +.Ic display commands). .Pp -.Tw Ic -.\" ######## BEGIN the "auth" command -.Tp Cx Ic auth -.Cx \&\ \& -.Ar arguments... -.Cx -The -.Ic auth -command is used to manipulate the -the information that my be sent through the -.Li TELNET AUTHENTICATE -option. -.br -Valid arguments for the \fBauth\fP command are: -.Tw Fl -.Tp Cx Ic disable -.Cx \&\ \& -.Ar type -.Cx -Disable the specified -.Ar type -of authentication. -A list of available types can be gotten by -doing an -.Ic auth -.Ic disable -.Ic ? +.Bl -tag -width "mode type" +.It Ic auth Ar argument ... +The auth command manipulates the information sent through the +.Dv TELNET AUTHENTICATE +option. Valid arguments for the +auth command are as follows: +.Bl -tag -width "disable type" +.It Ic disable Ar type +Disables the specified type of authentication. To +obtain a list of available types, use the +.Ic auth disable \&? command. -.Tp Cx Ic enable -.Cx \&\ \& -.Ar type -.Cx -Enable the specified -.Ar type -of authentication. -A list of available types can be gotten by -doing an -.Ic auth -.Ic enable -.Ic ? +.It Ic enable Ar type +Enables the specified type of authentication. To +obtain a list of available types, use the +.Ic auth enable \&? command. -.Tp Ic status -List the current status of the various -types of authentication. -.Tp -.\" ######## END the "auth" command -.\" -.\" ######## BEGIN the "close" command -.Tp Ic close +.It Ic status +Lists the current status of the various types of +authentication. +.El +.It Ic close Close a -.Li TELNET +.Tn TELNET session and return to command mode. -.\" ######## END the "close" command -.\" -.\" ######## BEGIN the "display" command -.Tp Cx Ic display -.Cx \&\ \& -.Ar argument ... -.Cx +.It Ic display Ar argument ... Displays all, or some, of the .Ic set and .Ic toggle values (see below). -.\" ######## END the "display" command -.\" -.\" ######## BEGIN the "encrypt" command -.Tp Cx Ic encrypt -.Cx \&\ \& -.Ar arguments... -.Cx -The -.Ic encrypt -command is used to manipulate the -the information that my be sent through the -.Li TELNET ENCRYPT +.It Ic encrypt Ar argument ... +The encrypt command manipulates the information sent through the +.Dv TELNET ENCRYPT option. -.br -Valid arguments for the \fBencrypt\fP command are: -.Tw Fl -.Tp Cx Ic disable -.Cx \&\ \& -.Ar type -.Op input|output -.Cx -Disable the specified -.Ar type -of encryption. -If the -.Op input -or -.Op output -is not specified, both input and output will be disabled. -A list of available types can be gotten by -doing an -.Ic encrypt -.Ic disable -.Ic ? +.Pp +Note: Because of export controls, the +.Dv TELNET ENCRYPT +option is not supported outside of the United States and Canada. +.Pp +Valid arguments for the encrypt command are as follows: +.Bl -tag -width Ar +.It Ic disable Ar type Ic [input|output] +Disables the specified type of encryption. If you +omit the input and output, both input and output +are disabled. To obtain a list of available +types, use the +.Ic encrypt disable \&? command. -.Tp Cx Ic enable -.Cx \&\ \& -.Ar type -.Op input|output -.Cx -Enable the specified -.Ar type -of encryption. -If -.Op input -or -.Op output -is not specified, both input and output will be enabled. -A list of available types can be gotten by -doing an -.Ic encrypt -.Ic enable -.Ic ? +.It Ic enable Ar type Ic [input|output] +Enables the specified type of encryption. If you +omit input and output, both input and output are +enabled. To obtain a list of available types, use the +.Ic encrypt enable \&? command. -.Tp Cx Ic type -.Cx \&\ \& -.Ar type -.Cx -Set the default type of encryption to be used with later -.Ic encrypt start -or -.Ic encrypt stop -commands. -.Tp Cx Ic start -.Op input|output -.Cx -Attempt to start encryption. -If -.Op input -or -.Op output -is not specified, encryption of both input and output will be attempted. -The -.Ic encrypt type -command must have been used to set the encryption type. -.Tp Cx Ic stop -.Op input|output -.Cx -Stop encryption. -If -.Op input -or -.Op output -is not specified, encryption will be stopped on both input and output. -.Tp Ic input +.It Ic input This is the same as the .Ic encrypt start input command. -.Tp Ic -input +.It Ic -input This is the same as the .Ic encrypt stop input command. -.Tp Ic output +.It Ic output This is the same as the .Ic encrypt start output command. -.Tp Ic -output +.It Ic -output This is the same as the .Ic encrypt stop output command. -.Tp Ic status -List the current status of encryption. -.Tp -.\" ######## END the "encrypt" command -.\" -.\" ######## BEGIN the "environ" command -.Tp Cx Ic environ -.Cx \&\ \& -.Ar arguments... -.Cx +.It Ic start Ic [input|output] +Attempts to start encryption. If you omit +.Ic input +and +.Ic output, +both input and output are enabled. To +obtain a list of available types, use the +.Ic encrypt enable \&? +command. +.It Ic status +Lists the current status of encryption. +.It Ic stop Ic [input|output] +Stops encryption. If you omit input and output, +encryption is on both input and output. +.It Ic type Ar type +Sets the default type of encryption to be used +with later +.Ic encrypt start +or +.Ic encrypt stop +commands. +.El +.It Ic environ Ar arguments... The .Ic environ command is used to manipulate the the variables that my be sent through the -.Li TELNET ENVIRON +.Dv TELNET ENVIRON option. The initial set of variables is taken from the users environment, with only the @@ -489,12 +414,11 @@ or .Fl l options are used. .br -Valid arguments for the \fBenviron\fP command are: -.Tw Fl -.Tp Cx Ic define -.Cx \&\ \& -.Ar variable value -.Cx +Valid arguments for the +.Ic environ +command are: +.Bl -tag -width Fl +.It Ic define Ar variable value Define the variable .Ar variable to have a value of @@ -504,337 +428,290 @@ The .Ar value may be enclosed in single or double quotes so that tabs and spaces may be included. -.Tp Cx Ic undefine -.Cx \&\ \& -.Ar variable -.Cx +.It Ic undefine Ar variable Remove .Ar variable from the list of environment variables. -.Tp Cx Ic export -.Cx \&\ \& -.Ar variable -.Cx +.It Ic export Ar variable Mark the variable .Ar variable to be exported to the remote side. -.Tp Cx Ic unexport -.Cx \&\ \& -.Ar variable -.Cx +.It Ic unexport Ar variable Mark the variable .Ar variable to not be exported unless explicitly asked for by the remote side. -.Tp Ic list +.It Ic list List the current set of environment variables. -Those marked with a \fB*\fR will be sent automatically, +Those marked with a +.Cm * +will be sent automatically, other variables will only be sent if explicitly requested. -.Tp Ic \&? +.It Ic \&? Prints out help information for the .Ic environ command. -.Tp -.\" ######## END the "environ" command -.\" -.\" ######## BEGIN the "logout" command -.Tp Ic logout -Send the -.Li TELNET LOGOUT +.El +.It Ic logout +Sends the +.Dv TELNET LOGOUT option to the remote side. -This is similar to doing a +This command is similar to a .Ic close -command, however -if the remote side does not support the -.Li LOGOUT -option, then nothing will happen. +command; however, if the remote side does not support the +.Dv LOGOUT +option, nothing happens. If, however, the remote side does support the -.Li LOGOUT -option, then this command should cause the remote side -to close the -.Li TELNET +.Dv LOGOUT +option, this command should cause the remote side to close the +.Tn TELNET connection. -In addition, if the remote side supports the concept of suspending -a users session for later re-attachement, the -.Li LOGOUT -option indicates that the session should be terminated immediately. -.\" ######## END the "logout" command -.\" -.\" ######## BEGIN the "mode" command -.Tp Cx Ic mode -.Cx \&\ \& -.Ar type -.Cx +If the remote side also supports the concept of +suspending a user's session for later reattachment, +the logout argument indicates that you +should terminate the session immediately. +.It Ic mode Ar type .Ar Type is one of several options, depending on the state of the -.Li TELNET +.Tn TELNET session. The remote host is asked for permission to go into the requested mode. If the remote host is capable of entering that mode, the requested mode will be entered. -.Tw Ar -.Tp Ic character +.Bl -tag -width Ar +.It Ic character Disable the -.Li TELNET LINEMODE +.Dv TELNET LINEMODE option, or, if the remote side does not understand the -.Li LINEMODE +.Dv LINEMODE option, then enter \*(Lqcharacter at a time\*(Lq mode. -.Tp Ic line +.It Ic line Enable the -.Li TELNET LINEMODE +.Dv TELNET LINEMODE option, or, if the remote side does not understand the -.Li LINEMODE +.Dv LINEMODE option, then attempt to enter \*(Lqold-line-by-line\*(Lq mode. -.Tp Cx Ic isig -.Cx \&\ \& -.Pq Ic \-isig -.Cx +.It Ic isig Pq Ic \-isig Attempt to enable (disable) the -.Li TRAPSIG +.Dv TRAPSIG mode of the -.Li LINEMODE +.Dv LINEMODE option. This requires that the -.Li LINEMODE +.Dv LINEMODE option be enabled. -.Tp Cx Ic edit -.Cx \&\ \& -.Pq Ic \-edit -.Cx +.It Ic edit Pq Ic \-edit Attempt to enable (disable) the -.Li EDIT +.Dv EDIT mode of the -.Li LINEMODE +.Dv LINEMODE option. This requires that the -.Li LINEMODE +.Dv LINEMODE option be enabled. -.Tp Cx Ic softtabs -.Cx \&\ \& -.Pq Ic \-softtabs -.Cx +.It Ic softtabs Pq Ic \-softtabs Attempt to enable (disable) the -.Li SOFT_TAB +.Dv SOFT_TAB mode of the -.Li LINEMODE +.Dv LINEMODE option. This requires that the -.Li LINEMODE +.Dv LINEMODE option be enabled. -.Tp Cx Ic litecho -.Cx \&\ \& -.Pq Ic \-litecho -.Cx +.It Ic litecho Pq Ic \-litecho Attempt to enable (disable) the -.Li LIT_ECHO +.Dv LIT_ECHO mode of the -.Li LINEMODE +.Dv LINEMODE option. This requires that the -.Li LINEMODE +.Dv LINEMODE option be enabled. -.Tp Ic \&? +.It Ic \&? Prints out help information for the .Ic mode command. -.Tp -.\" ######## END the "mode" command -.\" -.\" ######## BEGIN the "open" command -.Tp Cx Ic open -.Cx \&\ \& -.Ar host -.Cx \&\ \& -.Cx [ -.Op Fl l -.Cx \&\ \& +.El +.It Xo +.Ic open Ar host +.Oo Op Fl l .Ar user -.Cx ] -.Cx [ -.Op Fl -.Cx \&\ \& -.Ar port -.Cx ] -.Cx +.Oc Ns Oo Fl +.Ar port Oc +.Xc Open a connection to the named host. If no port number is specified, .Nm telnet will attempt to contact a -.Li TELNET +.Tn TELNET server at the default port. The host specification may be either a host name (see -.Xr hosts 5 ) +.Xr hosts 5 ) or an Internet address specified in the \*(Lqdot notation\*(Rq (see -.Xr inet 3 ) . +.Xr inet 3 ) . The .Op Fl l option may be used to specify the user name to be passed to the remote system via the -.Li ENVIRON +.Ev ENVIRON option. When connecting to a non-standard port, .Nm telnet omits any automatic initiation of -.Li TELNET +.Tn TELNET options. When the port number is preceded by a minus sign, the initial option negotiation is done. -After establishing a connection, -if the -.Ic skiprc -variable is not enabled -(see the -.Ic toggle -.Ic skiprc -command below), -the file +After establishing a connection, the file .Pa \&.telnetrc in the users home directory is opened. Lines beginning with a # are comment lines. Blank lines are ignored. Lines that begin -without whitespace are the start of a machine entry. The +without white space are the start of a machine entry. The first thing on the line is the name of the machine that is being connected to. The rest of the line, and successive -lines that begin with whitespace are assumed to be +lines that begin with white space are assumed to be .Nm telnet commands and are processed as if they had been typed in manually to the .Nm telnet command prompt. -The special machine name -.Ic DEFAULT -is used to specify commands that should be executed for -all machines. -There may be more than one entry for a machine; all matches -will the specified machine name will be executed. -.\" ######## END the "open" command -.\" -.\" ######## BEGIN the "quit" command -.Tp Ic quit +.It Ic quit Close any open -.Li TELNET +.Tn TELNET session and exit .Nm telnet . An end of file (in command mode) will also close a session and exit. -.\" ######## END the "quit" command -.\" -.\" ######## BEGIN the "send" command -.Tp Cx Ic send -.Cx \&\ \& -.Ar arguments -.Cx +.It Ic send Ar arguments Sends one or more special character sequences to the remote host. The following are the arguments which may be specified (more than one argument may be specified at a time): .Pp -.Tw Ds -.Tp Ic abort +.Bl -tag -width escape +.It Ic abort Sends the -.Li TELNET ABORT -(ABORT processes) +.Dv TELNET ABORT +(Abort +processes) sequence. -.Tp Ic ao +.It Ic ao Sends the -.Li TELNET AO +.Dv TELNET AO (Abort Output) sequence, which should cause the remote system to flush all output .Em from the remote system .Em to the user's terminal. -.Tp Ic ayt +.It Ic ayt Sends the -.Li TELNET AYT +.Dv TELNET AYT (Are You There) sequence, to which the remote system may or may not choose to respond. -.Tp Ic brk +.It Ic brk Sends the -.Li TELNET BRK +.Dv TELNET BRK (Break) sequence, which may have significance to the remote system. -.Tp Ic ec +.It Ic ec Sends the -.Li TELNET EC +.Dv TELNET EC (Erase Character) sequence, which should cause the remote system to erase the last character entered. -.Tp Ic el +.It Ic el Sends the -.Li TELNET EL +.Dv TELNET EL (Erase Line) sequence, which should cause the remote system to erase the line currently being entered. -.Tp Ic eof +.It Ic eof Sends the -.Li TELNET EOF +.Dv TELNET EOF (End Of File) sequence. -.Tp Ic eor +.It Ic eor Sends the -.Li TELNET EOR +.Dv TELNET EOR (End of Record) sequence. -.Tp Ic escape +.It Ic escape Sends the current .Nm telnet escape character (initially \*(Lq^\*(Rq). -.Tp Ic ga +.It Ic ga Sends the -.Li TELNET GA +.Dv TELNET GA (Go Ahead) sequence, which likely has no significance to the remote system. -.Tp Ic getstatus +.It Ic getstatus If the remote side supports the -.Li TELNET STATUS +.Dv TELNET STATUS command, .Ic getstatus will send the subnegotiation to request that the server send its current option status. -.Tp Ic ip +.It Ic ip Sends the -.Li TELNET IP +.Dv TELNET IP (Interrupt Process) sequence, which should cause the remote system to abort the currently running process. -.Tp Ic nop +.It Ic nop Sends the -.Li TELNET NOP +.Dv TELNET NOP (No OPeration) sequence. -.Tp Ic susp +.It Ic susp Sends the -.Li TELNET SUSP +.Dv TELNET SUSP (SUSPend process) sequence. -.Tp Ic synch +.It Ic synch Sends the -.Li TELNET SYNCH +.Dv TELNET SYNCH sequence. This sequence causes the remote system to discard all previously typed (but not yet read) input. -This sequence is sent as TCP urgent -data (and may not work if the remote system is a 4.2 BSD system -- if +This sequence is sent as +.Tn TCP +urgent +data (and may not work if the remote system is a +.Bx 4.2 +system -- if it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal). -.Tp Ic \&? +.It Ic do Ar cmd +.It Ic dont Ar cmd +.It Ic will Ar cmd +.It Ic wont Ar cmd +Sends the +.Dv TELNET DO +.Ar cmd +sequence. +.Ar Cmd +can be either a decimal number between 0 and 255, +or a symbolic name for a specific +.Dv TELNET +command. +.Ar Cmd +can also be either +.Ic help +or +.Ic \&? +to print out help information, including +a list of known symbolic names. +.It Ic \&? Prints out help information for the .Ic send command. -.Tp -.\" ######## END the "send" command -.\" -.\" ######## BEGIN the "set" and "unset" commands -.Tp Cx Ic set -.Cx \&\ \& -.Ar argument value -.Cx -.Tp Cx Ic unset -.Cx \&\ \& -.Ar argument value -.Cx +.El +.It Ic set Ar argument value +.It Ic unset Ar argument value The .Ic set command will set any one of a number of .Nm telnet -variables to a specific value or to TRUE. +variables to a specific value or to +.Dv TRUE . The special value .Ic off turns off the function associated with @@ -843,7 +720,9 @@ the variable, this is equivalent to using the command. The .Ic unset -command will disable or set to FALSE any of the specified functions. +command will disable or set to +.Dv FALSE +any of the specified functions. The values of variables may be interrogated with the .Ic display command. @@ -856,44 +735,36 @@ the and .Ic unset commands. -.Tw Fl -.Tp Ic ayt +.Bl -tag -width escape +.It Ic ayt If -.Nm telnet -is in -.Ic localchars -mode, or -.Li LINEMODE -is enabled, and the -.Ic status -character is typed, a -.Li TELNET AYT +.Tn TELNET +is in localchars mode, or +.Dv LINEMODE +is enabled, and the status character is typed, a +.Dv TELNET AYT sequence (see -.Ic send -.Ic ayt -above) -is sent to the remote host. -The initial value for the ayt character is taken to be -the terminal's -.Ic status -character. -.Tp Ic echo +.Ic send ayt +preceding) is sent to the +remote host. The initial value for the "Are You There" +character is the terminal's status character. +.It Ic echo This is the value (initially \*(Lq^E\*(Rq) which, when in \*(Lqline by line\*(Rq mode, toggles between doing local echoing of entered characters (for normal processing), and suppressing echoing of entered characters (for entering, say, a password). -.Tp Ic eof +.It Ic eof If .Nm telnet is operating in -.Li LINEMODE +.Dv LINEMODE or \*(Lqold line by line\*(Rq mode, entering this character as the first character on a line will cause this character to be sent to the remote system. The initial value of the eof character is taken to be the terminal's .Ic eof character. -.Tp Ic erase +.It Ic erase If .Nm telnet is in @@ -907,7 +778,7 @@ if .Nm telnet is operating in \*(Lqcharacter at a time\*(Rq mode, then when this character is typed, a -.Li TELNET EC +.Dv TELNET EC sequence (see .Ic send .Ic ec @@ -917,14 +788,14 @@ The initial value for the erase character is taken to be the terminal's .Ic erase character. -.Tp Ic escape +.It Ic escape This is the .Nm telnet escape character (initially \*(Lq^[\*(Rq) which causes entry into .Nm telnet command mode (when connected to a remote system). -.Tp Ic flushoutput +.It Ic flushoutput If .Nm telnet is in @@ -936,7 +807,7 @@ below) and the .Ic flushoutput character is typed, a -.Li TELNET AO +.Dv TELNET AO sequence (see .Ic send .Ic ao @@ -946,21 +817,18 @@ The initial value for the flush character is taken to be the terminal's .Ic flush character. -.Tp Ic forw1 -.Tp Ic forw2 +.It Ic forw1 +.It Ic forw2 If -.Nm telnet +.Tn TELNET is operating in -.Li LINEMODE, -these are the characters that, when typed, -cause partial lines to be forwarded to the remote system. -The initial value for the forw1 and forw2 characters are -taken from the terminal's -.Ic eol -and -.Ic eol2 -characters. -.Tp Ic interrupt +.Dv LINEMODE , +these are the +characters that, when typed, cause partial lines to be +forwarded to the remote system. The initial value for +the forwarding characters are taken from the terminal's +eol and eol2 characters. +.It Ic interrupt If .Nm telnet is in @@ -972,7 +840,7 @@ below) and the .Ic interrupt character is typed, a -.Li TELNET IP +.Dv TELNET IP sequence (see .Ic send .Ic ip @@ -982,7 +850,7 @@ The initial value for the interrupt character is taken to be the terminal's .Ic intr character. -.Tp Ic kill +.It Ic kill If .Nm telnet is in @@ -996,7 +864,7 @@ if .Nm telnet is operating in \*(Lqcharacter at a time\*(Rq mode, then when this character is typed, a -.Li TELNET EL +.Dv TELNET EL sequence (see .Ic send .Ic el @@ -1006,11 +874,11 @@ The initial value for the kill character is taken to be the terminal's .Ic kill character. -.Tp Ic lnext +.It Ic lnext If .Nm telnet is operating in -.Li LINEMODE +.Dv LINEMODE or \*(Lqold line by line\*(Lq mode, then this character is taken to be the terminal's .Ic lnext @@ -1019,7 +887,7 @@ The initial value for the lnext character is taken to be the terminal's .Ic lnext character. -.Tp Ic quit +.It Ic quit If .Nm telnet is in @@ -1031,7 +899,7 @@ below) and the .Ic quit character is typed, a -.Li TELNET BRK +.Dv TELNET BRK sequence (see .Ic send .Ic brk @@ -1041,11 +909,11 @@ The initial value for the quit character is taken to be the terminal's .Ic quit character. -.Tp Ic reprint +.It Ic reprint If .Nm telnet is operating in -.Li LINEMODE +.Dv LINEMODE or \*(Lqold line by line\*(Lq mode, then this character is taken to be the terminal's .Ic reprint @@ -1054,24 +922,19 @@ The initial value for the reprint character is taken to be the terminal's .Ic reprint character. -.Tp Ic rlogin +.It Ic rlogin This is the rlogin escape character. If set, the normal -.Nm telnet -.Ic escape -character will be ignored unless it is preceded by this character -at the beginning of a line. -This character, at the beginning of a line, followed by a ``.'' -will close the connection; when followed by a ``^Z'' it will -suspend the -.Nm telnet -command. -The initial state is to have the -.Ic rlogin -escape character disabled. -.Tp Ic start +.Tn TELNET +escape character is ignored unless it is +preceded by this character at the beginning of a line. +This character, at the beginning of a line followed by +a "." closes the connection; when followed by a ^Z it +suspends the telnet command. The initial state is to +disable the rlogin escape character. +.It Ic start If the -.Li TELNET TOGGLE-FLOW-CONTROL +.Dv TELNET TOGGLE-FLOW-CONTROL option has been enabled, then this character is taken to be the terminal's @@ -1081,9 +944,9 @@ The initial value for the kill character is taken to be the terminal's .Ic start character. -.Tp Ic stop +.It Ic stop If the -.Li TELNET TOGGLE-FLOW-CONTROL +.Dv TELNET TOGGLE-FLOW-CONTROL option has been enabled, then this character is taken to be the terminal's @@ -1093,17 +956,17 @@ The initial value for the kill character is taken to be the terminal's .Ic stop character. -.Tp Ic susp +.It Ic susp If .Nm telnet is in .Ic localchars mode, or -.Li LINEMODE +.Dv LINEMODE is enabled, and the .Ic suspend character is typed, a -.Li TELNET SUSP +.Dv TELNET SUSP sequence (see .Ic send .Ic susp @@ -1113,20 +976,21 @@ The initial value for the suspend character is taken to be the terminal's .Ic suspend character. -.Tp Ic tracefile +.It Ic tracefile This is the file to which the output, caused by -.Ic netdata, -.Ic termdata, +.Ic netdata or .Ic option -tracing being TRUE, will be written. If it is set to +tracing being +.Dv TRUE , +will be written. If it is set to .Dq Fl , then tracing information will be written to standard output (the default). -.Tp Ic worderase +.It Ic worderase If .Nm telnet is operating in -.Li LINEMODE +.Dv LINEMODE or \*(Lqold line by line\*(Lq mode, then this character is taken to be the terminal's .Ic worderase @@ -1135,29 +999,23 @@ The initial value for the worderase character is taken to be the terminal's .Ic worderase character. -.Tp Ic \&? +.It Ic \&? Displays the legal .Ic set .Pq Ic unset commands. -.Tp -.\" ######## END the "set" and "unset" commands -.\" -.\" ######## BEGIN the "slc" command -.Tp Cx Ic slc -.Cx \&\ \& -.Ar state -.Cx +.El +.It Ic slc Ar state The .Ic slc command (Set Local Characters) is used to set or change the state of the the special characters when the -.Li TELNET LINEMODE +.Dv TELNET LINEMODE option has been enabled. Special characters are characters that get mapped to -.Li TELNET +.Tn TELNET commands sequences (like .Ic ip or @@ -1167,52 +1025,46 @@ or line editing characters (like and .Ic kill ) . By default, the local special characters are exported. -.Tw Fl -.Tp Ic export +.Bl -tag -width Fl +.It Ic check +Verify the current settings for the current special characters. +The remote side is requested to send all the current special +character settings, and if there are any discrepancies with +the local side, the local side will switch to the remote value. +.It Ic export Switch to the local defaults for the special characters. The local default characters are those of the local terminal at the time when .Nm telnet was started. -.Tp Ic import +.It Ic import Switch to the remote defaults for the special characters. The remote default characters are those of the remote system at the time when the -.Li TELNET +.Tn TELNET connection was established. -.Tp Ic check -Verify the current settings for the current special characters. -The remote side is requested to send all the current special -character settings, and if there are any discrepancies with -the local side, the local side will switch to the remote value. -.Tp Ic \&? +.It Ic \&? Prints out help information for the .Ic slc command. -.Tp -.\" ######## END the "slc" command -.\" -.\" ######## BEGIN the "status" command -.Tp Ic status +.El +.It Ic status Show the current status of .Nm telnet . This includes the peer one is connected to, as well as the current mode. -.\" ######## END the "status" command -.\" -.\" ######## BEGIN the "toggle" command -.Tp Cx Ic toggle -.Cx \&\ \& -.Ar arguments ... -.Cx +.It Ic toggle Ar arguments ... Toggle (between -TRUE +.Dv TRUE and -FALSE) +.Dv FALSE ) various flags that control how .Nm telnet responds to events. -These flags may be set explicitly to TRUE or FALSE +These flags may be set explicitly to +.Dv TRUE +or +.Dv FALSE using the .Ic set and @@ -1223,72 +1075,76 @@ The state of these flags may be interrogated with the .Ic display command. Valid arguments are: -.Tw Ar -.Tp Ic authdebug -Turn on debugging information for the authentication code. -.Tp Ic autoflush +.Bl -tag -width Ar +.It Ic authdebug +Turns on debugging information for the authentication code. +.It Ic autoflush If .Ic autoflush and .Ic localchars are both -TRUE, +.Dv TRUE , then when the .Ic ao , or .Ic quit characters are recognized (and transformed into -.Li TELNET +.Tn TELNET sequences; see .Ic set above for details), .Nm telnet refuses to display any data on the user's terminal until the remote system acknowledges (via a -.Li TELNET TIMING MARK +.Dv TELNET TIMING MARK option) that it has processed those -.Li TELNET +.Tn TELNET sequences. -The initial value for this toggle is TRUE if the terminal user had not -done an "stty noflsh", otherwise FALSE (see +The initial value for this toggle is +.Dv TRUE +if the terminal user had not +done an "stty noflsh", otherwise +.Dv FALSE +(see .Xr stty 1 ) . -.Tp Ic autoencrypt -.Tp Ic autodecrypt +.It Ic autodecrypt When the -.Li TELNET ENCRYPTION -option is negotiated, -by default the actual encryption (decryption) of the data -stream does not automatically start. -The -.Ic autoencrypt -.Ic (autodecrypt) -command states that encryption of the output (input) stream should be -enabled as soon as possible. -.Tp Ic autologin -If the -.Li TELNET AUTHENTICATION -option is supported by the remote side, then -.Nm telnet -will attempt to use it to perform automatic authentication. -If the -.Li AUTHENTICATION -option is not supported, then the users login name will -be propagated via the -.Li TELNET ENVIRON +.Dv TELNET ENCRYPT +option is negotiated, by +default the actual encryption (decryption) of the data +stream does not start automatically. The autoencrypt +(autodecrypt) command states that encryption of the +output (input) stream should be enabled as soon as +possible. +.Pp +Note: Because of export controls, the +.Dv TELNET ENCRYPT +option is not supported outside the United States and Canada. +.It Ic autologin +If the remote side supports the +.Dv TELNET AUTHENTICATION +option +.Tn TELNET +attempts to use it to perform automatic authentication. If the +.Dv AUTHENTICATION +option is not supported, the user's login +name are propagated through the +.Dv TELNET ENVIRON option. This command is the same as specifying -.Fl a +.Ar a option on the .Ic open command. -.Tp Ic autosynch +.It Ic autosynch If .Ic autosynch and .Ic localchars are both -TRUE, +.Dv TRUE , then when either the .Ic intr or @@ -1300,34 +1156,42 @@ above for descriptions of the and .Ic quit characters), the resulting -.Li TELNET +.Tn TELNET sequence sent is followed by the -.Li TELNET SYNCH +.Dv TELNET SYNCH sequence. This procedure .Ic should cause the remote system to begin throwing away all previously typed input until both of the -.Li TELNET +.Tn TELNET sequences have been read and acted upon. -The initial value of this toggle is FALSE. -.Tp Ic binary +The initial value of this toggle is +.Dv FALSE . +.It Ic binary Enable or disable the -.Li TELNET BINARY +.Dv TELNET BINARY option on both input and output. -.Tp Ic inbinary +.It Ic inbinary Enable or disable the -.Li TELNET BINARY +.Dv TELNET BINARY option on input. -.Tp Ic outbinary +.It Ic outbinary Enable or disable the -.Li TELNET BINARY +.Dv TELNET BINARY option on output. -.Tp Ic crlf -If this is TRUE, then carriage returns will be sent as . -If this is FALSE, then carriage returns will be send as . -The initial value for this toggle is FALSE. -.Tp Ic crmod +.It Ic crlf +If this is +.Dv TRUE , +then carriage returns will be sent as +.Li . +If this is +.Dv FALSE , +then carriage returns will be send as +.Li . +The initial value for this toggle is +.Dv FALSE . +.It Ic crmod Toggle carriage return mode. When this mode is enabled, most carriage return characters received from the remote host will be mapped into a carriage return followed by @@ -1336,16 +1200,18 @@ This mode does not affect those characters typed by the user, only those received from the remote host. This mode is not very useful unless the remote host only sends carriage return, but never line feed. -The initial value for this toggle is FALSE. -.Tp Ic debug +The initial value for this toggle is +.Dv FALSE . +.It Ic debug Toggles socket level debugging (useful only to the .Ic super user ) . -The initial value for this toggle is FALSE. -.Tp Ic encdebug -Turn on debugging information for the encryption code. -.Tp Ic localchars +The initial value for this toggle is +.Dv FALSE . +.It Ic encdebug +Turns on debugging information for the encryption code. +.It Ic localchars If this is -TRUE, +.Dv TRUE , then the .Ic flush , .Ic interrupt , @@ -1356,7 +1222,7 @@ and characters (see .Ic set above) are recognized locally, and transformed into (hopefully) appropriate -.Li TELNET +.Tn TELNET control sequences (respectively .Ic ao , @@ -1368,15 +1234,20 @@ and see .Ic send above). -The initial value for this toggle is TRUE in \*(Lqold line by line\*(Rq mode, -and FALSE in \*(Lqcharacter at a time\*(Rq mode. +The initial value for this toggle is +.Dv TRUE +in \*(Lqold line by line\*(Rq mode, +and +.Dv FALSE +in \*(Lqcharacter at a time\*(Rq mode. When the -.Li LINEMODE +.Dv LINEMODE option is enabled, the value of .Ic localchars -is ignored, and assumed to always be TRUE. +is ignored, and assumed to always be +.Dv TRUE . If -.Li LINEMODE +.Dv LINEMODE has ever been enabled, then .Ic quit is sent as @@ -1390,93 +1261,79 @@ are sent as see .Ic send above). -.Tp Ic netdata +.It Ic netdata Toggles the display of all network data (in hexadecimal format). -The initial value for this toggle is FALSE. -.Tp Ic options +The initial value for this toggle is +.Dv FALSE . +.It Ic options Toggles the display of some internal .Nm telnet protocol processing (having to do with -.Li TELNET +.Tn TELNET options). -The initial value for this toggle is FALSE. -.Tp Ic prettydump +The initial value for this toggle is +.Dv FALSE . +.It Ic prettydump When the .Ic netdata -or -.Ic termdata toggle is enabled, if .Ic prettydump is enabled the output from the .Ic netdata -and -.Ic termdata -command will be formated in a more user readable format. +command will be formatted in a more user readable format. Spaces are put between each character in the output, and the beginning of any -.Li TELNET +.Tn TELNET escape sequence is preceded by a '*' to aid in locating them. -.Tp Ic skiprc -When the -.Ic skiprc -toggle -is TRUE, then -.Nm telnet -will skip the reading of the +.It Ic skiprc +When the skiprc toggle is +.Dv TRUE , +.Tn TELNET +skips the reading of the .Pa \&.telnetrc -file in the users home directory -when connections are opened. -The initial value for this toggle is FALSE. -.Tp Ic termdata +file in the users home +directory when connections are opened. The initial +value for this toggle is +.Dv FALSE. +.It Ic termdata Toggles the display of all terminal data (in hexadecimal format). -The initial value for this toggle is FALSE. -.Tp Ic verbose_encrypt +The initial value for this toggle is +.Dv FALSE . +.It Ic verbose_encrypt When the .Ic verbose_encrypt -toggle is TRUE, then -.Nm telnet -will print out a message each time encryption is -enabled or disabled. -The initial value for this toggle is FALSE. -.Tp Ic \&? +toggle is +.Dv TRUE , +.Tn TELNET +prints out a message each time encryption is enabled or +disabled. The initial value for this toggle is +.Dv FALSE. +Note: Because of export controls, data encryption +is not supported outside of the United States and Canada. +.It Ic \&? Displays the legal .Ic toggle commands. -.Tp -.\" ######## END the "toggle" command -.\" -.\" ######## BEGIN the "z" command -.Tp Ic z +.El +.It Ic z Suspend .Nm telnet . This command only works when the user is using the .Xr csh 1 . -.\" ######## END the "z" command -.\" -.\" ######## BEGIN the "!" command -.Tp Cx Ic \&! -.Cx \&\ \& -.Op Ar command -.Cx +.It Ic \&! Op Ar command Execute a single command in a subshell on the local system. If .Ic command is omitted, then an interactive subshell is invoked. -.\" ######## END the "!" command -.\" -.\" ######## BEGIN the "?" command -.Tp Cx Ic \&? -.Cx \&\ \& -.Op Ar command -.Cx +.It Ic \&? Op Ar command Get help. With no arguments, .Nm telnet prints a help summary. If a command is specified, .Nm telnet will print the help information for just that command. -.\" ######## END the "!" command +.El .Sh ENVIRONMENT .Nm Telnet uses at least the @@ -1488,24 +1345,25 @@ and environment variables. Other environment variables may be propagated to the other side via the -.Li TELNET ENVIRON +.Dv TELNET ENVIRON option. .Sh FILES -.Dw ~/.telnetrc -.Di L -.Dp Pa ~/.telnetrc +.Bl -tag -width ~/.telnetrc -compact +.It Pa ~/.telnetrc user customized telnet startup values -.Dp +.El .Sh HISTORY +The .Nm Telnet -appeared in 4.2 BSD. +command appeared in +.Bx 4.2 . .Sh NOTES .Pp On some remote systems, echo has to be turned off manually when in \*(Lqold line by line\*(Rq mode. .Pp In \*(Lqold line by line\*(Rq mode or -.Li LINEMODE +.Dv LINEMODE the terminal's .Ic eof character is only recognized (and sent to the remote system) diff --git a/src/appl/telnet/telnet/telnet.c b/src/appl/telnet/telnet/telnet.c index 4cbecafee..e1008313b 100644 --- a/src/appl/telnet/telnet/telnet.c +++ b/src/appl/telnet/telnet/telnet.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988, 1990 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1990, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)telnet.c 5.54 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)telnet.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #include @@ -128,6 +128,11 @@ cc_t echoc; #define TS_SE 8 /* looking for sub-option end */ static int telrcv_state; +#ifdef OLD_ENVIRON +unsigned char telopt_environ = TELOPT_NEW_ENVIRON; +#else +# define telopt_environ TELOPT_NEW_ENVIRON +#endif jmp_buf toplevel = { 0 }; jmp_buf peerdied; @@ -172,9 +177,9 @@ init_telnet() ClearArray(options); connected = In3270 = ISend = localflow = donebinarytoggle = 0; -#if defined(ENCRYPTION) || defined(AUTHENTICATION) +#if defined(AUTHENTICATION) || defined(ENCRYPTION) auth_encrypt_connect(connected); -#endif +#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */ restartany = -1; SYNCHing = 0; @@ -364,9 +369,9 @@ willoption(option) #if defined(AUTHENTICATION) case TELOPT_AUTHENTICATION: #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION case TELOPT_ENCRYPT: -#endif +#endif /* ENCRYPTION */ new_state_ok = 1; break; @@ -396,10 +401,10 @@ willoption(option) } } set_my_state_do(option); -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (option == TELOPT_ENCRYPT) encrypt_send_support(); -#endif +#endif /* ENCRYPTION */ } void @@ -487,12 +492,26 @@ dooption(option) case TELOPT_LFLOW: /* local flow control */ case TELOPT_TTYPE: /* terminal type option */ case TELOPT_SGA: /* no big deal */ - case TELOPT_ENVIRON: /* environment variable option */ -#if defined(ENCRYPTION) +#ifdef ENCRYPTION case TELOPT_ENCRYPT: /* encryption variable option */ +#endif /* ENCRYPTION */ + new_state_ok = 1; + break; + + case TELOPT_NEW_ENVIRON: /* New environment variable option */ +#ifdef OLD_ENVIRON + if (my_state_is_will(TELOPT_OLD_ENVIRON)) + send_wont(TELOPT_OLD_ENVIRON, 1); /* turn off the old */ + goto env_common; + case TELOPT_OLD_ENVIRON: /* Old environment variable option */ + if (my_state_is_will(TELOPT_NEW_ENVIRON)) + break; /* Don't enable if new one is in use! */ + env_common: + telopt_environ = option; #endif new_state_ok = 1; break; + #if defined(AUTHENTICATION) case TELOPT_AUTHENTICATION: if (autologin) @@ -566,6 +585,16 @@ dontoption(option) case TELOPT_LINEMODE: linemode = 0; /* put us back to the default state */ break; +#ifdef OLD_ENVIRON + case TELOPT_NEW_ENVIRON: + /* + * The new environ option wasn't recognized, try + * the old one. + */ + send_will(TELOPT_OLD_ENVIRON, 1); + telopt_environ = TELOPT_OLD_ENVIRON; + break; +#endif } /* we always accept a DONT */ set_my_want_state_wont(option); @@ -783,8 +812,10 @@ gettermname() static void suboption() { + unsigned char subchar; + printsub('<', subbuffer, SB_LEN()+2); - switch (SB_GET()) { + switch (subchar = SB_GET()) { case TELOPT_TTYPE: if (my_want_state_is_wont(TELOPT_TTYPE)) return; @@ -890,17 +921,20 @@ suboption() } break; - case TELOPT_ENVIRON: +#ifdef OLD_ENVIRON + case TELOPT_OLD_ENVIRON: +#endif + case TELOPT_NEW_ENVIRON: if (SB_EOF()) return; switch(SB_PEEK()) { case TELQUAL_IS: case TELQUAL_INFO: - if (my_want_state_is_dont(TELOPT_ENVIRON)) + if (my_want_state_is_dont(subchar)) return; break; case TELQUAL_SEND: - if (my_want_state_is_wont(TELOPT_ENVIRON)) { + if (my_want_state_is_wont(subchar)) { return; } break; @@ -970,7 +1004,7 @@ suboption() } break; #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION case TELOPT_ENCRYPT: if (SB_EOF()) return; @@ -1030,7 +1064,7 @@ suboption() break; } break; -#endif +#endif /* ENCRYPTION */ default: break; } @@ -1452,6 +1486,26 @@ slc_update() return(need_update); } +#ifdef OLD_ENVIRON +# ifdef ENV_HACK +/* + * Earlier version of telnet/telnetd from the BSD code had + * the definitions of VALUE and VAR reversed. To ensure + * maximum interoperability, we assume that the server is + * an older BSD server, until proven otherwise. The newer + * BSD servers should be able to handle either definition, + * so it is better to use the wrong values if we don't + * know what type of server it is. + */ +int env_auto = 1; +int old_env_var = OLD_ENV_VAR; +int old_env_value = OLD_ENV_VALUE; +# else +# define old_env_var OLD_ENV_VAR +# define old_env_value OLD_ENV_VALUE +# endif +#endif + void env_opt(buf, len) register unsigned char *buf; @@ -1467,7 +1521,28 @@ env_opt(buf, len) env_opt_add(NULL); } else for (i = 1; i < len; i++) { switch (buf[i]&0xff) { - case ENV_VALUE: +#ifdef OLD_ENVIRON + case OLD_ENV_VAR: +# ifdef ENV_HACK + if (telopt_environ == TELOPT_OLD_ENVIRON + && env_auto) { + /* Server has the same definitions */ + old_env_var = OLD_ENV_VAR; + old_env_value = OLD_ENV_VALUE; + } + /* FALL THROUGH */ +# endif + case OLD_ENV_VALUE: + /* + * Although OLD_ENV_VALUE is not legal, we will + * still recognize it, just in case it is an + * old server that has VAR & VALUE mixed up... + */ + /* FALL THROUGH */ +#else + case NEW_ENV_VAR: +#endif + case ENV_USERVAR: if (ep) { *epc = 0; env_opt_add(ep); @@ -1482,10 +1557,10 @@ env_opt(buf, len) *epc++ = buf[i]; break; } - if (ep) { - *epc = 0; - env_opt_add(ep); - } + } + if (ep) { + *epc = 0; + env_opt_add(ep); } env_opt_end(1); break; @@ -1521,7 +1596,7 @@ env_opt_start() opt_replyend = opt_reply + OPT_REPLY_SIZE; *opt_replyp++ = IAC; *opt_replyp++ = SB; - *opt_replyp++ = TELOPT_ENVIRON; + *opt_replyp++ = telopt_environ; *opt_replyp++ = TELQUAL_IS; } @@ -1571,7 +1646,12 @@ env_opt_add(ep) opt_replyend = opt_reply + len; } if (opt_welldefined(ep)) - *opt_replyp++ = ENV_VAR; +#ifdef OLD_ENVIRON + if (telopt_environ == TELOPT_OLD_ENVIRON) + *opt_replyp++ = old_env_var; + else +#endif + *opt_replyp++ = NEW_ENV_VAR; else *opt_replyp++ = ENV_USERVAR; for (;;) { @@ -1580,8 +1660,8 @@ env_opt_add(ep) case IAC: *opt_replyp++ = IAC; break; - case ENV_VALUE: - case ENV_VAR: + case NEW_ENV_VAR: + case NEW_ENV_VALUE: case ENV_ESC: case ENV_USERVAR: *opt_replyp++ = ENV_ESC; @@ -1590,7 +1670,12 @@ env_opt_add(ep) *opt_replyp++ = c; } if (ep = vp) { - *opt_replyp++ = ENV_VALUE; +#ifdef OLD_ENVIRON + if (telopt_environ == TELOPT_OLD_ENVIRON) + *opt_replyp++ = old_env_value; + else +#endif + *opt_replyp++ = NEW_ENV_VALUE; vp = NULL; } else break; @@ -1661,10 +1746,10 @@ telrcv() } c = *sbp++ & 0xff, scc--; count++; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (decrypt_input) c = (*decrypt_input)(c); -#endif +#endif /* ENCRYPTION */ switch (telrcv_state) { @@ -1689,10 +1774,10 @@ telrcv() *Ifrontp++ = c; while (scc > 0) { c = *sbp++ & 0377, scc--; count++; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (decrypt_input) c = (*decrypt_input)(c); -#endif +#endif /* ENCRYPTION */ if (c == IAC) { telrcv_state = TS_IAC; break; @@ -1711,10 +1796,10 @@ telrcv() if ((c == '\r') && my_want_state_is_dont(TELOPT_BINARY)) { if (scc > 0) { c = *sbp&0xff; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (decrypt_input) c = (*decrypt_input)(c); -#endif +#endif /* ENCRYPTION */ if (c == 0) { sbp++, scc--; count++; /* a "true" CR */ @@ -1724,10 +1809,10 @@ telrcv() sbp++, scc--; count++; TTYADD('\n'); } else { -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (decrypt_input) (*decrypt_input)(-1); -#endif +#endif /* ENCRYPTION */ TTYADD('\r'); if (crmod) { @@ -2164,7 +2249,7 @@ telnet(user) { sys_telnet_init(); -#if defined(ENCRYPTION) || defined(AUTHENTICATION) +#if defined(AUTHENTICATION) || defined(ENCRYPTION) { static char local_host[256] = { 0 }; @@ -2175,24 +2260,24 @@ telnet(user) auth_encrypt_init(local_host, hostname, "TELNET", 0); auth_encrypt_user(user); } -#endif +#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */ # if !defined(TN3270) if (telnetport) { #if defined(AUTHENTICATION) if (autologin) send_will(TELOPT_AUTHENTICATION, 1); #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION send_do(TELOPT_ENCRYPT, 1); send_will(TELOPT_ENCRYPT, 1); -#endif +#endif /* ENCRYPTION */ send_do(TELOPT_SGA, 1); send_will(TELOPT_TTYPE, 1); send_will(TELOPT_NAWS, 1); send_will(TELOPT_TSPEED, 1); send_will(TELOPT_LFLOW, 1); send_will(TELOPT_LINEMODE, 1); - send_will(TELOPT_ENVIRON, 1); + send_will(TELOPT_NEW_ENVIRON, 1); send_do(TELOPT_STATUS, 1); if (env_getvalue((unsigned char *)"DISPLAY")) send_will(TELOPT_XDISPLOC, 1); diff --git a/src/appl/telnet/telnet/terminal.c b/src/appl/telnet/telnet/terminal.c index 190126fdb..b6d3b864a 100644 --- a/src/appl/telnet/telnet/terminal.c +++ b/src/appl/telnet/telnet/terminal.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988, 1990 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1990, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)terminal.c 5.4 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)terminal.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #include @@ -207,7 +207,7 @@ setconnmode(force) { #ifdef ENCRYPTION static int enc_passwd = 0; -#endif +#endif /* ENCRYPTION */ register int newmode; newmode = getconnmode()|(force?MODE_FORCE:0); @@ -227,7 +227,7 @@ setconnmode(force) enc_passwd = 0; } } -#endif +#endif /* ENCRYPTION */ } diff --git a/src/appl/telnet/telnet/tn3270.c b/src/appl/telnet/telnet/tn3270.c index 67aa569bd..1f285cf98 100644 --- a/src/appl/telnet/telnet/tn3270.c +++ b/src/appl/telnet/telnet/tn3270.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)tn3270.c 5.2 (Berkeley) 3/1/91"; +static char sccsid[] = "@(#)tn3270.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #include @@ -50,7 +50,7 @@ static char sccsid[] = "@(#)tn3270.c 5.2 (Berkeley) 3/1/91"; #include "../ctlr/screen.h" #include "../general/globals.h" -#include "../telextrn.h" +#include "../sys_curses/telextrn.h" #include "../ctlr/externs.h" #if defined(unix) @@ -164,7 +164,8 @@ DataToNetwork(buffer, count, done) #if defined(unix) void -inputAvailable() +inputAvailable(signo) + int signo; { HaveInput = 1; sigiocount++; @@ -384,7 +385,7 @@ tn3270_ttype() } #if defined(unix) - void + int settranscom(argc, argv) int argc; char *argv[]; @@ -395,7 +396,7 @@ settranscom(argc, argv) transcom = 0; } if (argc == 1) { - return; + return 1; } transcom = tline; (void) strcpy(transcom, argv[1]); @@ -403,6 +404,7 @@ settranscom(argc, argv) (void) strcat(transcom, " "); (void) strcat(transcom, argv[i]); } + return 1; } #endif /* defined(unix) */ diff --git a/src/appl/telnet/telnet/types.h b/src/appl/telnet/telnet/types.h index bcdf28181..191d311fd 100644 --- a/src/appl/telnet/telnet/types.h +++ b/src/appl/telnet/telnet/types.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)types.h 5.1 (Berkeley) 9/14/90 + * @(#)types.h 8.1 (Berkeley) 6/6/93 */ typedef struct { diff --git a/src/appl/telnet/telnet/utilities.c b/src/appl/telnet/telnet/utilities.c index bf75b2415..c40fccc6e 100644 --- a/src/appl/telnet/telnet/utilities.c +++ b/src/appl/telnet/telnet/utilities.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)utilities.c 5.6 (Berkeley) 1/19/93"; +static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #define TELOPTS @@ -203,10 +203,12 @@ printoption(direction, cmd, option) } else fprintf(NetTrace, "%s %d %d", direction, cmd, option); } - if (NetTrace == stdout) + if (NetTrace == stdout) { fprintf(NetTrace, "\r\n"); - else + fflush(NetTrace); + } else { fprintf(NetTrace, "\n"); + } return; } @@ -328,7 +330,9 @@ printsub(direction, pointer, length) length -= 2; } if (length < 1) { - fprintf(NetTrace, "(Empty suboption???)"); + fprintf(NetTrace, "(Empty suboption??\?)"); + if (NetTrace == stdout) + fflush(NetTrace); return; } switch (pointer[0]) { @@ -350,7 +354,7 @@ printsub(direction, pointer, length) case TELOPT_TSPEED: fprintf(NetTrace, "TERMINAL-SPEED"); if (length < 2) { - fprintf(NetTrace, " (empty suboption???)"); + fprintf(NetTrace, " (empty suboption??\?)"); break; } switch (pointer[1]) { @@ -372,7 +376,7 @@ printsub(direction, pointer, length) case TELOPT_LFLOW: fprintf(NetTrace, "TOGGLE-FLOW-CONTROL"); if (length < 2) { - fprintf(NetTrace, " (empty suboption???)"); + fprintf(NetTrace, " (empty suboption??\?)"); break; } switch (pointer[1]) { @@ -394,7 +398,7 @@ printsub(direction, pointer, length) case TELOPT_NAWS: fprintf(NetTrace, "NAWS"); if (length < 2) { - fprintf(NetTrace, " (empty suboption???)"); + fprintf(NetTrace, " (empty suboption??\?)"); break; } if (length == 2) { @@ -419,7 +423,7 @@ printsub(direction, pointer, length) case TELOPT_AUTHENTICATION: fprintf(NetTrace, "AUTHENTICATION"); if (length < 2) { - fprintf(NetTrace, " (empty suboption???)"); + fprintf(NetTrace, " (empty suboption??\?)"); break; } switch (pointer[1]) { @@ -432,7 +436,7 @@ printsub(direction, pointer, length) else fprintf(NetTrace, "%d ", pointer[2]); if (length < 3) { - fprintf(NetTrace, "(partial suboption???)"); + fprintf(NetTrace, "(partial suboption??\?)"); break; } fprintf(NetTrace, "%s|%s", @@ -454,7 +458,7 @@ printsub(direction, pointer, length) else fprintf(NetTrace, "%d ", pointer[i]); if (++i >= length) { - fprintf(NetTrace, "(partial suboption???)"); + fprintf(NetTrace, "(partial suboption??\?)"); break; } fprintf(NetTrace, "%s|%s ", @@ -482,11 +486,11 @@ printsub(direction, pointer, length) break; #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION case TELOPT_ENCRYPT: fprintf(NetTrace, "ENCRYPT"); if (length < 2) { - fprintf(NetTrace, " (empty suboption???)"); + fprintf(NetTrace, " (empty suboption??\?)"); break; } switch (pointer[1]) { @@ -511,7 +515,7 @@ printsub(direction, pointer, length) fprintf(NetTrace, " %s ", (pointer[1] == ENCRYPT_IS) ? "IS" : "REPLY"); if (length < 3) { - fprintf(NetTrace, " (partial suboption???)"); + fprintf(NetTrace, " (partial suboption??\?)"); break; } if (ENCTYPE_NAME_OK(pointer[2])) @@ -551,12 +555,12 @@ printsub(direction, pointer, length) break; } break; -#endif +#endif /* ENCRYPTION */ case TELOPT_LINEMODE: fprintf(NetTrace, "LINEMODE "); if (length < 2) { - fprintf(NetTrace, " (empty suboption???)"); + fprintf(NetTrace, " (empty suboption??\?)"); break; } switch (pointer[1]) { @@ -573,7 +577,7 @@ printsub(direction, pointer, length) fprintf(NetTrace, "DONT "); common: if (length < 3) { - fprintf(NetTrace, "(no option???)"); + fprintf(NetTrace, "(no option??\?)"); break; } switch (pointer[2]) { @@ -626,7 +630,7 @@ printsub(direction, pointer, length) case LM_MODE: fprintf(NetTrace, "MODE "); if (length < 3) { - fprintf(NetTrace, "(no mode???)"); + fprintf(NetTrace, "(no mode??\?)"); break; } { @@ -747,8 +751,14 @@ printsub(direction, pointer, length) } break; - case TELOPT_ENVIRON: - fprintf(NetTrace, "ENVIRON "); + case TELOPT_NEW_ENVIRON: + fprintf(NetTrace, "NEW-ENVIRON "); +#ifdef OLD_ENVIRON + goto env_common1; + case TELOPT_OLD_ENVIRON: + fprintf(NetTrace, "OLD-ENVIRON"); + env_common1: +#endif switch (pointer[1]) { case TELQUAL_IS: fprintf(NetTrace, "IS "); @@ -761,17 +771,40 @@ printsub(direction, pointer, length) env_common: { register int noquote = 2; +#if defined(ENV_HACK) && defined(OLD_ENVIRON) + extern int old_env_var, old_env_value; +#endif for (i = 2; i < length; i++ ) { switch (pointer[i]) { - case ENV_VAR: - if (pointer[1] == TELQUAL_SEND) - goto def_case; - fprintf(NetTrace, "\" VAR " + noquote); + case NEW_ENV_VALUE: +#ifdef OLD_ENVIRON + /* case NEW_ENV_OVAR: */ + if (pointer[0] == TELOPT_OLD_ENVIRON) { +# ifdef ENV_HACK + if (old_env_var == OLD_ENV_VALUE) + fprintf(NetTrace, "\" (VALUE) " + noquote); + else +# endif + fprintf(NetTrace, "\" VAR " + noquote); + } else +#endif /* OLD_ENVIRON */ + fprintf(NetTrace, "\" VALUE " + noquote); noquote = 2; break; - case ENV_VALUE: - fprintf(NetTrace, "\" VALUE " + noquote); + case NEW_ENV_VAR: +#ifdef OLD_ENVIRON + /* case OLD_ENV_VALUE: */ + if (pointer[0] == TELOPT_OLD_ENVIRON) { +# ifdef ENV_HACK + if (old_env_value == OLD_ENV_VAR) + fprintf(NetTrace, "\" (VAR) " + noquote); + else +# endif + fprintf(NetTrace, "\" VALUE " + noquote); + } else +#endif /* OLD_ENVIRON */ + fprintf(NetTrace, "\" VAR " + noquote); noquote = 2; break; @@ -781,8 +814,6 @@ printsub(direction, pointer, length) break; case ENV_USERVAR: - if (pointer[1] == TELQUAL_SEND) - goto def_case; fprintf(NetTrace, "\" USERVAR " + noquote); noquote = 2; break; @@ -825,6 +856,8 @@ printsub(direction, pointer, length) else fprintf(NetTrace, "\n"); } + if (NetTrace == stdout) + fflush(NetTrace); } } diff --git a/src/appl/telnet/telnetd/Imakefile b/src/appl/telnet/telnetd/Imakefile index fd3fdf183..94e5b2cdb 100644 --- a/src/appl/telnet/telnetd/Imakefile +++ b/src/appl/telnet/telnetd/Imakefile @@ -23,20 +23,42 @@ # Everything happens in ../Makefile.config and Makefile.generic # +AUTH_DEF=-DAUTHENTICATION -DKRB5 -DFORWARD -DLOGIN_CAP_F -DLOGIN_PROGRAM=KRB5_PATH_LOGIN +AUTH_INC=-I../../../include +AUTH_LIB=$(KLIB) +AUTH_LIBPATH=$(DEPKLIB); + all: @-if [ -f ../Config.local ]; \ then \ echo make -f ../Config.local WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)"; \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)"; \ make -f ../Config.local WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)"; \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)"; \ else \ echo make -f ../Config.generic WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)" $(TELNET_OPSYS); \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)" \ + $(TELNET_OPSYS); \ make -f ../Config.generic WHAT="" CC="${CC}" \ - KLIB="$(KLIB)" DEPKLIB="$(DEPKLIB)" $(TELNET_OPSYS); \ + AUTH_DEF="$(AUTH_DEF)" \ + AUTH_INC="$(AUTH_INC)" \ + AUTH_LIB="$(AUTH_LIB)" \ + AUTH_LIBPATH="$(AUTH_LIBPATH)" \ + $(TELNET_OPSYS); \ fi +Makefiles:: + @echo "Do nothing!" + .DEFAULT: @-if [ -f ../Config.local ]; \ then \ diff --git a/src/appl/telnet/telnetd/Makefile.4.4 b/src/appl/telnet/telnetd/Makefile.4.4 index a62945ec3..4b1d5302e 100644 --- a/src/appl/telnet/telnetd/Makefile.4.4 +++ b/src/appl/telnet/telnetd/Makefile.4.4 @@ -1,26 +1,8 @@ -# -# Copyright (c) 1990 The Regents of the University of California. -# All rights reserved. -# -# Redistribution and use in source and binary forms are permitted provided -# that: (1) source distributions retain this entire copyright notice and -# comment, and (2) distributions including binaries display the following -# acknowledgement: ``This product includes software developed by the -# University of California, Berkeley and its contributors'' in the -# documentation or other materials provided with the distribution and in -# all advertising materials mentioning features or use of this software. -# Neither the name of the University nor the names of its contributors may -# be used to endorse or promote products derived from this software without -# specific prior written permission. -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# @(#)Makefile 5.15 (Berkeley) 3/5/91 -# +# @(#)Makefile 8.2 (Berkeley) 12/15/93 PROG= telnetd CFLAGS+=-DLINEMODE -DKLUDGELINEMODE -DUSE_TERMIO -DDIAGNOSTICS +CFLAGS+=-DOLD_ENVIRON -DENV_HACK CFLAGS+=-DAUTHENTICATION -DENCRYPTION -I${.CURDIR}/../../lib SRCS= authenc.c global.c slc.c state.c sys_term.c telnetd.c \ termstat.c utility.c @@ -29,4 +11,26 @@ LDADD= -lutil -ltermcap -ltelnet LDADD+= -lkrb -ldes MAN8= telnetd.0 +# These are the sources that have encryption stuff in them. +CRYPT_SRC= authenc.c ext.h state.c telnetd.c termstat.c +CRYPT_SRC+= utility.c Makefile +NOCRYPT_DIR=${.CURDIR}/Nocrypt + .include + +nocrypt: +#ifdef ENCRYPTION + @for i in ${CRYPT_SRC}; do \ + if [ ! -d ${NOCRYPT_DIR} ]; then \ + echo Creating subdirectory ${NOCRYPT_DIR}; \ + mkdir ${NOCRYPT_DIR}; \ + fi; \ + echo ${NOCRYPT_DIR}/$$i; \ + unifdef -UENCRYPTION ${.CURDIR}/$$i | \ + sed "s/ || defined(ENCRYPTION)//" > ${NOCRYPT_DIR}/$$i; \ + done + +placeholder: +#else /* ENCRYPTION */ + @echo "Encryption code already removed." +#endif /* ENCRYPTION */ diff --git a/src/appl/telnet/telnetd/Makefile.generic b/src/appl/telnet/telnetd/Makefile.generic index 0da4f96dd..892042973 100644 --- a/src/appl/telnet/telnetd/Makefile.generic +++ b/src/appl/telnet/telnetd/Makefile.generic @@ -26,7 +26,7 @@ OBJS= ${OBJ1} ${GETTYOBJ} SRCS= ${SRC1} ${GETTYSRC} MAN= telnetd.0 -CFLAGS= ${LCCFLAGS} $(INCLUDES) ${DEFINES} +CFLAGS= ${LCCFLAGS} ${INCLUDES} ${DEFINES} ARPA_TELNET = ../arpa/telnet.h # diff --git a/src/appl/telnet/telnetd/Makefile.orig b/src/appl/telnet/telnetd/Makefile.orig index 0e5389ac3..46597306c 100644 --- a/src/appl/telnet/telnetd/Makefile.orig +++ b/src/appl/telnet/telnetd/Makefile.orig @@ -22,9 +22,10 @@ # # Everything happens in ../Makefile.config and Makefile.generic # +SHELL=/bin/sh all: - @-if [ -f ../Config.local ]; \ + @-if test -f ../Config.local; \ then \ echo make -f ../Config.local WHAT=${WHAT} CC="${CC}"; \ make -f ../Config.local WHAT=${WHAT} CC="${CC}"; \ @@ -34,7 +35,7 @@ all: fi .DEFAULT: - @-if [ -f ../Config.local ]; \ + @-if test -f ../Config.local; \ then \ echo make -f ../Config.local WHAT=${WHAT} CC="${CC}" $@; \ make -f ../Config.local WHAT=${WHAT} CC="${CC}" $@; \ diff --git a/src/appl/telnet/telnetd/authenc.c b/src/appl/telnet/telnetd/authenc.c index b10e9e8b6..fcd17fcf7 100644 --- a/src/appl/telnet/telnetd/authenc.c +++ b/src/appl/telnet/telnetd/authenc.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,10 +32,10 @@ */ #ifndef lint -static char sccsid[] = "@(#)authenc.c 5.2 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)authenc.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ -#if defined(ENCRYPTION) || defined(AUTHENTICATION) +#if defined(AUTHENTICATION) || defined(ENCRYPTION) #include "telnetd.h" #include @@ -55,13 +55,13 @@ net_write(str, len) void net_encrypt() { -#if defined(ENCRYPTION) +#ifdef ENCRYPTION char *s = (nclearto > nbackp) ? nclearto : nbackp; if (s < nfrontp && encrypt_output) { (*encrypt_output)((unsigned char *)s, nfrontp - s); } nclearto = nfrontp; -#endif +#endif /* ENCRYPTION */ } int @@ -88,4 +88,4 @@ telnet_gets(prompt, result, length, echo) { return((char *)0); } -#endif +#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */ diff --git a/src/appl/telnet/telnetd/defs.h b/src/appl/telnet/telnetd/defs.h index 9afa0634f..a73d4a619 100644 --- a/src/appl/telnet/telnetd/defs.h +++ b/src/appl/telnet/telnetd/defs.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)defs.h 5.11 (Berkeley) 12/18/92 + * @(#)defs.h 8.1 (Berkeley) 6/4/93 */ /* @@ -146,6 +146,10 @@ typedef unsigned char cc_t; #include #endif /* CRAY */ +#ifdef __hpux +#include +#endif + #if !defined(TIOCSCTTY) && defined(TCSETCTTY) # define TIOCSCTTY TCSETCTTY #endif diff --git a/src/appl/telnet/telnetd/ext.h b/src/appl/telnet/telnetd/ext.h index a14252d95..b7c1786b7 100644 --- a/src/appl/telnet/telnetd/ext.h +++ b/src/appl/telnet/telnetd/ext.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)ext.h 5.8 (Berkeley) 12/18/92 + * @(#)ext.h 8.1 (Berkeley) 6/4/93 */ /* @@ -119,6 +119,7 @@ extern void init_termbuf P((void)), interrupt P((void)), localstat P((void)), + flowstat P((void)), netclear P((void)), netflush P((void)), #ifdef DIAGNOSTICS @@ -155,7 +156,9 @@ extern void extern int end_slc P((unsigned char **)), getnpty P((void)), - getpty P((void)), +#ifndef convex + getpty P((int *)), +#endif login_tty P((int)), spcset P((int, cc_t *, cc_t **)), stilloob P((int)), @@ -188,11 +191,11 @@ extern void wontoption P((int)), writenet P((unsigned char *, int)); -#if defined(ENCRYPTION) +#ifdef ENCRYPTION extern void (*encrypt_output) P((unsigned char *, int)); extern int (*decrypt_input) P((int)); extern char *nclearto; -#endif +#endif /* ENCRYPTION */ /* @@ -209,6 +212,7 @@ extern struct { ttypesubopt, /* ttype subopt is received */ tspeedsubopt, /* tspeed subopt is received */ environsubopt, /* environ subopt is received */ + oenvironsubopt, /* old environ subopt is received */ xdisplocsubopt, /* xdisploc subopt is received */ baseline, /* time started to do timed action */ gotDM; /* when did we last see a data mark */ diff --git a/src/appl/telnet/telnetd/global.c b/src/appl/telnet/telnetd/global.c index 328ef8ebe..af21acc69 100644 --- a/src/appl/telnet/telnetd/global.c +++ b/src/appl/telnet/telnetd/global.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)global.c 5.2 (Berkeley) 6/1/90"; +static char sccsid[] = "@(#)global.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ /* diff --git a/src/appl/telnet/telnetd/pathnames.h b/src/appl/telnet/telnetd/pathnames.h index ed016ae46..c8b0806e7 100644 --- a/src/appl/telnet/telnetd/pathnames.h +++ b/src/appl/telnet/telnetd/pathnames.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,19 +30,23 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)pathnames.h 5.5 (Berkeley) 6/28/90 + * @(#)pathnames.h 8.1 (Berkeley) 6/4/93 */ #if BSD > 43 # include -# define _PATH_LOGIN "/usr/bin/login" +# ifndef _PATH_LOGIN +# define _PATH_LOGIN "/usr/bin/login" +# endif #else # define _PATH_TTY "/dev/tty" -# define _PATH_LOGIN "/nfs/kerberos/bin/sbin/sun3/login.krb5" +# ifndef _PATH_LOGIN +# define _PATH_LOGIN "/bin/login" +# endif #endif diff --git a/src/appl/telnet/telnetd/slc.c b/src/appl/telnet/telnetd/slc.c index b03299158..145746afe 100644 --- a/src/appl/telnet/telnetd/slc.c +++ b/src/appl/telnet/telnetd/slc.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)slc.c 5.8 (Berkeley) 12/18/92"; +static char sccsid[] = "@(#)slc.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ #include "telnetd.h" diff --git a/src/appl/telnet/telnetd/state.c b/src/appl/telnet/telnetd/state.c index 34cebf293..0349ce619 100644 --- a/src/appl/telnet/telnetd/state.c +++ b/src/appl/telnet/telnetd/state.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)state.c 5.12 (Berkeley) 1/19/93"; +static char sccsid[] = "@(#)state.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ #include "telnetd.h" @@ -40,19 +40,19 @@ static char sccsid[] = "@(#)state.c 5.12 (Berkeley) 1/19/93"; #include #endif -char doopt[] = { IAC, DO, '%', 'c', 0 }; -char dont[] = { IAC, DONT, '%', 'c', 0 }; -char will[] = { IAC, WILL, '%', 'c', 0 }; -char wont[] = { IAC, WONT, '%', 'c', 0 }; +unsigned char doopt[] = { IAC, DO, '%', 'c', 0 }; +unsigned char dont[] = { IAC, DONT, '%', 'c', 0 }; +unsigned char will[] = { IAC, WILL, '%', 'c', 0 }; +unsigned char wont[] = { IAC, WONT, '%', 'c', 0 }; int not42 = 1; /* * Buffer for sub-options, and macros * for suboptions buffer manipulations */ -unsigned char subbuffer[1024], *subpointer= subbuffer, *subend= subbuffer; +unsigned char subbuffer[2048], *subpointer= subbuffer, *subend= subbuffer; -#define SB_CLEAR() subpointer = subbuffer; +#define SB_CLEAR() subpointer = subbuffer #define SB_TERM() { subend = subpointer; SB_CLEAR(); } #define SB_ACCUM(c) if (subpointer < (subbuffer+sizeof subbuffer)) { \ *subpointer++ = (c); \ @@ -61,6 +61,11 @@ unsigned char subbuffer[1024], *subpointer= subbuffer, *subend= subbuffer; #define SB_EOF() (subpointer >= subend) #define SB_LEN() (subend - subpointer) +#ifdef ENV_HACK +unsigned char *subsave; +#define SB_SAVE() subsave = subpointer; +#define SB_RESTORE() subpointer = subsave; +#endif /* @@ -89,10 +94,10 @@ telrcv() if ((&ptyobuf[BUFSIZ] - pfrontp) < 2) break; c = *netip++ & 0377, ncc--; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (decrypt_input) c = (*decrypt_input)(c); -#endif +#endif /* ENCRYPTION */ switch (state) { case TS_CR: @@ -121,10 +126,10 @@ telrcv() */ if ((c == '\r') && his_state_is_wont(TELOPT_BINARY)) { int nc = *netip; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (decrypt_input) nc = (*decrypt_input)(nc & 0xff); -#endif +#endif /* ENCRYPTION */ #ifdef LINEMODE /* * If we are operating in linemode, @@ -137,10 +142,10 @@ telrcv() } else #endif { -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (decrypt_input) (void)(*decrypt_input)(-1); -#endif +#endif /* ENCRYPTION */ state = TS_CR; } } @@ -447,7 +452,7 @@ send_do(option, init) set_his_want_state_will(option); do_dont_resp[option]++; } - (void) sprintf(nfrontp, doopt, option); + (void) sprintf(nfrontp, (char *)doopt, option); nfrontp += sizeof (dont) - 2; DIAG(TD_OPTIONS, printoption("td: send do", option)); @@ -461,7 +466,7 @@ extern void doclientstat(); #endif #ifdef ENCRYPTION extern void encrypt_send_support(); -#endif +#endif /* ENCRYPTION */ void willoption(option) @@ -550,7 +555,8 @@ willoption(option) case TELOPT_NAWS: case TELOPT_TSPEED: case TELOPT_XDISPLOC: - case TELOPT_ENVIRON: + case TELOPT_NEW_ENVIRON: + case TELOPT_OLD_ENVIRON: changeok++; break; @@ -579,7 +585,7 @@ willoption(option) func = encrypt_send_support; changeok++; break; -#endif +#endif /* ENCRYPTION */ default: break; @@ -643,12 +649,10 @@ willoption(option) case TELOPT_ENCRYPT: func = encrypt_send_support; break; -#endif -#ifdef LINE_MODE +#endif /* ENCRYPTION */ case TELOPT_LFLOW: - func = localstat; + func = flowstat; break; -#endif } } } @@ -668,7 +672,7 @@ send_dont(option, init) set_his_want_state_wont(option); do_dont_resp[option]++; } - (void) sprintf(nfrontp, dont, option); + (void) sprintf(nfrontp, (char *)dont, option); nfrontp += sizeof (doopt) - 2; DIAG(TD_OPTIONS, printoption("td: send dont", option)); @@ -766,7 +770,11 @@ wontoption(option) settimer(xdisplocsubopt); break; - case TELOPT_ENVIRON: + case TELOPT_OLD_ENVIRON: + settimer(oenvironsubopt); + break; + + case TELOPT_NEW_ENVIRON: settimer(environsubopt); break; @@ -814,7 +822,7 @@ send_will(option, init) set_my_want_state_will(option); will_wont_resp[option]++; } - (void) sprintf(nfrontp, will, option); + (void) sprintf(nfrontp, (char *)will, option); nfrontp += sizeof (doopt) - 2; DIAG(TD_OPTIONS, printoption("td: send will", option)); @@ -932,18 +940,21 @@ dooption(option) /* NOT REACHED */ break; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION case TELOPT_ENCRYPT: changeok++; break; -#endif +#endif /* ENCRYPTION */ case TELOPT_LINEMODE: case TELOPT_TTYPE: case TELOPT_NAWS: case TELOPT_TSPEED: case TELOPT_LFLOW: case TELOPT_XDISPLOC: - case TELOPT_ENVIRON: +#ifdef TELOPT_ENVIRON + case TELOPT_NEW_ENVIRON: +#endif + case TELOPT_OLD_ENVIRON: default: break; } @@ -970,7 +981,7 @@ send_wont(option, init) set_my_want_state_wont(option); will_wont_resp[option]++; } - (void) sprintf(nfrontp, wont, option); + (void) sprintf(nfrontp, (char *)wont, option); nfrontp += sizeof (wont) - 2; DIAG(TD_OPTIONS, printoption("td: send wont", option)); @@ -1061,6 +1072,14 @@ dontoption(option) } /* end of dontoption */ +#ifdef ENV_HACK +int env_ovar = -1; +int env_ovalue = -1; +#else /* ENV_HACK */ +# define env_ovar OLD_ENV_VAR +# define env_ovalue OLD_ENV_VALUE +#endif /* ENV_HACK */ + /* * suboption() * @@ -1237,22 +1256,142 @@ suboption() break; } /* end of case TELOPT_XDISPLOC */ - case TELOPT_ENVIRON: { +#ifdef TELOPT_NEW_ENVIRON + case TELOPT_NEW_ENVIRON: +#endif + case TELOPT_OLD_ENVIRON: { register int c; register char *cp, *varp, *valp; if (SB_EOF()) return; c = SB_GET(); - if (c == TELQUAL_IS) - settimer(environsubopt); - else if (c != TELQUAL_INFO) + if (c == TELQUAL_IS) { + if (subchar == TELOPT_OLD_ENVIRON) + settimer(oenvironsubopt); + else + settimer(environsubopt); + } else if (c != TELQUAL_INFO) { return; + } - while (!SB_EOF()) { +#ifdef TELOPT_NEW_ENVIRON + if (subchar == TELOPT_NEW_ENVIRON) { + while (!SB_EOF()) { c = SB_GET(); - if ((c == ENV_VAR) || (c == ENV_USERVAR)) + if ((c == NEW_ENV_VAR) || (c == ENV_USERVAR)) break; + } + } else +#endif + { +#ifdef ENV_HACK + /* + * We only want to do this if we haven't already decided + * whether or not the other side has its VALUE and VAR + * reversed. + */ + if (env_ovar < 0) { + register int last = -1; /* invalid value */ + int empty = 0; + int got_var = 0, got_value = 0, got_uservar = 0; + + /* + * The other side might have its VALUE and VAR values + * reversed. To be interoperable, we need to determine + * which way it is. If the first recognized character + * is a VAR or VALUE, then that will tell us what + * type of client it is. If the fist recognized + * character is a USERVAR, then we continue scanning + * the suboption looking for two consecutive + * VAR or VALUE fields. We should not get two + * consecutive VALUE fields, so finding two + * consecutive VALUE or VAR fields will tell us + * what the client is. + */ + SB_SAVE(); + while (!SB_EOF()) { + c = SB_GET(); + switch(c) { + case OLD_ENV_VAR: + if (last < 0 || last == OLD_ENV_VAR + || (empty && (last == OLD_ENV_VALUE))) + goto env_ovar_ok; + got_var++; + last = OLD_ENV_VAR; + break; + case OLD_ENV_VALUE: + if (last < 0 || last == OLD_ENV_VALUE + || (empty && (last == OLD_ENV_VAR))) + goto env_ovar_wrong; + got_value++; + last = OLD_ENV_VALUE; + break; + case ENV_USERVAR: + /* count strings of USERVAR as one */ + if (last != ENV_USERVAR) + got_uservar++; + if (empty) { + if (last == OLD_ENV_VALUE) + goto env_ovar_ok; + if (last == OLD_ENV_VAR) + goto env_ovar_wrong; + } + last = ENV_USERVAR; + break; + case ENV_ESC: + if (!SB_EOF()) + c = SB_GET(); + /* FALL THROUGH */ + default: + empty = 0; + continue; + } + empty = 1; + } + if (empty) { + if (last == OLD_ENV_VALUE) + goto env_ovar_ok; + if (last == OLD_ENV_VAR) + goto env_ovar_wrong; + } + /* + * Ok, the first thing was a USERVAR, and there + * are not two consecutive VAR or VALUE commands, + * and none of the VAR or VALUE commands are empty. + * If the client has sent us a well-formed option, + * then the number of VALUEs received should always + * be less than or equal to the number of VARs and + * USERVARs received. + * + * If we got exactly as many VALUEs as VARs and + * USERVARs, the client has the same definitions. + * + * If we got exactly as many VARs as VALUEs and + * USERVARS, the client has reversed definitions. + */ + if (got_uservar + got_var == got_value) { + env_ovar_ok: + env_ovar = OLD_ENV_VAR; + env_ovalue = OLD_ENV_VALUE; + } else if (got_uservar + got_value == got_var) { + env_ovar_wrong: + env_ovar = OLD_ENV_VALUE; + env_ovalue = OLD_ENV_VAR; + DIAG(TD_OPTIONS, {sprintf(nfrontp, + "ENVIRON VALUE and VAR are reversed!\r\n"); + nfrontp += strlen(nfrontp);}); + + } + } + SB_RESTORE(); +#endif + + while (!SB_EOF()) { + c = SB_GET(); + if ((c == env_ovar) || (c == ENV_USERVAR)) + break; + } } if (SB_EOF()) @@ -1262,13 +1401,21 @@ suboption() valp = 0; while (!SB_EOF()) { - switch (c = SB_GET()) { - case ENV_VALUE: + c = SB_GET(); + if (subchar == TELOPT_OLD_ENVIRON) { + if (c == env_ovar) + c = NEW_ENV_VAR; + else if (c == env_ovalue) + c = NEW_ENV_VALUE; + } + switch (c) { + + case NEW_ENV_VALUE: *cp = '\0'; cp = valp = (char *)subpointer; break; - case ENV_VAR: + case NEW_ENV_VAR: case ENV_USERVAR: *cp = '\0'; if (valp) @@ -1295,7 +1442,7 @@ suboption() else unsetenv(varp); break; - } /* end of case TELOPT_ENVIRON */ + } /* end of case TELOPT_NEW_ENVIRON */ #if defined(AUTHENTICATION) case TELOPT_AUTHENTICATION: if (SB_EOF()) @@ -1317,7 +1464,7 @@ suboption() } break; #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION case TELOPT_ENCRYPT: if (SB_EOF()) break; @@ -1359,7 +1506,7 @@ suboption() break; } break; -#endif +#endif /* ENCRYPTION */ default: break; @@ -1399,7 +1546,7 @@ send_status() * WILL/DO, and the "want_state" will be WONT/DONT. We * need to go by the latter. */ - for (i = 0; i < NTELOPTS; i++) { + for (i = 0; i < (unsigned char)NTELOPTS; i++) { if (my_want_state_is_will(i)) { ADD(WILL); ADD_DATA(i); diff --git a/src/appl/telnet/telnetd/sys_term.c b/src/appl/telnet/telnetd/sys_term.c index 92a0d19d3..e4f2bbf49 100644 --- a/src/appl/telnet/telnetd/sys_term.c +++ b/src/appl/telnet/telnetd/sys_term.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,34 +32,60 @@ */ #ifndef lint -static char sccsid[] = "@(#)sys_term.c 5.19 (Berkeley) 1/19/93"; +static char sccsid[] = "@(#)sys_term.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ #include "telnetd.h" -#include +#include "pathnames.h" + +#ifndef LOGIN_PROGRAM +#define LOGIN_PROGRAM _PATH_LOGIN +#endif #if defined(AUTHENTICATION) #include #endif +#if defined(KRB5) +#include +#endif + +#if defined(CRAY) || defined(__hpux) +# define PARENT_DOES_UTMP +#endif + #ifdef NEWINIT #include +int utmp_len = MAXHOSTNAMELEN; /* sizeof(init_request.host) */ #else /* NEWINIT*/ # ifdef UTMPX # include +struct utmpx wtmp; # else # include -# endif /* UTMPX */ struct utmp wtmp; +# endif /* UTMPX */ int utmp_len = sizeof(wtmp.ut_host); -# ifndef CRAY +# ifndef PARENT_DOES_UTMP char wtmpf[] = "/usr/adm/wtmp"; char utmpf[] = "/etc/utmp"; -# else /* CRAY */ +# else /* PARENT_DOES_UTMP */ char wtmpf[] = "/etc/wtmp"; +# endif /* PARENT_DOES_UTMP */ + +# ifdef CRAY #include #include +# if defined(_SC_CRAY_SECURE_SYS) && !defined(SCM_SECURITY) + /* + * UNICOS 6.0/6.1 do not have SCM_SECURITY defined, so we can + * use it to tell us to turn off all the socket security code, + * since that is only used in UNICOS 7.0 and later. + */ +# undef _SC_CRAY_SECURE_SYS +# endif + # if defined(_SC_CRAY_SECURE_SYS) #include #include @@ -80,6 +106,10 @@ extern struct sysv sysv; #ifdef STREAMS #include #endif +#ifdef __hpux +#include +#include +#endif #include #ifdef t_erase #undef t_erase @@ -451,7 +481,8 @@ char *myline = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; #endif /* CRAY */ int -getpty() +getpty(ptynum) +int *ptynum; { register int p; #ifdef STREAMSPTY @@ -470,13 +501,19 @@ getpty() #ifndef CRAY register char *cp, *p1, *p2; register int i; -#if defined(sun) && defined(TIOCGPGRP) +#if defined(sun) && defined(TIOCGPGRP) && BSD < 199207 int dummy; #endif +#ifndef __hpux (void) sprintf(line, "/dev/ptyXX"); p1 = &line[8]; p2 = &line[9]; +#else + (void) sprintf(line, "/dev/ptym/ptyXX"); + p1 = &line[13]; + p2 = &line[14]; +#endif for (cp = "pqrstuvwxyzPQRST"; *cp; cp++) { struct stat stb; @@ -494,32 +531,37 @@ getpty() *p2 = "0123456789abcdef"[i]; p = open(line, 2); if (p > 0) { +#ifndef __hpux line[5] = 't'; +#else + for (p1 = &line[8]; *p1; p1++) + *p1 = *(p1+1); + line[9] = 't'; +#endif chown(line, 0, 0); chmod(line, 0600); -#if defined(sun) && defined(TIOCGPGRP) +#if defined(sun) && defined(TIOCGPGRP) && BSD < 199207 if (ioctl(p, TIOCGPGRP, &dummy) == 0 || errno != EIO) { chmod(line, 0666); close(p); line[5] = 'p'; } else -#endif /* defined(sun) && defined(TIOCGPGRP) */ +#endif /* defined(sun) && defined(TIOCGPGRP) && BSD < 199207 */ return(p); } } } #else /* CRAY */ - register int npty; extern lowpty, highpty; struct stat sb; - for (npty = lowpty; npty <= highpty; npty++) { - (void) sprintf(myline, "/dev/pty/%03d", npty); + for (*ptynum = lowpty; *ptynum <= highpty; (*ptynum)++) { + (void) sprintf(myline, "/dev/pty/%03d", *ptynum); p = open(myline, 2); if (p < 0) continue; - (void) sprintf(line, "/dev/ttyp%03d", npty); + (void) sprintf(line, "/dev/ttyp%03d", *ptynum); /* * Here are some shenanigans to make sure that there * are no listeners lurking on the line. @@ -574,30 +616,6 @@ getpty() * tty_rspeed(val) Set receive speed to val. */ - int -tty_flowmode() -{ -#ifndef USE_TERMIO - return(((termbuf.tc.t_startc) > 0 && (termbuf.tc.t_stopc) > 0) ? 1 : 0); -#else - return((termbuf.c_iflag & IXON) ? 1 : 0); -#endif -} - - int -tty_restartany() -{ -#ifndef USE_TERMIO -# ifdef DECCTQ - return((termbuf.lflags & DECCTQ) ? 0 : 1); -# else - return(-1); -# endif -#else - return((termbuf.c_iflag & IXANY) ? 1 : 0); -#endif -} - #ifdef convex static int linestate; #endif @@ -639,6 +657,7 @@ tty_setlinemode(on) # endif #endif /* TIOCEXT */ } +#endif /* LINEMODE */ int tty_isecho() @@ -649,7 +668,30 @@ tty_isecho() return (termbuf.c_lflag & ECHO); #endif } -#endif /* LINEMODE */ + + int +tty_flowmode() +{ +#ifndef USE_TERMIO + return(((termbuf.tc.t_startc) > 0 && (termbuf.tc.t_stopc) > 0) ? 1 : 0); +#else + return((termbuf.c_iflag & IXON) ? 1 : 0); +#endif +} + + int +tty_restartany() +{ +#ifndef USE_TERMIO +# ifdef DECCTQ + return((termbuf.lflags & DECCTQ) ? 0 : 1); +# else + return(-1); +# endif +#else + return((termbuf.c_iflag & IXANY) ? 1 : 0); +#endif +} void tty_setecho(on) @@ -668,7 +710,6 @@ tty_setecho(on) #endif } -#if defined(LINEMODE) && defined(KLUDGELINEMODE) int tty_israw() { @@ -678,7 +719,24 @@ tty_israw() return(!(termbuf.c_lflag & ICANON)); #endif } -#endif /* defined(LINEMODE) && defined(KLUDGELINEMODE) */ + +#if defined (AUTHENTICATION) && defined(NO_LOGIN_F) && defined(LOGIN_R) + int +tty_setraw(on) +{ +# ifndef USE_TERMIO + if (on) + termbuf.sg.sg_flags |= RAW; + else + termbuf.sg.sg_flags &= ~RAW; +# else + if (on) + termbuf.c_lflag &= ~ICANON; + else + termbuf.c_lflag |= ICANON; +# endif +} +#endif void tty_binaryin(on) @@ -938,7 +996,7 @@ tty_isnewmap() } #endif -#ifdef CRAY +#ifdef PARENT_DOES_UTMP # ifndef NEWINIT extern struct utmp wtmp; extern char wtmpf[]; @@ -953,15 +1011,15 @@ nologinproc(sig) gotalarm++; } # endif /* NEWINIT */ -#endif /* CRAY */ +#endif /* PARENT_DOES_UTMP */ #ifndef NEWINIT -# ifdef CRAY +# ifdef PARENT_DOES_UTMP extern void utmp_sig_init P((void)); extern void utmp_sig_reset P((void)); extern void utmp_sig_wait P((void)); extern void utmp_sig_notify P((int)); -# endif +# endif /* PARENT_DOES_UTMP */ #endif /* @@ -1003,7 +1061,7 @@ getptyslave() * that we are the session (process group) leader. */ # ifdef TIOCNOTTY - t = open(KRB5_PATH_TTY, O_RDWR); + t = open(_PATH_TTY, O_RDWR); if (t >= 0) { (void) ioctl(t, TIOCNOTTY, (char *)0); (void) close(t); @@ -1011,7 +1069,7 @@ getptyslave() # endif -# ifdef CRAY +# ifdef PARENT_DOES_UTMP /* * Wait for our parent to get the utmp stuff to get done. */ @@ -1057,9 +1115,9 @@ getptyslave() # endif /* USE_TERMIO */ /* - * Settings for UNICOS + * Settings for UNICOS (and HPUX) */ -# ifdef CRAY +# if defined(CRAY) || defined(__hpux) termbuf.c_oflag = OPOST|ONLCR|TAB3; termbuf.c_iflag = IGNPAR|ISTRIP|ICRNL|IXON; termbuf.c_lflag = ISIG|ICANON|ECHO|ECHOE|ECHOK; @@ -1071,7 +1129,7 @@ getptyslave() * systems, other than 4.4BSD. In 4.4BSD the * kernel does the initial terminal setup. */ -# if defined(USE_TERMIO) && !defined(CRAY) && (BSD <= 43) +# if defined(USE_TERMIO) && !(defined(CRAY) || defined(__hpux)) && (BSD <= 43) # ifndef OXTABS # define OXTABS 0 # endif @@ -1096,8 +1154,17 @@ getptyslave() #endif /* !defined(CRAY) || !defined(NEWINIT) */ if (net > 2) (void) close(net); - if (pty > 2) +#if defined(AUTHENTICATION) && defined(NO_LOGIN_F) && defined(LOGIN_R) + /* + * Leave the pty open so that we can write out the rlogin + * protocol for /bin/login, if the authentication works. + */ +#else + if (pty > 2) { (void) close(pty); + pty = -1; + } +#endif } #if !defined(CRAY) || !defined(NEWINIT) @@ -1158,7 +1225,7 @@ cleanopen(line) * Hangup anybody else using this ttyp, then reopen it for * ourselves. */ -# if !defined(CRAY) && (BSD <= 43) && !defined(STREAMSPTY) +# if !(defined(CRAY) || defined(__hpux)) && (BSD <= 43) && !defined(STREAMSPTY) (void) signal(SIGHUP, SIG_IGN); vhangup(); (void) signal(SIGHUP, SIG_DFL); @@ -1207,12 +1274,22 @@ cleanopen(line) #endif /* !defined(CRAY) || !defined(NEWINIT) */ #if BSD <= 43 + int login_tty(t) int t; { - if (setsid() < 0) - fatalperror(net, "setsid()"); + if (setsid() < 0) { +#ifdef ultrix + /* + * The setsid() may have failed because we + * already have a pgrp == pid. Zero out + * our pgrp and try again... + */ + if ((setpgrp(0, 0) < 0) || (setsid() < 0)) +#endif + fatalperror(net, "setsid()"); + } # ifdef TIOCSCTTY if (ioctl(t, TIOCSCTTY, (char *)0) < 0) fatalperror(net, "ioctl(sctty)"); @@ -1226,6 +1303,14 @@ login_tty(t) fatalperror(net, "open(/dev/tty)"); # endif # else + /* + * We get our controlling tty assigned as a side-effect + * of opening up a tty device. But on BSD based systems, + * this only happens if our process group is zero. The + * setsid() call above may have set our pgrp, so clear + * it out before opening the tty... + */ + (void) setpgrp(0, 0); close(open(line, O_RDWR)); # endif if (t != 0) @@ -1279,14 +1364,14 @@ startslave(host, autologin, autoname) #endif #ifndef NEWINIT -# ifdef CRAY +# ifdef PARENT_DOES_UTMP utmp_sig_init(); -# endif /* CRAY */ +# endif /* PARENT_DOES_UTMP */ if ((i = fork()) < 0) fatalperror(net, "fork"); if (i) { -# ifdef CRAY +# ifdef PARENT_DOES_UTMP /* * Cray parent will create utmp entry for child and send * signal to child to tell when done. Child waits for signal @@ -1306,18 +1391,24 @@ startslave(host, autologin, autoname) SCPYN(wtmp.ut_user, "LOGIN"); SCPYN(wtmp.ut_host, host); SCPYN(wtmp.ut_line, line + sizeof("/dev/") - 1); +#ifndef __hpux SCPYN(wtmp.ut_id, wtmp.ut_line+3); +#else + SCPYN(wtmp.ut_id, wtmp.ut_line+7); +#endif pututline(&wtmp); endutent(); if ((i = open(wtmpf, O_WRONLY|O_APPEND)) >= 0) { (void) write(i, (char *)&wtmp, sizeof(struct utmp)); (void) close(i); } +#ifdef CRAY (void) signal(WJSIGNAL, sigjob); +#endif utmp_sig_notify(pid); -# endif /* CRAY */ +# endif /* PARENT_DOES_UTMP */ } else { - getptyslave(); + getptyslave(autologin); start_login(host, autologin, autoname); /*NOTREACHED*/ } @@ -1389,7 +1480,7 @@ init_env() envp = envinit; if (*envp = getenv("TZ")) *envp++ -= 3; -#ifdef CRAY +#if defined(CRAY) || defined(__hpux) else *envp++ = "TZ=GMT0"; #endif @@ -1415,11 +1506,12 @@ start_login(host, autologin, name) register char *cp; register char **argv; char **addarg(); + extern char *getenv(); #ifdef UTMPX register int pid = getpid(); struct utmpx utmpx; #endif -#ifdef __svr4__ +#ifdef SOLARIS char *term; char termbuf[64]; #endif @@ -1452,21 +1544,34 @@ start_login(host, autologin, name) * -f : force this login, he has already been authenticated */ argv = addarg(0, "login"); - argv = addarg(argv, "-h"); - argv = addarg(argv, host); -#ifdef __svr4__ + +#if !defined(NO_LOGIN_H) + +# if defined (AUTHENTICATION) && defined(NO_LOGIN_F) && defined(LOGIN_R) /* - * SVR4 version of -h takes TERM= as second arg, or - + * Don't add the "-h host" option if we are going + * to be adding the "-r host" option down below... */ - term = getenv("TERM"); - if (term == NULL || term[0] == 0) { - term = "-"; - } else { - strcpy(termbuf, "TERM="); - strncat(termbuf, term, sizeof(termbuf) - 6); - term = termbuf; + if ((auth_level < 0) || (autologin != AUTH_VALID)) +# endif + { + argv = addarg(argv, "-h"); + argv = addarg(argv, host); +#ifdef SOLARIS + /* + * SVR4 version of -h takes TERM= as second arg, or - + */ + term = getenv("TERM"); + if (term == NULL || term[0] == 0) { + term = "-"; + } else { + strcpy(termbuf, "TERM="); + strncat(termbuf, term, sizeof(termbuf) - 6); + term = termbuf; + } + argv = addarg(argv, term); +#endif } - argv = addarg(argv, term); #endif #if !defined(NO_LOGIN_P) argv = addarg(argv, "-p"); @@ -1492,14 +1597,91 @@ start_login(host, autologin, name) #if defined (AUTHENTICATION) if (auth_level >= 0 && autologin == AUTH_VALID) { # if !defined(NO_LOGIN_F) +#if defined(LOGIN_CAP_F) + argv = addarg(argv, "-F"); +#else argv = addarg(argv, "-f"); +#endif + argv = addarg(argv, name); +# else +# if defined(LOGIN_R) + /* + * We don't have support for "login -f", but we + * can fool /bin/login into thinking that we are + * rlogind, and allow us to log in without a + * password. The rlogin protocol expects + * local-user\0remote-user\0term/speed\0 + */ + + if (pty > 2) { + register char *cp; + char speed[128]; + int isecho, israw, xpty, len; + extern int def_rspeed; +# ifndef LOGIN_HOST + /* + * Tell login that we are coming from "localhost". + * If we passed in the real host name, then the + * user would have to allow .rhost access from + * every machine that they want authenticated + * access to work from, which sort of defeats + * the purpose of an authenticated login... + * So, we tell login that the session is coming + * from "localhost", and the user will only have + * to have "localhost" in their .rhost file. + */ +# define LOGIN_HOST "localhost" +# endif + argv = addarg(argv, "-r"); + argv = addarg(argv, LOGIN_HOST); + + xpty = pty; +# ifndef STREAMSPTY + pty = 0; +# else + ttyfd = 0; # endif + init_termbuf(); + isecho = tty_isecho(); + israw = tty_israw(); + if (isecho || !israw) { + tty_setecho(0); /* Turn off echo */ + tty_setraw(1); /* Turn on raw */ + set_termbuf(); + } + len = strlen(name)+1; + write(xpty, name, len); + write(xpty, name, len); + sprintf(speed, "%s/%d", (cp = getenv("TERM")) ? cp : "", + (def_rspeed > 0) ? def_rspeed : 9600); + len = strlen(speed)+1; + write(xpty, speed, len); + + if (isecho || !israw) { + init_termbuf(); + tty_setecho(isecho); + tty_setraw(israw); + set_termbuf(); + if (!israw) { + /* + * Write a newline to ensure + * that login will be able to + * read the line... + */ + write(xpty, "\n", 1); + } + } + pty = xpty; + } +# else argv = addarg(argv, name); +# endif +# endif } else #endif if (getenv("USER")) { argv = addarg(argv, getenv("USER")); -#if defined(CRAY) && defined(NO_LOGIN_P) +#if defined(LOGIN_ARGS) && defined(NO_LOGIN_P) { register char **cpp; for (cpp = environ; *cpp; cpp++) @@ -1518,11 +1700,15 @@ start_login(host, autologin, name) */ unsetenv("USER"); } +#if defined(AUTHENTICATION) && defined(NO_LOGIN_F) && defined(LOGIN_R) + if (pty > 2) + close(pty); +#endif closelog(); - execv(KRB5_PATH_LOGIN, argv); + execv(LOGIN_PROGRAM, argv); - syslog(LOG_ERR, "%s: %m\n", KRB5_PATH_LOGIN); - fatalperror(net, KRB5_PATH_LOGIN); + syslog(LOG_ERR, "%s: %m\n", LOGIN_PROGRAM); + fatalperror(net, LOGIN_PROGRAM); /*NOTREACHED*/ } @@ -1571,7 +1757,7 @@ addarg(argv, val) cleanup(sig) int sig; { -#ifndef CRAY +#ifndef PARENT_DOES_UTMP # if (BSD > 43) || defined(convex) char *p; @@ -1593,11 +1779,12 @@ cleanup(sig) (void) shutdown(net, 2); exit(1); # endif -#else /* CRAY */ +#else /* PARENT_DOES_UTMP */ # ifdef NEWINIT (void) shutdown(net, 2); exit(1); # else /* NEWINIT */ +# ifdef CRAY static int incleanup = 0; register int t; @@ -1620,20 +1807,32 @@ cleanup(sig) } incleanup = 1; sigsetmask(t); + if (secflag) { + /* + * We need to set ourselves back to a null + * label to clean up. + */ + + setulvl(sysv.sy_minlvl); + setucmp((long)0); + } t = cleantmp(&wtmp); setutent(); /* just to make sure */ +# endif /* CRAY */ rmut(line); close(pty); (void) shutdown(net, 2); +# ifdef CRAY if (t == 0) cleantmp(&wtmp); +# endif /* CRAY */ exit(1); # endif /* NEWINT */ -#endif /* CRAY */ +#endif /* PARENT_DOES_UTMP */ } -#if defined(CRAY) && !defined(NEWINIT) +#if defined(PARENT_DOES_UTMP) && !defined(NEWINIT) /* * _utmp_sig_rcv * utmp_sig_init @@ -1671,6 +1870,11 @@ utmp_sig_reset() (void) signal(SIGUSR1, func); /* reset handler to default */ } +# ifdef __hpux +# define sigoff() /* do nothing */ +# define sigon() /* do nothing */ +# endif + void utmp_sig_wait() { @@ -1691,6 +1895,7 @@ utmp_sig_notify(pid) kill(pid, SIGUSR1); } +# ifdef CRAY static int gotsigjob = 0; /*ARGSUSED*/ @@ -1725,7 +1930,8 @@ cleantmp(wtp) struct utmp *utp; static int first = 1; register int mask, omask, ret; - extern struct utmp *getutid P((struct utmp *)); + extern struct utmp *getutid P((const struct utmp *_Id)); + mask = sigmask(WJSIGNAL); @@ -1808,7 +2014,8 @@ cleantmpdir(jid, tpath, user) break; } } -#endif /* defined(CRAY) && !defined(NEWINIT) */ +# endif /* CRAY */ +#endif /* defined(PARENT_DOES_UTMP) && !defined(NEWINIT) */ /* * rmut() @@ -1818,6 +2025,7 @@ cleantmpdir(jid, tpath, user) */ #ifdef UTMPX + void rmut() { register f; @@ -1846,7 +2054,7 @@ rmut() } /* end of rmut */ #endif -#if !defined(UTMPX) && !defined(CRAY) && BSD <= 43 +#if !defined(UTMPX) && !(defined(CRAY) || defined(__hpux)) && BSD <= 43 void rmut() { @@ -1898,3 +2106,42 @@ rmut() (void) chown(line, 0, 0); } /* end of rmut */ #endif /* CRAY */ + +#ifdef __hpux +rmut (line) +char *line; +{ + struct utmp utmp; + struct utmp *utptr; + int fd; /* for /etc/wtmp */ + + utmp.ut_type = USER_PROCESS; + (void) strncpy(utmp.ut_id, line+12, sizeof(utmp.ut_id)); + (void) setutent(); + utptr = getutid(&utmp); + /* write it out only if it exists */ + if (utptr) { + utptr->ut_type = DEAD_PROCESS; + utptr->ut_time = time((long *) 0); + (void) pututline(utptr); + /* set wtmp entry if wtmp file exists */ + if ((fd = open(wtmpf, O_WRONLY | O_APPEND)) >= 0) { + (void) write(fd, utptr, sizeof(utmp)); + (void) close(fd); + } + } + (void) endutent(); + + (void) chmod(line, 0666); + (void) chown(line, 0, 0); + line[14] = line[13]; + line[13] = line[12]; + line[8] = 'm'; + line[9] = '/'; + line[10] = 'p'; + line[11] = 't'; + line[12] = 'y'; + (void) chmod(line, 0666); + (void) chown(line, 0, 0); +} +#endif diff --git a/src/appl/telnet/telnetd/telnetd.0 b/src/appl/telnet/telnetd/telnetd.0 deleted file mode 100644 index 3a7d3a708..000000000 --- a/src/appl/telnet/telnetd/telnetd.0 +++ /dev/null @@ -1,132 +0,0 @@ - - - -TELNETD(8) MAINTENANCE COMMANDS TELNETD(8) - - - -NAME - telnetd - DARPA TELNET protocol server - -SYNOPSIS - /etc/telnetd [-debug [_p_o_r_t]] [-l] [-D options] [-D report] - [-D exercise] [-D netdata] [-D ptydata] - -DESCRIPTION - _T_e_l_n_e_t_d is a server which supports the DARPA standard TELNET - virtual terminal protocol. _T_e_l_n_e_t_d is invoked by the inter- - net server (see _i_n_e_t_d(8)), normally for requests to connect - to the TELNET port as indicated by the /_e_t_c/_s_e_r_v_i_c_e_s file - (see _s_e_r_v_i_c_e_s(5)). If the -debug may be used, to start up - telnetd manually, instead of through _i_n_e_t_d(8). If started - up this way, _p_o_r_t may be specified to run _t_e_l_n_e_t_d on an - alternate TCP port number. - - The -D option may be used for debugging purposes. This - allows _t_e_l_n_e_t to print out debugging information to the con- - nection, allowing the user to see what telnetd is doing. - There are several modifiers: options prints information - about the negotiation of TELNET options, report prints the - options information, plus some additional information about - what processing is going on, netdata displays the data - stream received by _t_e_l_n_e_t_d, ptydata displays data written to - the pty, and exercise has not been implemented yet. - - _T_e_l_n_e_t_d operates by allocating a pseudo-terminal device (see - _p_t_y(4)) for a client, then creating a login process which - has the slave side of the pseudo-terminal as stdin, stdout, - and stderr. _T_e_l_n_e_t_d manipulates the master side of the - pseudo-terminal, implementing the TELNET protocol and pass- - ing characters between the remote client and the login pro- - cess. - - When a TELNET session is started up, _t_e_l_n_e_t_d sends TELNET - options to the client side indicating a willingness to do - _r_e_m_o_t_e _e_c_h_o of characters, to _s_u_p_p_r_e_s_s _g_o _a_h_e_a_d, to do - _r_e_m_o_t_e _f_l_o_w _c_o_n_t_r_o_l, and to receive _t_e_r_m_i_n_a_l _t_y_p_e _i_n_f_o_r_m_a_- - _t_i_o_n, _t_e_r_m_i_n_a_l _s_p_e_e_d _i_n_f_o_r_m_a_t_i_o_n, and _w_i_n_d_o_w _s_i_z_e _i_n_f_o_r_m_a_- - _t_i_o_n from the remote client. If the remote client is wil- - ling, the remote terminal type is propagated in the environ- - ment of the created login process. The pseudo-terminal - allocated to the client is configured to operate in "cooked" - mode, and with XTABS and CRMOD enabled (see _t_t_y(4)). - - _T_e_l_n_e_t_d is willing to _d_o: _e_c_h_o, _b_i_n_a_r_y, _s_u_p_p_r_e_s_s _g_o _a_h_e_a_d, - and _t_i_m_i_n_g _m_a_r_k. _T_e_l_n_e_t_d is willing to have the remote - client _d_o: _l_i_n_e_m_o_d_e, _b_i_n_a_r_y, _t_e_r_m_i_n_a_l _t_y_p_e, _t_e_r_m_i_n_a_l _s_p_e_e_d, - _w_i_n_d_o_w _s_i_z_e, _t_o_g_g_l_e _f_l_o_w _c_o_n_t_r_o_l, _e_n_v_i_r_o_n_m_e_n_t, _X _d_i_s_p_l_a_y - _l_o_c_a_t_i_o_n, and _s_u_p_p_r_e_s_s _g_o _a_h_e_a_d. - - - - -Sun Release 4.1 Last change: June 28, 1990 1 - - - - - - -TELNETD(8) MAINTENANCE COMMANDS TELNETD(8) - - - -SEE ALSO - telnet(1) - -BUGS - Some TELNET commands are only partially implemented. - - Because of bugs in the original 4.2 BSD _t_e_l_n_e_t(1), _t_e_l_n_e_t_d - performs some dubious protocol exchanges to try to discover - if the remote client is, in fact, a 4.2 BSD _t_e_l_n_e_t(1). - - _B_i_n_a_r_y _m_o_d_e 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. - - _T_e_l_n_e_t_d never sends TELNET _g_o _a_h_e_a_d commands. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Sun Release 4.1 Last change: June 28, 1990 2 - - - diff --git a/src/appl/telnet/telnetd/telnetd.0.ps b/src/appl/telnet/telnetd/telnetd.0.ps new file mode 100644 index 000000000..bbbdbd002 --- /dev/null +++ b/src/appl/telnet/telnetd/telnetd.0.ps @@ -0,0 +1,555 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.08 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Courier-Bold +%%+ font Courier-Oblique +%%+ font Courier +%%DocumentSuppliedResources: procset grops 1.08 0 +%%Pages: 5 +%%PageOrder: Ascend +%%Orientation: Portrait +%%EndComments +%%BeginProlog +%%BeginResource: procset grops 1.08 0 +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}bind def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/FL{ +currentgray exch setgray fill setgray +}bind def +/BL/fill load def +/LW/setlinewidth load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +}bind def +/PEND{ +clear +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Courier-Bold +%%IncludeResource: font Courier-Oblique +%%IncludeResource: font Courier +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL +792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron +/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space +/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft +/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four +/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C +/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash +/bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q +/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase +/guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger +/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar +/section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus +/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu +/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright +/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde +/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute +/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls +/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute +/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve +/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex +/udieresis/yacute/thorn/ydieresis]def/Courier@0 ENC0/Courier RE +/Courier-Oblique@0 ENC0/Courier-Oblique RE/Courier-Bold@0 ENC0/Courier-Bold RE +/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE +%%EndProlog +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNETD \( 8 \))72 48 R(BSD System Manager') +241.42 48 Q 2.5(sM)-.55 G 105.272(anual TELNETD)348.92 48 R 1.666(\(8\))1.666 G +/F1 10/Times-Bold@0 SF -.2(NA)72 108 S(ME).2 E/F2 10/Courier-Bold@0 SF(telnetd) +102 120 Q F0 2.52.5 G(ARP)161.46 120 Q(A)-.92 E/F3 9/Times-Roman@0 SF +(TELNET)2.5 E F0(protocol serv)2.5 E(er)-.15 E F1(SYNOPSIS)72 144 Q F2 +(/usr/libexec/telnetd)102 156 Q F0([)3.333 E F22.499 E/F4 10 +/Courier-Oblique@0 SF(authmode)6 E F0 3.333(][).833 G F2-.834 E F0 3.333 +(][).833 G F2-.834 E F4(debugmode)6 E F0 3.333(][).833 G F2(\255edebug) +-.834 E F0 3.333(][).833 G F2-.834 E F0(]).833 E([)228.833 168 Q F2 +2.499 E F4(initid)A F0 3.333(][).833 G F2-.834 E F0 3.333(][).833 G F2 +-.834 E F0 3.333(][).833 G F2-.834 E F0 3.333(][).833 G F2 +-.834 E F4(lowpty-highpty)A F0 3.333(][).833 G F2-.834 E F0 3.333(][).833 +G F2-.834 E F4(tos)228 180 Q F0 3.333(][).833 G F2-.834 E F4(len)6 +E F0 3.333(][).833 G F2-.834 E F0 3.333(][).833 G F2-.834 E F4 +(authtype)6 E F0 3.333(][).833 G F2(\255debug)-.834 E F0([)6.833 E F4(port).833 +E F0 .833(]]).833 G F1(DESCRIPTION)72 204 Q F0(The)102 216 Q F2(telnetd)3.044 E +F0 .544(command is a serv)3.044 F .544(er which supports the)-.15 F F3 -.36(DA) +3.044 G(RP).36 E(A)-.828 E F0(standard)3.044 E F3(TELNET)3.044 E F0 .543 +(virtual terminal protocol.)3.044 F F2(Telnetd)102 228 Q F0 .221 +(is normally in)2.721 F -.2(vo)-.4 G -.1(ke).2 G 2.721(db).1 G 2.721(yt)234.184 +228 S .221(he internet serv)244.685 228 R .221(er \(see)-.15 F/F5 10/Courier@0 +SF(inetd)2.721 E F0 2.942(\(8\)\) for)B .221(requests to connect to the)2.721 F +F3(TELNET)2.721 E F0 .673(port as indicated by the)102 240 R F5(/etc/services) +3.173 E F0 .673(\214le \(see)3.173 F F5(services)3.173 E F0 3.846(\(5\)\). The) +B F2(\255debug)4.839 E F0 .672(option may be used to)3.173 F .145(start up)102 +252 R F2(telnetd)2.645 E F0(manually)2.645 E 2.645(,i)-.65 G .145 +(nstead of through)223.65 252 R F5(inetd)2.645 E F0 2.79(\(8\). If)B .145 +(started up this w)2.645 F(ay)-.1 E(,)-.65 E F4(port)2.645 E F0 .145 +(may be speci\214ed to)2.645 F(run)102 264 Q F2(telnetd)2.5 E F0 +(on an alternate)2.5 E F3(TCP)2.5 E F0(port number)2.5 E(.)-.55 E(The)102 282 Q +F2(telnetd)2.5 E F0(command accepts the follo)2.5 E(wing options:)-.25 E F2 +103.666 300 Q F4(authmode)6 E F0 .106(This option may be used for specif\ +ying what mode should be used for authentication.)173 312 R(Note)5.106 E 2.778 +(that this option is only useful if)173 324 R F2(telnetd)5.279 E F0 2.779 +(has been compiled with support for the)5.279 F F5(AUTHENTICATION)173 336 Q F0 +2.5(option. There)2.5 F(are se)2.5 E -.15(ve)-.25 G(ral v).15 E(alid v)-.25 E +(alues for)-.25 E F4(authmode:)2.5 E F0(deb)173 354 Q 8.26(ug T)-.2 F +(urns on authentication deb)-.45 E(ugging code.)-.2 E 15.84(user Only)173 372 R +(allo)2.923 E 2.923(wc)-.25 G .423(onnections when the remote user can pro) +260.256 372 R .422(vide v)-.15 F .422(alid authentication in-)-.25 F 1.277 +(formation to identify the remote user)208 384 R 3.777(,a)-.4 G 1.277 +(nd is allo)372.181 384 R 1.277(wed access to the speci\214ed ac-)-.25 F +(count without pro)208 396 Q(viding a passw)-.15 E(ord.)-.1 E -.25(va)173 414 S +12.75(lid Only).25 F(allo)2.923 E 2.923(wc)-.25 G .423 +(onnections when the remote user can pro)260.256 414 R .422(vide v)-.15 F .422 +(alid authentication in-)-.25 F .742(formation to identify the remote user)208 +426 R 5.743(.T)-.55 G(he)372.995 426 Q F5(login)3.243 E F0 .743 +(\(1\) command will pro)B .743(vide an)-.15 F(y)-.15 E .53(additional user v) +208 438 R .529(eri\214cation needed if the remote user is not allo)-.15 F .529 +(wed automatic ac-)-.25 F(cess to the speci\214ed account.)208 450 Q 11.95 +(other Only)173 468 R(allo)3.028 E 3.029(wc)-.25 G .529 +(onnections that supply some authentication information.)260.467 468 R .529 +(This option)5.529 F .079(is currently not supported by an)208 480 R 2.578(yo) +-.15 G 2.578(ft)347.752 480 S .078(he e)356.44 480 R .078 +(xisting authentication mechanisms, and is)-.15 F(thus the same as specifying) +208 492 Q F2 -3.5(\255a valid)4.166 F F0(.)A 13.06(none This)173 510 R .869 +(is the def)3.369 F .869(ault state.)-.1 F .869 +(Authentication information is not required.)5.869 F .87(If no or in-)5.869 F +(suf)208 522 Q .394(\214cient authentication information is pro)-.25 F .393 +(vided, then the)-.15 F F5(login)2.893 E F0 .393(\(1\) program will)B(pro)208 +534 Q(vide the necessary user v)-.15 E(eri\214cation.)-.15 E(of)173 552 Q 23.59 +(fT)-.25 G 1.385(his disables the authentication code.)214.11 552 R 1.385 +(All user v)6.385 F 1.385(eri\214cation will happen through)-.15 F(the)208 564 +Q F5(login)2.5 E F0(\(1\) program.)A F2103.666 582 Q F0 .82 +(Speci\214es bftp serv)173 582 R .82(er mode.)-.15 F .819(In this mode,)5.82 F +F2(telnetd)3.319 E F0 .819(causes login to start a)3.319 F F5(bftp)3.319 E F0 +.819(\(1\) ses-)B .747(sion rather than the user')173 594 R 3.247(sn)-.55 G +.747(ormal shell.)286.995 594 R .748 +(In bftp daemon mode normal logins are not sup-)5.747 F +(ported, and it must be used on a port other than the normal)173 606 Q F3 +(TELNET)2.5 E F0(port.)2.5 E F2103.666 624 Q F4(debugmode)6 E F0 .827 +(This option may be used for deb)173 636 R .827(ugging purposes.)-.2 F .827 +(This allo)5.827 F(ws)-.25 E F2(telnetd)3.327 E F0 .827(to print out de-)3.327 +F -.2(bu)173 648 S .827(gging information to the connection, allo).2 F .827 +(wing the user to see what)-.25 F F2(telnetd)3.327 E F0 .827(is doing.)3.327 F +(There are se)173 660 Q -.15(ve)-.25 G(ral possible v).15 E(alues for)-.25 E F4 +(debugmode:)2.5 E F2(options)173 678 Q F0(Prints information about the ne)226 +678 Q(gotiation of)-.15 E F3(TELNET)2.5 E F0(options.)2.5 E(4.2 Berk)72 750 Q +(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71(ution February)-.2 F +(3, 1994)2.5 E(1)535 750 Q EP +%%Page: 2 2 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNETD \( 8 \))72 48 R(BSD System Manager') +241.42 48 Q 2.5(sM)-.55 G 105.272(anual TELNETD)348.92 48 R 1.666(\(8\))1.666 G +/F1 10/Courier-Bold@0 SF(report)173 96 Q F0 2.438(Prints the)226 96 R F1 +(options)4.938 E F0 2.437(information, plus some additional information about) +4.938 F(what processing is going on.)226 108 Q F1(netdata)173 126 Q F0 +(Displays the data stream recei)226 126 Q -.15(ve)-.25 G 2.5(db).15 G(y)367.51 +126 Q F1(telnetd.)2.5 E(ptydata)173 144 Q F0(Displays data written to the pty) +226 144 Q(.)-.65 E F1(exercise)173 162 Q F0(Has not been implemented yet.)5 E +F1(\255debug)103.666 180 Q F0(Enables deb)173 180 Q(ugging on each sock)-.2 E +(et created by)-.1 E F1(telnetd)2.5 E F0(\(see)2.5 E/F2 10/Courier@0 SF +(SO_DEBUG)2.5 E F0(in)2.5 E F2(socket)2.5 E F0(\(2\)\).)A F1(\255edebug)103.666 +198 Q F0(If)173 198 Q F1(telnetd)3.161 E F0 .662 +(has been compiled with support for data encryption, then the)3.161 F F1 +(\255edebug)4.828 E F0(op-)3.162 E(tion may be used to enable encryption deb) +173 210 Q(ugging code.)-.2 E F1103.666 228 Q F0(Disables the printing of\ + host-speci\214c information before login has been completed.)173 228 Q F1 +103.666 246 Q/F3 10/Courier-Oblique@0 SF(initid)7.171 E F0 1.171 +(This option is only applicable to)174.171 246 R/F4 9/Times-Roman@0 SF(UNICOS) +3.671 E F0 1.171(systems prior to 7.0.)3.671 F 1.17(It speci\214es the)6.171 F +F2(ID)3.67 E F0(from)3.67 E F2(/etc/inittab)173 258 Q F0 +(to use when init starts login sessions.)2.5 E(The def)5 E(ault)-.1 E F2(ID)2.5 +E F0(is)2.5 E F2(fe.)2.5 E F1103.666 276 Q F0 .556 +(This option is only useful if)173 276 R F1(telnetd)3.056 E F0 .557 +(has been compiled with both linemode and kludge)3.056 F .521 +(linemode support.)173 288 R .521(If the)5.521 F F14.687 E F0 .52 +(option is speci\214ed, then if the remote client does not support)3.02 F(the) +173 300 Q F2(LINEMODE)3.697 E F0 1.197(option, then)3.697 F F1(telnetd)3.697 E +F0 1.197(will operate in character at a time mode.)3.697 F 1.198(It will)6.198 +F .148(still support kludge linemode, b)173 312 R .147 +(ut will only go into kludge linemode if the remote client re-)-.2 F 2.06 +(quests it.)173 324 R 2.061(\(This is done by by the client sending)7.06 F F2 +2.061(DONT SUPPRESS-GO-AHEAD)4.561 F F0(and)4.561 E F2 .1(DONT ECHO)173 336 R +F0 .1(.\) The)B F14.266 E F0 .1 +(option is most useful when there are remote clients that do not sup-)2.6 F .67 +(port kludge linemode, b)173 348 R .67(ut pass the heuristic \(if the)-.2 F +3.17(yr)-.15 G .67(espond with)390.88 348 R F2 .67(WILL TIMING-MARK)3.17 F F0 +(in response to a)173 360 Q F2(DO TIMING-MARK\))2.5 E F0 +(for kludge linemode support.)2.5 E F1103.666 378 Q F0 .672 +(Speci\214es line mode.)173 378 R -.35(Tr)5.672 G .671 +(ies to force clients to use line- at-a-time mode.).35 F .671(If the)5.671 F F2 +(LINEMODE)3.171 E F0(option is not supported, it will go into kludge linemode.) +173 390 Q F1103.666 408 Q F0(Disable)173 408 Q F2(TCP)3.488 E F0 -.1(ke) +3.488 G(ep-ali).1 E -.15(ve)-.25 G 3.488(s. Normally).15 F F1(telnetd)3.488 E +F0 .988(enables the)3.488 F F4(TCP)3.489 E F0 -.1(ke)3.489 G(ep-ali).1 E 1.289 +-.15(ve m)-.25 H .989(echanism to).15 F .602(probe connections that ha)173 420 +R .902 -.15(ve b)-.2 H .602 +(een idle for some period of time to determine if the client is).15 F 1.124 +(still there, so that idle connections from machines that ha)173 432 R 1.424 +-.15(ve c)-.2 H 1.124(rashed or can no longer be).15 F +(reached may be cleaned up.)173 444 Q F1103.666 462 Q F3(lowpty-highpty)6 +E F0 .772(This option is only enabled when)173 474 R F1(telnetd)3.272 E F0 .771 +(is compiled for)3.271 F F2(UNICOS.)3.271 E F0 .771(It speci\214es an in-)3.271 +F(clusi)173 486 Q 3.232 -.15(ve r)-.25 H 2.932(ange of pseudo-terminal de).15 F +2.932(vices to use.)-.25 F 2.933(If the system has sysconf v)7.933 F(ariable) +-.25 E F2(_SC_CRAY_NPTY)173 498 Q F0 1.486(con\214gured, the def)3.986 F 1.486 +(ault pty search range is 0 to)-.1 F F2(_SC_CRAY_NPTY;)3.986 E F0 .72 +(otherwise, the def)173 510 R .72(ault range is 0 to 128.)-.1 F(Either)5.72 E +F3(lowpty)3.22 E F0(or)3.22 E F3(highpty)3.22 E F0 .72(may be omitted to)3.22 F +(allo)173 522 Q 2.6(wc)-.25 G .1(hanging either end of the search range.)202.01 +522 R(If)5.1 E F3(lowpty)2.6 E F0 .1(is omitted, the - character is still)2.6 F +(required so that)173 534 Q F1(telnetd)2.5 E F0(can dif)2.5 E(ferentiate)-.25 E +F3(highpty)2.5 E F0(from)2.5 E F3(lowpty)2.5 E F0(.)A F1103.666 552 Q F0 +1.391(This option is only enabled if)173 552 R F1(telnetd)3.891 E F0 1.391 +(is compiled with support for)3.891 F F4(SecurID)3.891 E F0 3.891(cards. It) +3.891 F .787(causes the)173 564 R F14.953 E F0 .786 +(option to be passed on to)3.286 F F2(login)3.286 E F0 4.072(\(1\), and)B .786 +(thus is only useful if)3.286 F F2(login)3.286 E F0(\(1\))A .48(supports the) +173 576 R F14.646 E F0 .48(\215ag to indicate that only)2.98 F F4 +(SecurID)2.98 E F0 -.25(va)2.98 G .481(lidated logins are allo).25 F .481 +(wed, and is usu-)-.25 F +(ally useful for controlling remote logins from outside of a \214re)173 588 Q +-.1(wa)-.25 G(ll.).1 E F1103.666 606 Q F3(tos)6 E F1103.666 624 Q +F3(len)6.628 E F0 .628 +(This option is used to specify the size of the \214eld in the)173.628 624 R F2 +(utmp)3.127 E F0 .627(structure that holds the re-)3.127 F 1(mote host name.) +173 636 R 1(If the resolv)6 F 1(ed host name is longer than)-.15 F F3(len)3.5 E +F0 3.5(,t)C 1(he dotted decimal v)441.99 636 R(alue)-.25 E .046 +(will be used instead.)173 648 R .046(This allo)5.046 F .046(ws hosts with v) +-.25 F .045(ery long host names that o)-.15 F -.15(ve)-.15 G(r\215o).15 E 2.545 +(wt)-.25 G .045(his \214eld to)497.68 648 R .996 +(still be uniquely identi\214ed.)173 660 R(Specifying)5.997 E F1(\255u0)5.163 E +F0 .997(indicates that only dotted decimal addresses)3.497 F +(should be put into the)173 672 Q F2(utmp)2.5 E F0(\214le.)2.5 E F1 +103.666 690 Q F0 .422(This option causes)173 690 R F1(telnetd)2.922 E F0 .422 +(to refuse connections from addresses that cannot be mapped)2.922 F(4.2 Berk)72 +750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71(ution February)-.2 F +(3, 1994)2.5 E(2)535 750 Q EP +%%Page: 3 3 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNETD \( 8 \))72 48 R(BSD System Manager') +241.42 48 Q 2.5(sM)-.55 G 105.272(anual TELNETD)348.92 48 R 1.666(\(8\))1.666 G +(back into a symbolic name via the)173 96 Q/F1 10/Courier@0 SF(gethostbyaddr) +2.5 E F0(\(3\) routine.)A/F2 10/Courier-Bold@0 SF103.666 114 Q/F3 10 +/Courier-Oblique@0 SF(authtype)6 E F0 .123(This option is only v)173 126 R .123 +(alid if)-.25 F F2(telnetd)2.623 E F0 .123(has been b)2.623 F .124 +(uilt with support for the authentication op-)-.2 F 2.968(tion. It)173 138 R +.467(disables the use of)2.968 F F3(authtype)2.967 E F0 .467 +(authentication, and can be used to temporarily dis-)2.967 F +(able a speci\214c authentication type without ha)173 150 Q(ving to recompile) +-.2 E F2(telnetd)2.5 E F0(.)A F2(Telnetd)102 168 Q F0 .851 +(operates by allocating a pseudo-terminal de)3.351 F .851(vice \(see)-.25 F F1 +(pty)3.351 E F0 4.202(\(4\)\) for)B 3.351(ac)3.351 G .852 +(lient, then creating a login)431.882 168 R .757(process which has the sla)102 +180 R 1.057 -.15(ve s)-.2 H .757(ide of the pseudo-terminal as).15 F F1(stdin) +3.257 E F0(,)A F1(stdout)3.256 E F0(and)3.256 E F1(stderr)3.256 E F0(.)A F2 +(Telnetd)3.256 E F0(ma-)3.256 E .483 +(nipulates the master side of the pseudo-terminal, implementing the)102 192 R +/F4 9/Times-Roman@0 SF(TELNET)2.984 E F0 .484(protocol and passing characters) +2.984 F(between the remote client and the login process.)102 204 Q .538(When a) +102 222 R F4(TELNET)3.038 E F0 .538(session is started up,)3.038 F F2(telnetd) +3.038 E F0(sends)3.038 E F4(TELNET)3.038 E F0 .538 +(options to the client side indicating a will-)3.038 F(ingness to do the follo) +102 234 Q(wing)-.25 E F4(TELNET)2.5 E F0 +(options, which are described in more detail belo)2.5 E(w:)-.25 E F1 +(DO AUTHENTICATION)132 252 Q(WILL ENCRYPT)132 264 Q(DO TERMINAL TYPE)132 276 Q +(DO TSPEED)132 288 Q(DO XDISPLOC)132 300 Q(DO NEW-ENVIRON)132 312 Q(DO ENVIRON) +132 324 Q(WILL SUPPRESS GO AHEAD)132 336 Q(DO ECHO)132 348 Q(DO LINEMODE)132 +360 Q(DO NAWS)132 372 Q(WILL STATUS)132 384 Q(DO LFLOW)132 396 Q +(DO TIMING-MARK)132 408 Q F0 .468(The pseudo-terminal allocated to the client \ +is con\214gured to operate in cook)102 426 R .468(ed mode, and with)-.1 F F1 +.469(XTABS and)2.969 F(CRMOD)102 438 Q F0(enabled \(see)2.5 E F1(tty)2.5 E F0 +(\(4\)\).)A F2(Telnetd)102 456 Q F0(has support for enabling locally the follo) +2.5 E(wing)-.25 E F4(TELNET)2.5 E F0(options:)2.5 E .558(WILL ECHO)102 474 R +.558(When the)209.558 474 R F1(LINEMODE)3.057 E F0 .557(option is enabled, a) +3.057 F F1 .557(WILL ECHO)3.057 F F0(or)3.057 E F1 .557(WONT ECHO)3.057 F F0 +.557(will be)3.057 F .487 +(sent to the client to indicate the current state of terminal echoing.)209 486 +R .487(When terminal)5.487 F .409(echo is not desired, a)209 498 R F1 .408 +(WILL ECHO)2.908 F F0 .408(is sent to indicate that)2.908 F F4(telnetd)2.908 E +F0 .408(will tak)2.908 F 2.908(ec)-.1 G .408(are of)516.552 498 R 1.811 +(echoing an)209 510 R 4.311(yd)-.15 G 1.811 +(ata that needs to be echoed to the terminal, and then nothing is)268.572 510 R +3.876(echoed. When)209 522 R 1.376(terminal echo is desired, a)3.876 F F1 1.375 +(WONT ECHO)3.875 F F0 1.375(is sent to indicate that)3.875 F F4(telnetd)209 534 +Q F0 .11(will not be doing an)2.61 F 2.61(yt)-.15 G .11 +(erminal echoing, so the client should do an)326.788 534 R 2.611(yt)-.15 G +(erminal)509.45 534 Q(echoing that is needed.)209 546 Q .243(WILL BIN)102 564 R +(AR)-.35 E 42.18(YI)-.65 G .243(ndicates that the client is willing to send a \ +8 bits of data, rather than the normal 7)212.573 564 R(bits of the Netw)209 576 +Q(ork V)-.1 E(irtual T)-.6 E(erminal.)-.7 E(WILL SGA)102 594 Q +(Indicates that it will not be sending)209 594 Q F1(IAC GA,)2.5 E F0 +(go ahead, commands.)2.5 E .366(WILL ST)102 612 R -1.11(AT)-.93 G 41.27 +(US Indicates)1.11 F 2.866(aw)2.866 G .366 +(illingness to send the client, upon request, of the current status of all) +262.858 612 R F4(TELNET)209 624 Q F0(options.)2.5 E .51(WILL TIMING-MARK)102 +642 R(Whene)209.51 642 Q -.15(ve)-.25 G 3.01(ra).15 G F1 .509(DO TIMING-MARK) +-.001 F F0 .509(command is recei)3.009 F -.15(ve)-.25 G .509(d, it is al).15 F +-.1(wa)-.1 G .509(ys responded to).1 F(with a)209 654 Q F1(WILL TIMING-MARK)2.5 +E F0 .726(WILL LOGOUT)102 672 R .726(When a)209.726 672 R F1 .726(DO LOGOUT) +3.226 F F0 .726(is recei)3.226 F -.15(ve)-.25 G .726(d, a).15 F F1 .726 +(WILL LOGOUT)3.226 F F0 .726(is sent in response, and the)3.226 F(4.2 Berk)72 +750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71(ution February)-.2 F +(3, 1994)2.5 E(3)535 750 Q EP +%%Page: 4 4 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNETD \( 8 \))72 48 R(BSD System Manager') +241.42 48 Q 2.5(sM)-.55 G 105.272(anual TELNETD)348.92 48 R 1.666(\(8\))1.666 G +/F1 9/Times-Roman@0 SF(TELNET)209 96 Q F0(session is shut do)2.5 E(wn.)-.25 E +.118(WILL ENCR)102 114 R 32.1(YPT Only)-.65 F .118(sent if)2.618 F/F2 10 +/Courier-Bold@0 SF(telnetd)2.618 E F0 .118 +(is compiled with support for data encryption, and indicates)2.618 F 2.5(aw)209 +126 S(illingness to decrypt the data stream.)223.16 126 Q F2(Telnetd)102 144 Q +F0(has support for enabling remotely the follo)2.5 E(wing)-.25 E F1(TELNET)2.5 +E F0(options:)2.5 E(DO BIN)102 162 Q(AR)-.35 E 52.73(YS)-.65 G +(ent to indicate that)214.56 162 Q F1(telnetd)2.5 E F0(is willing to recei)2.5 +E .3 -.15(ve a)-.25 H 2.5(n8b).15 G(it data stream.)423.918 162 Q(DO LFLO)102 +180 Q 55.97(WR)-.35 G(equests that the client handle \215o)215.67 180 Q 2.5(wc) +-.25 G(ontrol characters remotely)358.18 180 Q(.)-.65 E .967(DO ECHO)102 198 R +.967(This is not really supported, b)209.967 198 R .967 +(ut is sent to identify a 4.2BSD)-.2 F/F3 10/Courier@0 SF(telnet)3.468 E F0 +.968(\(1\) client,)B .365(which will improperly respond with)209 210 R F3 .365 +(WILL ECHO.)2.865 F F0 .365(If a)2.865 F F3 .365(WILL ECHO)2.865 F F0 .365 +(is recei)2.865 F -.15(ve)-.25 G(d,).15 E(a)209 222 Q F3(DONT ECHO)2.5 E F0 +(will be sent in response.)2.5 E .445(DO TERMIN)102 240 R 7.92 +(AL-TYPE Indicates)-.35 F 2.945(ad)2.945 G .445 +(esire to be able to request the name of the type of terminal that is at-) +260.875 240 R(tached to the client side of the connection.)209 252 Q(DO SGA)102 +270 Q(Indicates that it does not need to recei)209 270 Q -.15(ve)-.25 G F3 +(IAC GA,)2.65 E F0(the go ahead command.)2.5 E .006(DO N)102 288 R -.9(AW)-.35 +G 61.87(SR).9 G .006(equests that the client inform the serv)215.676 288 R .005 +(er when the windo)-.15 F 2.505(w\()-.25 G .005(display\) size changes.)452.51 +288 R(DO TERMIN)102 306 Q(AL-SPEED)-.35 E 1.029(Indicates a desire to be able \ +to request information about the speed of the serial)209 318 R +(line to which the client is attached.)209 330 Q .469(DO XDISPLOC)102 348 R +.469(Indicates a desire to be able to request the name of the X windo)209.469 +348 R .468(ws display that is)-.25 F(associated with the telnet client.)209 360 +Q 1.008(DO NEW)102 378 R(-ENVIR)-.65 E 17.52(ON Indicates)-.4 F 3.508(ad)3.508 +G 1.008(esire to be able to request en)262.564 378 R 1.009(vironment v)-.4 F +1.009(ariable information, as de-)-.25 F(scribed in RFC 1572.)209 390 Q 1.009 +(DO ENVIR)102 408 R 42.97(ON Indicates)-.4 F 3.509(ad)3.509 G 1.009 +(esire to be able to request en)262.567 408 R 1.008(vironment v)-.4 F 1.008 +(ariable information, as de-)-.25 F(scribed in RFC 1408.)209 420 Q .886 +(DO LINEMODE)102 438 R .886(Only sent if)209.886 438 R F2(telnetd)3.386 E F0 +.886(is compiled with support for linemode, and requests that)3.386 F +(the client do line by line processing.)209 450 Q 1.292(DO TIMING-MARK)102 468 +R 1.292(Only sent if)210.292 468 R F2(telnetd)3.792 E F0 1.291 +(is compiled with support for both linemode and kludge)3.792 F 2.029 +(linemode, and the client responded with)209 480 R F3 2.029(WONT LINEMODE.) +4.529 F F0 2.029(If the client re-)4.529 F 3.375(sponds with)209 492 R F3 3.375 +(WILL TM,)5.875 F F0 3.375(the it is assumed that the client supports kludge) +5.875 F 2.5(linemode. Note)209 504 R(that the)2.5 E([)3.333 E F22.499 E +F0 2.5(]o).833 G(ption can be used to disable this.)338.205 504 Q(DO A)102 522 +Q(UTHENTICA)-.55 E(TION)-1.11 E .618(Only sent if)209 534 R F2(telnetd)3.118 E +F0 .618(is compiled with support for authentication, and indicates)3.118 F 2.5 +(aw)209 546 S(illingness to recei)223.16 546 Q .3 -.15(ve a)-.25 H +(uthentication information for automatic login.).15 E .118(DO ENCR)102 564 R +42.65(YPT Only)-.65 F .118(sent if)2.618 F F2(telnetd)2.618 E F0 .118 +(is compiled with support for data encryption, and indicates)2.618 F 2.5(aw)209 +576 S(illingness to decrypt the data stream.)223.16 576 Q/F4 10/Times-Bold@0 SF +(ENVIR)72 600 Q(ONMENT)-.3 E(FILES)72 612 Q F3(/etc/services)102 624 Q +(/etc/inittab)102 636 Q F0(\(UNICOS systems only\))2.5 E F3(/etc/iptos)102 648 +Q F0(\(if supported\))2.5 E F3(/usr/ucb/bftp)102 660 Q F0(\(if supported\))2.5 +E(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71 +(ution February)-.2 F(3, 1994)2.5 E(4)535 750 Q EP +%%Page: 5 5 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.834(TELNETD \( 8 \))72 48 R(BSD System Manager') +241.42 48 Q 2.5(sM)-.55 G 105.272(anual TELNETD)348.92 48 R 1.666(\(8\))1.666 G +/F1 10/Times-Bold@0 SF(SEE ALSO)72 96 Q/F2 10/Courier@0 SF(telnet)102 108 Q F0 +(\(1\),)A F2(login)5 E F0(\(1\),)A F2(bftp)5 E F0(\(1\) \(if supported\))A F1 +(ST)72 132 Q(AND)-.9 E(ARDS)-.35 E/F3 10/Courier-Bold@0 SF(RFC-854)102 144 Q/F4 +9/Times-Roman@0 SF(TELNET)155 144 Q F0(PR)2.5 E -1.88 -.4(OT O)-.4 H +(COL SPECIFICA).4 E(TION)-1.11 E F3(RFC-855)102 156 Q F0 +(TELNET OPTION SPECIFICA)155 156 Q(TIONS)-1.11 E F3(RFC-856)102 168 Q F0 +(TELNET BIN)155 168 Q(AR)-.35 E 2.5(YT)-.65 G(RANSMISSION)241.21 168 Q F3 +(RFC-857)102 180 Q F0(TELNET ECHO OPTION)155 180 Q F3(RFC-858)102 192 Q F0 +(TELNET SUPPRESS GO AHEAD OPTION)155 192 Q F3(RFC-859)102 204 Q F0(TELNET ST) +155 204 Q -1.11(AT)-.93 G(US OPTION)1.11 E F3(RFC-860)102 216 Q F0 +(TELNET TIMING MARK OPTION)155 216 Q F3(RFC-861)102 228 Q F0 +(TELNET EXTENDED OPTIONS - LIST OPTION)155 228 Q F3(RFC-885)102 240 Q F0 +(TELNET END OF RECORD OPTION)155 240 Q F3(RFC-1073)102 252 Q F0 -.7(Te)5 G +(lnet W).7 E(indo)-.4 E 2.5(wS)-.25 G(ize Option)224.2 252 Q F3(RFC-1079)102 +264 Q F0 -.7(Te)5 G(lnet T).7 E(erminal Speed Option)-.7 E F3(RFC-1091)102 276 +Q F0 -.7(Te)5 G(lnet T).7 E(erminal-T)-.7 E(ype Option)-.8 E F3(RFC-1096)102 +288 Q F0 -.7(Te)5 G(lnet X Display Location Option).7 E F3(RFC-1123)102 300 Q +F0(Requirements for Internet Hosts -- Application and Support)5 E F3(RFC-1184) +102 312 Q F0 -.7(Te)5 G(lnet Linemode Option).7 E F3(RFC-1372)102 324 Q F0 -.7 +(Te)5 G(lnet Remote Flo).7 E 2.5(wC)-.25 G(ontrol Option)245.44 324 Q F3 +(RFC-1416)102 336 Q F0 -.7(Te)5 G(lnet Authentication Option).7 E F3(RFC-1411) +102 348 Q F0 -.7(Te)5 G(lnet Authentication: K).7 E(erberos V)-.25 E(ersion 4) +-1.11 E F3(RFC-1412)102 360 Q F0 -.7(Te)5 G(lnet Authentication: SPX).7 E F3 +(RFC-1571)102 372 Q F0 -.7(Te)5 G(lnet En).7 E +(vironment Option Interoperability Issues)-.4 E F3(RFC-1572)102 384 Q F0 -.7 +(Te)5 G(lnet En).7 E(vironment Option)-.4 E F1 -.1(BU)72 408 S(GS).1 E F0(Some) +102 420 Q F4(TELNET)2.5 E F0(commands are only partially implemented.)2.5 E +.082(Because of b)102 438 R .082(ugs in the original 4.2 BSD)-.2 F F2(telnet) +2.582 E F0(\(1\),)A F3(telnetd)5.164 E F0 .082 +(performs some dubious protocol e)2.582 F(xchanges)-.15 E(to try to disco)102 +450 Q -.15(ve)-.15 G 2.5(ri).15 G 2.5(ft)175.03 450 S +(he remote client is, in f)183.64 450 Q(act, a 4.2 BSD)-.1 E F2(telnet)2.5 E F0 +(\(1\).)A(Binary mode has no common interpretation e)102 468 Q +(xcept between similar operating systems \(Unix in this case\).)-.15 E +(The terminal type name recei)102 486 Q -.15(ve)-.25 G 2.5(df).15 G +(rom the remote client is con)239.06 486 Q -.15(ve)-.4 G(rted to lo).15 E +(wer case.)-.25 E F3(Telnetd)102 504 Q F0(ne)2.5 E -.15(ve)-.25 G 2.5(rs).15 G +(ends)174.7 504 Q F4(TELNET)2.5 E F2(IAC GA)2.5 E F0(\(go ahead\) commands.)2.5 +E(4.2 Berk)72 750 Q(ele)-.1 E 2.5(yD)-.15 G(istrib)132.57 750 Q 95.71 +(ution February)-.2 F(3, 1994)2.5 E(5)535 750 Q EP +%%Trailer +end +%%EOF diff --git a/src/appl/telnet/telnetd/telnetd.0.txt b/src/appl/telnet/telnetd/telnetd.0.txt new file mode 100644 index 000000000..f13b6994c --- /dev/null +++ b/src/appl/telnet/telnetd/telnetd.0.txt @@ -0,0 +1,322 @@ +TELNETD(8) BSD System Manager's Manual TELNETD(8) + +NNAAMMEE + tteellnneettdd - DARPA TELNET protocol server + +SSYYNNOOPPSSIISS + //uussrr//lliibbeexxeecc//tteellnneettdd [--aa _a_u_t_h_m_o_d_e] [--BB] [--DD _d_e_b_u_g_m_o_d_e] [--eeddeebbuugg] [--hh] + [--II_i_n_i_t_i_d] [--ll] [--kk] [--nn] [--rr_l_o_w_p_t_y_-_h_i_g_h_p_t_y] [--ss] + [--SS _t_o_s] [--uu _l_e_n] [--UU] [--XX _a_u_t_h_t_y_p_e] [--ddeebbuugg [_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. + + 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 Specifies bftp server mode. In this mode, tteellnneettdd causes + login to start a bftp(1) session rather than the user's nor- + mal shell. In bftp daemon mode normal logins are not sup- + ported, and it must be used on a port other than the normal + TELNET port. + + --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. + + --ddeebbuugg Enables debugging on each socket created by tteellnneettdd (see + SO_DEBUG in socket(2)). + + --eeddeebbuugg If tteellnneettdd has been compiled with support for data encryp- + tion, then the --eeddeebbuugg option may be used to enable encryp- + tion debugging code. + + --hh Disables the printing of host-specific information before + login has been completed. + + --II _i_n_i_t_i_d This option is only applicable to UNICOS systems prior to + 7.0. It specifies the ID from _/_e_t_c_/_i_n_i_t_t_a_b to use when init + starts login sessions. The default ID is fe. + + --kk This option is only useful if tteellnneettdd has been compiled with + both linemode and kludge linemode support. If the --kk option + is specified, then if the remote client does not support the + LINEMODE option, then tteellnneettdd will operate in character at a + time mode. It will still support kludge linemode, but will + only go into kludge linemode if the remote client requests + it. (This is done by by the client sending DONT SUPPRESS- + GO-AHEAD and DONT ECHO.) The --kk option is most useful when + there are remote clients that do not support kludge + linemode, but pass the heuristic (if they respond with WILL + TIMING-MARK in response to a DO TIMING-MARK) for kludge + linemode support. + + --ll Specifies line mode. Tries to force clients to use line- + at-a-time mode. If the LINEMODE option is not supported, it + will go into kludge linemode. + + --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 This option is only enabled if tteellnneettdd is compiled with sup- + port for SecurID cards. It causes the --ss option to be + passed on to login(1), and thus is only useful if login(1) + supports the --ss flag to indicate that only SecurID validated + logins are allowed, and is usually useful for controlling + remote logins from outside of a firewall. + + --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. + + 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 + _/_e_t_c_/_s_e_r_v_i_c_e_s + _/_e_t_c_/_i_n_i_t_t_a_b (UNICOS systems only) + _/_e_t_c_/_i_p_t_o_s (if supported) + _/_u_s_r_/_u_c_b_/_b_f_t_p (if supported) + +SSEEEE AALLSSOO + telnet(1), login(1), bftp(1) (if supported) + +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 February 3, 1994 5 diff --git a/src/appl/telnet/telnetd/telnetd.8 b/src/appl/telnet/telnetd/telnetd.8 index c4f7633d6..cd6d1bfb8 100644 --- a/src/appl/telnet/telnetd/telnetd.8 +++ b/src/appl/telnet/telnetd/telnetd.8 @@ -1,164 +1,611 @@ -.\" Copyright (c) 1983 The Regents of the University of California. -.\" All rights reserved. +.\" Copyright (c) 1983, 1993 +.\" The Regents of the University of California. All rights reserved. .\" -.\" Redistribution and use in source and binary forms are permitted -.\" provided that the above copyright notice and this paragraph are -.\" duplicated in all such forms and that any documentation, -.\" advertising materials, and other materials related to such -.\" distribution and use acknowledge that the software was developed -.\" by the University of California, Berkeley. The name of the -.\" University may not be used to endorse or promote products derived -.\" from this software without specific prior written permission. -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. .\" -.\" @(#)telnetd.8 6.7 (Berkeley) 6/28/90 +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" -.TH TELNETD 8 "June 28, 1990" -.UC 5 -.SH NAME -telnetd \- DARPA TELNET protocol server -.SH SYNOPSIS -.B /etc/telnetd -[\fB\-debug\fP [\fIport\fP]] -[\fB\-l] -[\fB\-D options\fP] -[\fB\-D report\fP] -[\fB\-D exercise\fP] -[\fB\-D netdata\fP] -[\fB\-D ptydata\fP] -.SH DESCRIPTION -.I Telnetd -is a server which supports the DARPA standard -.B TELNET +.\" @(#)telnetd.8 8.2 (Berkeley) 2/3/94 +.\" +.Dd February 3, 1994 +.Dt TELNETD 8 +.Os BSD 4.2 +.Sh NAME +.Nm telnetd +.Nd DARPA +.Tn TELNET +protocol server +.Sh SYNOPSIS +.Nm /usr/libexec/telnetd +.Op Fl a Ar authmode +.Op Fl B +.Op Fl D Ar debugmode +.Op Fl edebug +.Op Fl h +.Op Fl I Ns Ar initid +.Op Fl l +.Op Fl k +.Op Fl n +.Op Fl r Ns Ar lowpty-highpty +.Op Fl s +.Op Fl S Ar tos +.Op Fl u Ar len +.Op Fl U +.Op Fl X Ar authtype +.Op Fl debug Op Ar port +.Sh DESCRIPTION +The +.Nm telnetd +command is a server which supports the +.Tn DARPA +standard +.Tn TELNET virtual terminal protocol. -.I Telnetd -is invoked by the internet server (see -.IR inetd (8)), -normally for requests to connect to the -.B TELNET +.Nm Telnetd +is normally invoked by the internet server (see +.Xr inetd 8 ) +for requests to connect to the +.Tn TELNET port as indicated by the -.I /etc/services +.Pa /etc/services file (see -.IR services (5)). -If the \fB\-debug\fP may be used, to start up \fBtelnetd\fP +.Xr services 5 ) . +The +.Fl debug +option may be used to start up +.Nm telnetd manually, instead of through -.IR inetd (8). -If started up this way, \fIport\fP may be specified to -run \fItelnetd\fP on an alternate TCP port number. -.PP -The \fB\-D\fP option may be used for debugging purposes. -This allows \fItelnet\fR to print out debugging information -to the connection, allowing the user to see what telnetd +.Xr inetd 8 . +If started up this way, +.Ar port +may be specified to run +.Nm telnetd +on an alternate +.Tn TCP +port number. +.Pp +The +.Nm telnetd +command accepts the following options: +.Bl -tag -width "-a authmode" +.It Fl a Ar authmode +This option may be used for specifying what mode should +be used for authentication. +Note that this option is only useful if +.Nm telnetd +has been compiled with support for the +.Dv AUTHENTICATION +option. +There are several valid values for +.Ar authmode: +.Bl -tag -width debug +.It debug +Turns on authentication debugging code. +.It user +Only allow connections when the remote user +can provide valid authentication information +to identify the remote user, +and is allowed access to the specified account +without providing a password. +.It valid +Only allow connections when the remote user +can provide valid authentication information +to identify the remote user. +The +.Xr login 1 +command will provide any additional user verification +needed if the remote user is not allowed automatic +access to the specified account. +.It other +Only allow connections that supply some authentication information. +This option is currently not supported +by any of the existing authentication mechanisms, +and is thus the same as specifying +.Fl a +.Cm valid . +.It none +This is the default state. +Authentication information is not required. +If no or insufficient authentication information +is provided, then the +.Xr login 1 +program will provide the necessary user +verification. +.It off +This disables the authentication code. +All user verification will happen through the +.Xr login 1 +program. +.El +.It Fl B +Specifies bftp server mode. In this mode, +.Nm telnetd +causes login to start a +.Xr bftp 1 +session rather than the user's +normal shell. In bftp daemon mode normal +logins are not supported, and it must be used +on a port other than the normal +.Tn TELNET +port. +.It Fl D Ar debugmode +This option may be used for debugging purposes. +This allows +.Nm telnetd +to print out debugging information +to the connection, allowing the user to see what +.Nm telnetd is doing. -There are several modifiers: -\fBoptions\fR prints information about the negotiation -of \fBTELNET\fR options, -\fBreport\fR prints the \fBoptions\fR information, plus -some additional information about what processing is going on, -\fBnetdata\fP displays the data stream received by \fItelnetd\fP, -\fBptydata\fP displays data written to the pty, and -\fBexercise\fR has not been implemented yet. -.PP -.I Telnetd +There are several possible values for +.Ar debugmode: +.Bl -tag -width exercise +.It Cm options +Prints information about the negotiation of +.Tn TELNET +options. +.It Cm report +Prints the +.Cm options +information, plus some additional information +about what processing is going on. +.It Cm netdata +Displays the data stream received by +.Nm telnetd. +.It Cm ptydata +Displays data written to the pty. +.It Cm exercise +Has not been implemented yet. +.El +.It Fl debug +Enables debugging on each socket created by +.Nm telnetd +(see +.Dv SO_DEBUG +in +.Xr socket 2 ) . +.It Fl edebug +If +.Nm telnetd +has been compiled with support for data encryption, then the +.Fl edebug +option may be used to enable encryption debugging code. +.It Fl h +Disables the printing of host-specific information before +login has been completed. +.It Fl I Ar initid +This option is only applicable to +.Tn UNICOS +systems prior to 7.0. +It specifies the +.Dv ID +from +.Pa /etc/inittab +to use when init starts login sessions. The default +.Dv ID +is +.Dv fe. +.It Fl k +This option is only useful if +.Nm telnetd +has been compiled with both linemode and kludge linemode +support. If the +.Fl k +option is specified, then if the remote client does not +support the +.Dv LINEMODE +option, then +.Nm telnetd +will operate in character at a time mode. +It will still support kludge linemode, but will only +go into kludge linemode if the remote client requests +it. +(This is done by by the client sending +.Dv DONT SUPPRESS-GO-AHEAD +and +.Dv DONT ECHO . ) +The +.Fl k +option is most useful when there are remote clients +that do not support kludge linemode, but pass the heuristic +(if they respond with +.Dv WILL TIMING-MARK +in response to a +.Dv DO TIMING-MARK) +for kludge linemode support. +.It Fl l +Specifies line mode. Tries to force clients to use line- +at-a-time mode. +If the +.Dv LINEMODE +option is not supported, it will go +into kludge linemode. +.It Fl n +Disable +.Dv TCP +keep-alives. Normally +.Nm telnetd +enables the +.Tn 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. +.It Fl r Ar lowpty-highpty +This option is only enabled when +.Nm telnetd +is compiled for +.Dv UNICOS. +It specifies an inclusive range of pseudo-terminal devices to +use. If the system has sysconf variable +.Dv _SC_CRAY_NPTY +configured, the default pty search range is 0 to +.Dv _SC_CRAY_NPTY; +otherwise, the default range is 0 to 128. Either +.Ar lowpty +or +.Ar highpty +may be omitted to allow changing +either end of the search range. If +.Ar lowpty +is omitted, the - character is still required so that +.Nm telnetd +can differentiate +.Ar highpty +from +.Ar lowpty . +.It Fl s +This option is only enabled if +.Nm telnetd +is compiled with support for +.Tn SecurID +cards. +It causes the +.Fl s +option to be passed on to +.Xr login 1 , +and thus is only useful if +.Xr login 1 +supports the +.Fl s +flag to indicate that only +.Tn SecurID +validated logins are allowed, and is +usually useful for controlling remote logins +from outside of a firewall. +.It Fl S Ar tos +.It Fl u Ar len +This option is used to specify the size of the field +in the +.Dv utmp +structure that holds the remote host name. +If the resolved host name is longer than +.Ar len , +the dotted decimal value will be used instead. +This allows hosts with very long host names that +overflow this field to still be uniquely identified. +Specifying +.Fl u0 +indicates that only dotted decimal addresses +should be put into the +.Pa utmp +file. +.It Fl U +This option causes +.Nm telnetd +to refuse connections from addresses that +cannot be mapped back into a symbolic name +via the +.Xr gethostbyaddr 3 +routine. +.It Fl X Ar authtype +This option is only valid if +.Nm telnetd +has been built with support for the authentication option. +It disables the use of +.Ar authtype +authentication, and +can be used to temporarily disable +a specific authentication type without having to recompile +.Nm telnetd . +.El +.Pp +.Nm Telnetd operates by allocating a pseudo-terminal device (see -.IR pty (4)) +.Xr pty 4 ) for a client, then creating a login process which has the slave side of the pseudo-terminal as -.BR stdin , -.BR stdout , +.Dv stdin , +.Dv stdout and -.BR stderr . -.I Telnetd +.Dv stderr . +.Nm Telnetd manipulates the master side of the pseudo-terminal, implementing the -.B TELNET +.Tn TELNET protocol and passing characters between the remote client and the login process. -.PP +.Pp When a -.B TELNET +.Tn TELNET session is started up, -.I telnetd +.Nm telnetd sends -.B TELNET +.Tn TELNET options to the client side indicating -a willingness to do -.I remote echo -of characters, to -.I suppress go -.IR ahead , -to do -.I remote flow -.IR control , -and to receive -.I terminal type -.IR information , -.I terminal speed -.IR information , -and -.I window size information -from the remote client. -If the remote client is willing, the remote terminal type is -propagated in the environment of the created login process. +a willingness to do the +following +.Tn TELNET +options, which are described in more detail below: +.Bd -literal -offset indent +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 +.Ed +.Pp The pseudo-terminal allocated to the client is configured -to operate in \*(lqcooked\*(rq mode, and with XTABS and CRMOD +to operate in \*(lqcooked\*(rq mode, and with +.Dv XTABS and +.Dv CRMOD enabled (see -.IR tty (4)). -.PP -.I Telnetd -is willing to -.IR do : -.IR echo , -.IR binary , -.I suppress go -.IR ahead , -and -.I timing -.IR mark . -.I Telnetd -is willing to have the remote client -.IR do : -.IR linemode , -.IR binary , -.I terminal -.IR type , -.I terminal -.IR speed , -.I window -.IR size , -.I toggle flow -.IR control , -.IR environment , -.I X display -.IR location , -and -.I suppress go -.IR ahead . -.SH "SEE ALSO" -telnet(1) -.SH BUGS +.Xr tty 4 ) . +.Pp +.Nm Telnetd +has support for enabling locally the following +.Tn TELNET +options: +.Bl -tag -width "DO AUTHENTICATION" +.It "WILL ECHO" +When the +.Dv LINEMODE +option is enabled, a +.Dv WILL ECHO +or +.Dv WONT ECHO +will be sent to the client to indicate the +current state of terminal echoing. +When terminal echo is not desired, a +.Dv WILL ECHO +is sent to indicate that +.Tn 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 +.Dv WONT ECHO +is sent to indicate that +.Tn telnetd +will not be doing any terminal echoing, so the +client should do any terminal echoing that is needed. +.It "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. +.It "WILL SGA" +Indicates that it will not be sending +.Dv IAC GA, +go ahead, commands. +.It "WILL STATUS" +Indicates a willingness to send the client, upon +request, of the current status of all +.Tn TELNET +options. +.It "WILL TIMING-MARK" +Whenever a +.Dv DO TIMING-MARK +command is received, it is always responded +to with a +.Dv WILL TIMING-MARK +.It "WILL LOGOUT" +When a +.Dv DO LOGOUT +is received, a +.Dv WILL LOGOUT +is sent in response, and the +.Tn TELNET +session is shut down. +.It "WILL ENCRYPT" +Only sent if +.Nm telnetd +is compiled with support for data encryption, and +indicates a willingness to decrypt +the data stream. +.El +.Pp +.Nm Telnetd +has support for enabling remotely the following +.Tn TELNET +options: +.Bl -tag -width "DO AUTHENTICATION" +.It "DO BINARY" +Sent to indicate that +.Tn telnetd +is willing to receive an 8 bit data stream. +.It "DO LFLOW" +Requests that the client handle flow control +characters remotely. +.It "DO ECHO" +This is not really supported, but is sent to identify a 4.2BSD +.Xr telnet 1 +client, which will improperly respond with +.Dv WILL ECHO. +If a +.Dv WILL ECHO +is received, a +.Dv DONT ECHO +will be sent in response. +.It "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. +.It "DO SGA" +Indicates that it does not need to receive +.Dv IAC GA, +the go ahead command. +.It "DO NAWS" +Requests that the client inform the server when +the window (display) size changes. +.It "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. +.It "DO XDISPLOC" +Indicates a desire to be able to request the name +of the X windows display that is associated with +the telnet client. +.It "DO NEW-ENVIRON" +Indicates a desire to be able to request environment +variable information, as described in RFC 1572. +.It "DO ENVIRON" +Indicates a desire to be able to request environment +variable information, as described in RFC 1408. +.It "DO LINEMODE" +Only sent if +.Nm telnetd +is compiled with support for linemode, and +requests that the client do line by line processing. +.It "DO TIMING-MARK" +Only sent if +.Nm telnetd +is compiled with support for both linemode and +kludge linemode, and the client responded with +.Dv WONT LINEMODE. +If the client responds with +.Dv WILL TM, +the it is assumed that the client supports +kludge linemode. +Note that the +.Op Fl k +option can be used to disable this. +.It "DO AUTHENTICATION" +Only sent if +.Nm telnetd +is compiled with support for authentication, and +indicates a willingness to receive authentication +information for automatic login. +.It "DO ENCRYPT" +Only sent if +.Nm telnetd +is compiled with support for data encryption, and +indicates a willingness to decrypt +the data stream. +.Sh ENVIRONMENT +.Sh FILES +.Pa /etc/services +.br +.Pa /etc/inittab +(UNICOS systems only) +.br +.Pa /etc/iptos +(if supported) +.br +.Pa /usr/ucb/bftp +(if supported) +.Sh "SEE ALSO" +.Xr telnet 1 , +.Xr login 1 , +.Xr bftp 1 +(if supported) +.Sh STANDARDS +.Bl -tag -compact -width RFC-1572 +.It Cm RFC-854 +.Tn TELNET +PROTOCOL SPECIFICATION +.It Cm RFC-855 +TELNET OPTION SPECIFICATIONS +.It Cm RFC-856 +TELNET BINARY TRANSMISSION +.It Cm RFC-857 +TELNET ECHO OPTION +.It Cm RFC-858 +TELNET SUPPRESS GO AHEAD OPTION +.It Cm RFC-859 +TELNET STATUS OPTION +.It Cm RFC-860 +TELNET TIMING MARK OPTION +.It Cm RFC-861 +TELNET EXTENDED OPTIONS - LIST OPTION +.It Cm RFC-885 +TELNET END OF RECORD OPTION +.It Cm RFC-1073 +Telnet Window Size Option +.It Cm RFC-1079 +Telnet Terminal Speed Option +.It Cm RFC-1091 +Telnet Terminal-Type Option +.It Cm RFC-1096 +Telnet X Display Location Option +.It Cm RFC-1123 +Requirements for Internet Hosts -- Application and Support +.It Cm RFC-1184 +Telnet Linemode Option +.It Cm RFC-1372 +Telnet Remote Flow Control Option +.It Cm RFC-1416 +Telnet Authentication Option +.It Cm RFC-1411 +Telnet Authentication: Kerberos Version 4 +.It Cm RFC-1412 +Telnet Authentication: SPX +.It Cm RFC-1571 +Telnet Environment Option Interoperability Issues +.It Cm RFC-1572 +Telnet Environment Option +.Sh BUGS Some -.B TELNET +.Tn TELNET commands are only partially implemented. -.PP +.Pp Because of bugs in the original 4.2 BSD -.IR telnet (1), -.I telnetd +.Xr telnet 1 , +.Nm telnetd performs some dubious protocol exchanges to try to discover if the remote client is, in fact, a 4.2 BSD -.IR telnet (1). -.PP -.I Binary mode +.Xr telnet 1 . +.Pp +Binary mode has no common interpretation except between similar operating systems (Unix in this case). -.PP +.Pp The terminal type name received from the remote client is converted to lower case. -.PP -.I Telnetd +.Pp +.Nm Telnetd never sends -.B TELNET -.I go ahead -commands. +.Tn TELNET +.Dv IAC GA +(go ahead) commands. diff --git a/src/appl/telnet/telnetd/telnetd.c b/src/appl/telnet/telnetd/telnetd.c index 7e821544a..c2944da73 100644 --- a/src/appl/telnet/telnetd/telnetd.c +++ b/src/appl/telnet/telnetd/telnetd.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,26 +32,43 @@ */ #ifndef lint -char copyright[] = -"@(#) Copyright (c) 1989 Regents of the University of California.\n\ - All rights reserved.\n"; +static char copyright[] = +"@(#) Copyright (c) 1989, 1993\n\ + The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)telnetd.c 5.51 (Berkeley) 1/21/93"; +static char sccsid[] = "@(#)telnetd.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ #include "telnetd.h" -#include +#include "pathnames.h" + +#if defined(_SC_CRAY_SECURE_SYS) && !defined(SCM_SECURITY) +/* + * UNICOS 6.0/6.1 do not have SCM_SECURITY defined, so we can + * use it to tell us to turn off all the socket security code, + * since that is only used in UNICOS 7.0 and later. + */ +# undef _SC_CRAY_SECURE_SYS +#endif #if defined(_SC_CRAY_SECURE_SYS) #include #include +# ifdef SO_SEC_MULTI /* 8.0 code */ +#include +#include +# endif /* SO_SEC_MULTI */ int secflag; char tty_dev[16]; struct secdev dv; struct sysv sysv; +# ifdef SO_SEC_MULTI /* 8.0 code */ +struct socksec ss; +# else /* SO_SEC_MULTI */ /* 7.0 code */ struct socket_security ss; +# endif /* SO_SEC_MULTI */ #endif /* _SC_CRAY_SECURE_SYS */ #if defined(AUTHENTICATION) @@ -77,9 +94,9 @@ int registerd_host_only = 0; * ptyibuf+1 to be on a full-word boundary. The following wierdness * is simply to make that happen. */ -char ptyibufbuf[BUFSIZ+4]; -char *ptyibuf = ptyibufbuf+3; -char *ptyip = ptyibufbuf+3; +long ptyibufbuf[BUFSIZ/sizeof(long)+1]; +char *ptyibuf = ((char *)&ptyibufbuf[1])-1; +char *ptyip = ((char *)&ptyibufbuf[1])-1; char ptyibuf2[BUFSIZ]; unsigned char ctlbuf[BUFSIZ]; struct strbuf strbufc, strbufd; @@ -110,6 +127,40 @@ char *progname; extern void usage P((void)); +/* + * The string to pass to getopt(). We do it this way so + * that only the actual options that we support will be + * passed off to getopt(). + */ +char valid_opts[] = { + 'd', ':', 'h', 'k', 'n', 'S', ':', 'u', ':', 'U', +#ifdef AUTHENTICATION + 'a', ':', 'X', ':', +#endif +#ifdef BFTPDAEMON + 'B', +#endif +#ifdef DIAGNOSTICS + 'D', ':', +#endif +#ifdef ENCRYPTION + 'e', ':', +#endif +#if defined(CRAY) && defined(NEWINIT) + 'I', ':', +#endif +#ifdef LINEMODE + 'l', +#endif +#ifdef CRAY + 'r', ':', +#endif +#ifdef SecurID + 's', +#endif + '\0' +}; + main(argc, argv) char *argv[]; { @@ -125,9 +176,9 @@ main(argc, argv) pfrontp = pbackp = ptyobuf; netip = netibuf; nfrontp = nbackp = netobuf; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION nclearto = 0; -#endif +#endif /* ENCRYPTION */ progname = *argv; @@ -139,7 +190,7 @@ main(argc, argv) highpty = getnpty(); #endif /* CRAY */ - while ((ch = getopt(argc, argv, "d:a:e:klhnr:u:UI:D:B:sS:a:X:")) != EOF) { + while ((ch = getopt(argc, argv, valid_opts)) != EOF) { switch(ch) { #ifdef AUTHENTICATION @@ -314,7 +365,7 @@ main(argc, argv) #endif /* AUTHENTICATION */ default: - fprintf(stderr, "telnetd: %s: unknown option\n", ch); + fprintf(stderr, "telnetd: %c: unknown option\n", ch); /* FALLTHROUGH */ case '?': usage(); @@ -391,10 +442,14 @@ main(argc, argv) secflag = sysconf(_SC_CRAY_SECURE_SYS); /* - * Get socket's security label + * Get socket's security label */ if (secflag) { - int sz = sizeof(ss); + int szss = sizeof(ss); +#ifdef SO_SEC_MULTI /* 8.0 code */ + int sock_multi; + int szi = sizeof(int); +#endif /* SO_SEC_MULTI */ bzero((char *)&dv, sizeof(dv)); @@ -404,18 +459,39 @@ main(argc, argv) } /* - * Get socket security label and set device values - * {security label to be set on ttyp device} + * Get socket security label and set device values + * {security label to be set on ttyp device} */ +#ifdef SO_SEC_MULTI /* 8.0 code */ + if ((getsockopt(0, SOL_SOCKET, SO_SECURITY, + (char *)&ss, &szss) < 0) || + (getsockopt(0, SOL_SOCKET, SO_SEC_MULTI, + (char *)&sock_multi, &szi) < 0)) { + perror("getsockopt"); + exit(1); + } else { + dv.dv_actlvl = ss.ss_actlabel.lt_level; + dv.dv_actcmp = ss.ss_actlabel.lt_compart; + if (!sock_multi) { + dv.dv_minlvl = dv.dv_maxlvl = dv.dv_actlvl; + dv.dv_valcmp = dv.dv_actcmp; + } else { + dv.dv_minlvl = ss.ss_minlabel.lt_level; + dv.dv_maxlvl = ss.ss_maxlabel.lt_level; + dv.dv_valcmp = ss.ss_maxlabel.lt_compart; + } + dv.dv_devflg = 0; + } +#else /* SO_SEC_MULTI */ /* 7.0 code */ if (getsockopt(0, SOL_SOCKET, SO_SECURITY, - (char *)&ss, &sz) >= 0) { - + (char *)&ss, &szss) >= 0) { dv.dv_actlvl = ss.ss_slevel; dv.dv_actcmp = ss.ss_compart; dv.dv_minlvl = ss.ss_minlvl; dv.dv_maxlvl = ss.ss_maxlvl; dv.dv_valcmp = ss.ss_maxcmp; } +#endif /* SO_SEC_MULTI */ } #endif /* _SC_CRAY_SECURE_SYS */ @@ -458,7 +534,7 @@ usage() { fprintf(stderr, "Usage: telnetd"); #ifdef AUTHENTICATION - fprintf(stderr, " [-a (debug|other|user|valid|off)]\n\t"); + fprintf(stderr, " [-a (debug|other|user|valid|off|none)]\n\t"); #endif #ifdef BFTPDAEMON fprintf(stderr, " [-B]"); @@ -474,6 +550,9 @@ usage() #if defined(CRAY) && defined(NEWINIT) fprintf(stderr, " [-Iinitid]"); #endif +#if defined(LINEMODE) && defined(KLUDGELINEMODE) + fprintf(stderr, " [-k]"); +#endif #ifdef LINEMODE fprintf(stderr, " [-l]"); #endif @@ -481,9 +560,13 @@ usage() #ifdef CRAY fprintf(stderr, " [-r[lowpty]-[highpty]]"); #endif + fprintf(stderr, "\n\t"); #ifdef SecurID fprintf(stderr, " [-s]"); #endif +#ifdef HAS_GETTOS + fprintf(stderr, " [-S tos]"); +#endif #ifdef AUTHENTICATION fprintf(stderr, " [-X auth-type]"); #endif @@ -498,7 +581,9 @@ usage() * Ask the other end to send along its terminal type and speed. * Output is the variable terminaltype filled in. */ -static char ttytype_sbbuf[] = { IAC, SB, TELOPT_TTYPE, TELQUAL_SEND, IAC, SE }; +static unsigned char ttytype_sbbuf[] = { + IAC, SB, TELOPT_TTYPE, TELQUAL_SEND, IAC, SE +}; int getterminaltype(name) @@ -520,24 +605,26 @@ getterminaltype(name) } #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION send_will(TELOPT_ENCRYPT, 1); -#endif +#endif /* ENCRYPTION */ send_do(TELOPT_TTYPE, 1); send_do(TELOPT_TSPEED, 1); send_do(TELOPT_XDISPLOC, 1); - send_do(TELOPT_ENVIRON, 1); + send_do(TELOPT_NEW_ENVIRON, 1); + send_do(TELOPT_OLD_ENVIRON, 1); while ( -#if defined(ENCRYPTION) +#ifdef ENCRYPTION his_do_dont_is_changing(TELOPT_ENCRYPT) || -#endif +#endif /* ENCRYPTION */ his_will_wont_is_changing(TELOPT_TTYPE) || his_will_wont_is_changing(TELOPT_TSPEED) || his_will_wont_is_changing(TELOPT_XDISPLOC) || - his_will_wont_is_changing(TELOPT_ENVIRON)) { + his_will_wont_is_changing(TELOPT_NEW_ENVIRON) || + his_will_wont_is_changing(TELOPT_OLD_ENVIRON)) { ttloop(); } -#if defined(ENCRYPTION) +#ifdef ENCRYPTION /* * Wait for the negotiation of what type of encryption we can * send with. If autoencrypt is not set, this will just return. @@ -545,24 +632,34 @@ getterminaltype(name) if (his_state_is_will(TELOPT_ENCRYPT)) { encrypt_wait(); } -#endif +#endif /* ENCRYPTION */ if (his_state_is_will(TELOPT_TSPEED)) { - static char sbbuf[] = { IAC, SB, TELOPT_TSPEED, TELQUAL_SEND, IAC, SE }; + static unsigned char sb[] = + { IAC, SB, TELOPT_TSPEED, TELQUAL_SEND, IAC, SE }; - bcopy(sbbuf, nfrontp, sizeof sbbuf); - nfrontp += sizeof sbbuf; + bcopy(sb, nfrontp, sizeof sb); + nfrontp += sizeof sb; } if (his_state_is_will(TELOPT_XDISPLOC)) { - static char sbbuf[] = { IAC, SB, TELOPT_XDISPLOC, TELQUAL_SEND, IAC, SE }; + static unsigned char sb[] = + { IAC, SB, TELOPT_XDISPLOC, TELQUAL_SEND, IAC, SE }; - bcopy(sbbuf, nfrontp, sizeof sbbuf); - nfrontp += sizeof sbbuf; + bcopy(sb, nfrontp, sizeof sb); + nfrontp += sizeof sb; } - if (his_state_is_will(TELOPT_ENVIRON)) { - static char sbbuf[] = { IAC, SB, TELOPT_ENVIRON, TELQUAL_SEND, IAC, SE }; + if (his_state_is_will(TELOPT_NEW_ENVIRON)) { + static unsigned char sb[] = + { IAC, SB, TELOPT_NEW_ENVIRON, TELQUAL_SEND, IAC, SE }; - bcopy(sbbuf, nfrontp, sizeof sbbuf); - nfrontp += sizeof sbbuf; + bcopy(sb, nfrontp, sizeof sb); + nfrontp += sizeof sb; + } + else if (his_state_is_will(TELOPT_OLD_ENVIRON)) { + static unsigned char sb[] = + { IAC, SB, TELOPT_OLD_ENVIRON, TELQUAL_SEND, IAC, SE }; + + bcopy(sb, nfrontp, sizeof sb); + nfrontp += sizeof sb; } if (his_state_is_will(TELOPT_TTYPE)) { @@ -577,10 +674,14 @@ getterminaltype(name) while (sequenceIs(xdisplocsubopt, baseline)) ttloop(); } - if (his_state_is_will(TELOPT_ENVIRON)) { + if (his_state_is_will(TELOPT_NEW_ENVIRON)) { while (sequenceIs(environsubopt, baseline)) ttloop(); } + if (his_state_is_will(TELOPT_OLD_ENVIRON)) { + while (sequenceIs(oenvironsubopt, baseline)) + ttloop(); + } if (his_state_is_will(TELOPT_TTYPE)) { char first[256], last[256]; @@ -687,13 +788,14 @@ doit(who) int t; struct hostent *hp; int level; + int ptynum; char user_name[256]; /* * Find an available pty to use. */ #ifndef convex - pty = getpty(); + pty = getpty(&ptynum); if (pty < 0) fatal(net, "All network ports in use"); #else @@ -717,9 +819,14 @@ doit(who) * set ttyp line security label */ if (secflag) { - extern char *myline; - if (setdevs(myline, &dv) < 0) - fatal(net, "cannot set pty security"); + char slave_dev[16]; + + sprintf(tty_dev, "/dev/pty/%03d", ptynum); + if (setdevs(tty_dev, &dv) < 0) + fatal(net, "cannot set pty security"); + sprintf(slave_dev, "/dev/ttyp%03d", ptynum); + if (setdevs(slave_dev, &dv) < 0) + fatal(net, "cannot set tty security"); } #endif /* _SC_CRAY_SECURE_SYS */ @@ -765,6 +872,15 @@ doit(who) #ifndef convex startslave(host, level, user_name); +#if defined(_SC_CRAY_SECURE_SYS) + if (secflag) { + if (setulvl(dv.dv_actlvl) < 0) + fatal(net,"cannot setulvl()"); + if (setucmp(dv.dv_actcmp) < 0) + fatal(net, "cannot setucmp()"); + } +#endif /* _SC_CRAY_SECURE_SYS */ + telnet(net, pty); /* begin server processing */ #else telnet(net, pty, host); @@ -975,7 +1091,7 @@ telnet(f, p, host) #ifdef TIOCNOTTY { register int t; - t = open(KRB5_PATH_TTY, O_RDWR); + t = open(_PATH_TTY, O_RDWR); if (t >= 0) { (void) ioctl(t, TIOCNOTTY, (char *)0); (void) close(t); @@ -1310,7 +1426,7 @@ int readstream(p, ibuf, bufsize) int newflow; strbufc.maxlen = BUFSIZ; - strbufc.buf = ctlbuf; + strbufc.buf = (char *)ctlbuf; strbufd.maxlen = bufsize-1; strbufd.len = 0; strbufd.buf = ibuf+1; diff --git a/src/appl/telnet/telnetd/telnetd.h b/src/appl/telnet/telnetd/telnetd.h index 9e3e05abb..234b9739e 100644 --- a/src/appl/telnet/telnetd/telnetd.h +++ b/src/appl/telnet/telnetd/telnetd.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)telnetd.h 5.3 (Berkeley) 3/1/91 + * @(#)telnetd.h 8.1 (Berkeley) 6/4/93 */ diff --git a/src/appl/telnet/telnetd/termstat.c b/src/appl/telnet/telnetd/termstat.c index 010ab010d..a3f693122 100644 --- a/src/appl/telnet/telnetd/termstat.c +++ b/src/appl/telnet/telnetd/termstat.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)termstat.c 5.12 (Berkeley) 1/19/93"; +static char sccsid[] = "@(#)termstat.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ #include "telnetd.h" @@ -165,25 +165,7 @@ localstat() /* * Check for changes to flow control if client supports it. */ - if (his_state_is_will(TELOPT_LFLOW)) { - if (tty_flowmode() != flowmode) { - flowmode = tty_flowmode(); - (void) sprintf(nfrontp, "%c%c%c%c%c%c", - IAC, SB, TELOPT_LFLOW, - flowmode ? LFLOW_ON : LFLOW_OFF, - IAC, SE); - nfrontp += 6; - } - if (tty_restartany() != restartany) { - restartany = tty_restartany(); - (void) sprintf(nfrontp, "%c%c%c%c%c%c", - IAC, SB, TELOPT_LFLOW, - restartany ? LFLOW_RESTART_ANY - : LFLOW_RESTART_XON, - IAC, SE); - nfrontp += 6; - } - } + flowstat(); /* * Check linemode on/off state @@ -199,7 +181,7 @@ localstat() tty_setlinemode(uselinemode); } -#if defined(ENCRYPTION) +#ifdef ENCRYPTION /* * If the terminal is not echoing, but editing is enabled, * something like password input is going to happen, so @@ -217,7 +199,7 @@ localstat() enc_passwd = 0; } } -#endif +#endif /* ENCRYPTION */ /* * Do echo mode handling as soon as we know what the @@ -368,6 +350,34 @@ done: } /* end of localstat */ #endif /* LINEMODE */ +/* + * flowstat + * + * Check for changes to flow control + */ + void +flowstat() +{ + if (his_state_is_will(TELOPT_LFLOW)) { + if (tty_flowmode() != flowmode) { + flowmode = tty_flowmode(); + (void) sprintf(nfrontp, "%c%c%c%c%c%c", + IAC, SB, TELOPT_LFLOW, + flowmode ? LFLOW_ON : LFLOW_OFF, + IAC, SE); + nfrontp += 6; + } + if (tty_restartany() != restartany) { + restartany = tty_restartany(); + (void) sprintf(nfrontp, "%c%c%c%c%c%c", + IAC, SB, TELOPT_LFLOW, + restartany ? LFLOW_RESTART_ANY + : LFLOW_RESTART_XON, + IAC, SE); + nfrontp += 6; + } + } +} /* * clientstat diff --git a/src/appl/telnet/telnetd/utility.c b/src/appl/telnet/telnetd/utility.c index ea70696f7..29625cd7a 100644 --- a/src/appl/telnet/telnetd/utility.c +++ b/src/appl/telnet/telnetd/utility.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)utility.c 5.10 (Berkeley) 1/19/93"; +static char sccsid[] = "@(#)utility.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ #define PRINTOPTIONS @@ -193,11 +193,11 @@ netclear() #define wewant(p) ((nfrontp > p) && ((*p&0xff) == IAC) && \ ((*(p+1)&0xff) != EC) && ((*(p+1)&0xff) != EL)) -#if defined(ENCRYPTION) +#ifdef ENCRYPTION thisitem = nclearto > netobuf ? nclearto : netobuf; -#else +#else /* ENCRYPTION */ thisitem = netobuf; -#endif +#endif /* ENCRYPTION */ while ((next = nextitem(thisitem)) <= nbackp) { thisitem = next; @@ -205,11 +205,11 @@ netclear() /* Now, thisitem is first before/at boundary. */ -#if defined(ENCRYPTION) +#ifdef ENCRYPTION good = nclearto > netobuf ? nclearto : netobuf; -#else +#else /* ENCRYPTION */ good = netobuf; /* where the good bytes go */ -#endif +#endif /* ENCRYPTION */ while (nfrontp > thisitem) { if (wewant(thisitem)) { @@ -250,7 +250,7 @@ netflush() n += strlen(nfrontp); /* get count first */ nfrontp += strlen(nfrontp); /* then move pointer */ }); -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (encrypt_output) { char *s = nclearto ? nclearto : nbackp; if (nfrontp - s > 0) { @@ -258,7 +258,7 @@ netflush() nclearto = nfrontp; } } -#endif +#endif /* ENCRYPTION */ /* * if no urgent data, or if the other side appears to be an * old 4.2 client (and thus unable to survive TCP urgent data), @@ -289,18 +289,18 @@ netflush() cleanup(0); } nbackp += n; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (nbackp > nclearto) nclearto = 0; -#endif +#endif /* ENCRYPTION */ if (nbackp >= neturg) { neturg = 0; } if (nbackp == nfrontp) { nbackp = nfrontp = netobuf; -#if defined(ENCRYPTION) +#ifdef ENCRYPTION nclearto = 0; -#endif +#endif /* ENCRYPTION */ } return; } /* end of netflush */ @@ -346,7 +346,7 @@ fatal(f, msg) char buf[BUFSIZ]; (void) sprintf(buf, "telnetd: %s.\r\n", msg); -#if defined(ENCRYPTION) +#ifdef ENCRYPTION if (encrypt_output) { /* * Better turn off encryption first.... @@ -355,7 +355,7 @@ fatal(f, msg) encrypt_send_end(); netflush(); } -#endif +#endif /* ENCRYPTION */ (void) write(f, buf, (int)strlen(buf)); sleep(1); /*XXX*/ exit(1); @@ -448,7 +448,11 @@ putf(cp, where) char *slash; time_t t; char db[100]; +#ifdef STREAMSPTY + extern char *index(); +#else extern char *rindex(); +#endif putlocation = where; @@ -555,7 +559,7 @@ printsub(direction, pointer, length) length -= 2; } if (length < 1) { - sprintf(nfrontp, "(Empty suboption???)"); + sprintf(nfrontp, "(Empty suboption??\?)"); nfrontp += strlen(nfrontp); return; } @@ -581,7 +585,7 @@ printsub(direction, pointer, length) sprintf(nfrontp, "TERMINAL-SPEED"); nfrontp += strlen(nfrontp); if (length < 2) { - sprintf(nfrontp, " (empty suboption???)"); + sprintf(nfrontp, " (empty suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -608,7 +612,7 @@ printsub(direction, pointer, length) sprintf(nfrontp, "TOGGLE-FLOW-CONTROL"); nfrontp += strlen(nfrontp); if (length < 2) { - sprintf(nfrontp, " (empty suboption???)"); + sprintf(nfrontp, " (empty suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -635,7 +639,7 @@ printsub(direction, pointer, length) sprintf(nfrontp, "NAWS"); nfrontp += strlen(nfrontp); if (length < 2) { - sprintf(nfrontp, " (empty suboption???)"); + sprintf(nfrontp, " (empty suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -667,7 +671,7 @@ printsub(direction, pointer, length) sprintf(nfrontp, "LINEMODE "); nfrontp += strlen(nfrontp); if (length < 2) { - sprintf(nfrontp, " (empty suboption???)"); + sprintf(nfrontp, " (empty suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -686,7 +690,7 @@ printsub(direction, pointer, length) common: nfrontp += strlen(nfrontp); if (length < 3) { - sprintf(nfrontp, "(no option???)"); + sprintf(nfrontp, "(no option??\?)"); nfrontp += strlen(nfrontp); break; } @@ -756,7 +760,7 @@ printsub(direction, pointer, length) sprintf(nfrontp, "MODE "); nfrontp += strlen(nfrontp); if (length < 3) { - sprintf(nfrontp, "(no mode???)"); + sprintf(nfrontp, "(no mode??\?)"); nfrontp += strlen(nfrontp); break; } @@ -821,7 +825,7 @@ printsub(direction, pointer, length) case WONT: cp = "WONT"; goto common2; common2: i++; - if (TELOPT_OK((int)pointer[i])) + if (TELOPT_OK(pointer[i])) sprintf(nfrontp, " %s %s", cp, TELOPT(pointer[i])); else sprintf(nfrontp, " %s %d", cp, pointer[i]); @@ -888,8 +892,12 @@ printsub(direction, pointer, length) nfrontp += strlen(nfrontp); break; - case TELOPT_ENVIRON: - sprintf(nfrontp, "ENVIRON "); + case TELOPT_NEW_ENVIRON: + sprintf(nfrontp, "NEW-ENVIRON "); + goto env_common1; + case TELOPT_OLD_ENVIRON: + sprintf(nfrontp, "OLD-ENVIRON"); + env_common1: nfrontp += strlen(nfrontp); switch (pointer[1]) { case TELQUAL_IS: @@ -901,20 +909,18 @@ printsub(direction, pointer, length) case TELQUAL_INFO: sprintf(nfrontp, "INFO "); env_common: - nfrontp += strlen(nfrontp); + nfrontp += strlen(nfrontp); { register int noquote = 2; for (i = 2; i < length; i++ ) { switch (pointer[i]) { - case ENV_VAR: - if (pointer[1] == TELQUAL_SEND) - goto def_case; + case NEW_ENV_VAR: sprintf(nfrontp, "\" VAR " + noquote); nfrontp += strlen(nfrontp); noquote = 2; break; - case ENV_VALUE: + case NEW_ENV_VALUE: sprintf(nfrontp, "\" VALUE " + noquote); nfrontp += strlen(nfrontp); noquote = 2; @@ -927,8 +933,6 @@ printsub(direction, pointer, length) break; case ENV_USERVAR: - if (pointer[1] == TELQUAL_SEND) - goto def_case; sprintf(nfrontp, "\" USERVAR " + noquote); nfrontp += strlen(nfrontp); noquote = 2; @@ -964,7 +968,7 @@ printsub(direction, pointer, length) nfrontp += strlen(nfrontp); if (length < 2) { - sprintf(nfrontp, " (empty suboption???)"); + sprintf(nfrontp, " (empty suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -980,7 +984,7 @@ printsub(direction, pointer, length) sprintf(nfrontp, "%d ", pointer[2]); nfrontp += strlen(nfrontp); if (length < 3) { - sprintf(nfrontp, "(partial suboption???)"); + sprintf(nfrontp, "(partial suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -1007,7 +1011,7 @@ printsub(direction, pointer, length) sprintf(nfrontp, "%d ", pointer[i]); nfrontp += strlen(nfrontp); if (++i >= length) { - sprintf(nfrontp, "(partial suboption???)"); + sprintf(nfrontp, "(partial suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -1040,12 +1044,12 @@ printsub(direction, pointer, length) break; #endif -#if defined(ENCRYPTION) +#ifdef ENCRYPTION case TELOPT_ENCRYPT: sprintf(nfrontp, "ENCRYPT"); nfrontp += strlen(nfrontp); if (length < 2) { - sprintf(nfrontp, " (empty suboption???)"); + sprintf(nfrontp, " (empty suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -1076,7 +1080,7 @@ printsub(direction, pointer, length) "IS" : "REPLY"); nfrontp += strlen(nfrontp); if (length < 3) { - sprintf(nfrontp, " (partial suboption???)"); + sprintf(nfrontp, " (partial suboption??\?)"); nfrontp += strlen(nfrontp); break; } @@ -1126,7 +1130,7 @@ printsub(direction, pointer, length) break; } break; -#endif +#endif /* ENCRYPTION */ default: if (TELOPT_OK(pointer[0])) -- 2.26.2