From 0582c91393925216c4549fcb8ecb6aac54dae86e Mon Sep 17 00:00:00 2001 From: cgd Date: Fri, 25 Feb 1994 03:00:16 +0000 Subject: [PATCH] new telnet from ftp.cray.com. Encryption support ripped out, pending figuring out what to do about it... --- usr.bin/telnet/Makefile | 14 +- usr.bin/telnet/authenc.c | 18 +- usr.bin/telnet/commands.c | 349 ++++++++++++-------------- usr.bin/telnet/defines.h | 8 +- usr.bin/telnet/externs.h | 49 ++-- usr.bin/telnet/fdset.h | 8 +- usr.bin/telnet/general.h | 8 +- usr.bin/telnet/main.c | 70 ++++-- usr.bin/telnet/network.c | 16 +- usr.bin/telnet/ring.c | 55 +---- usr.bin/telnet/ring.h | 17 +- usr.bin/telnet/sys_bsd.c | 92 ++++--- usr.bin/telnet/telnet.1 | 492 +++++++++++++++++++++++++++++-------- usr.bin/telnet/telnet.c | 272 ++++++++++---------- usr.bin/telnet/terminal.c | 25 +- usr.bin/telnet/tn3270.c | 18 +- usr.bin/telnet/types.h | 8 +- usr.bin/telnet/utilities.c | 170 ++++++------- 18 files changed, 948 insertions(+), 741 deletions(-) diff --git a/usr.bin/telnet/Makefile b/usr.bin/telnet/Makefile index 66e6c3021eb7..5d66594ff536 100644 --- a/usr.bin/telnet/Makefile +++ b/usr.bin/telnet/Makefile @@ -30,20 +30,28 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# from: @(#)Makefile 5.6 (Berkeley) 3/5/91 -# $Id: Makefile,v 1.2 1993/07/30 23:50:34 mycroft Exp $ +# from: @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $Id: Makefile,v 1.3 1994/02/25 03:00:16 cgd Exp $ # PROG= telnet CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO +CFLAGS+=-DENV_HACK CFLAGS+=-I${.CURDIR}/../../lib - LDADD= -ltermcap -ltelnet 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: + @echo "Encryption code already removed." diff --git a/usr.bin/telnet/authenc.c b/usr.bin/telnet/authenc.c index 029142497777..75880c2eebcf 100644 --- a/usr.bin/telnet/authenc.c +++ b/usr.bin/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,11 +32,11 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)authenc.c 5.1 (Berkeley) 3/1/91";*/ -static char rcsid[] = "$Id: authenc.c,v 1.2 1993/08/01 18:07:26 mycroft Exp $"; +/* from: static char sccsid[] = "@(#)authenc.c 8.1 (Berkeley) 6/6/93"; */ +static char *rcsid = "$Id: authenc.c,v 1.3 1994/02/25 03:00:20 cgd Exp $"; #endif /* not lint */ -#if defined(ENCRYPT) || defined(AUTHENTICATE) +#if defined(AUTHENTICATION) #include #include #include @@ -65,12 +65,6 @@ net_write(str, len) void net_encrypt() { -#if defined(ENCRYPT) - if (encrypt_output) - ring_encrypt(&netoring, encrypt_output); - else - ring_clearto(&netoring); -#endif } int @@ -109,4 +103,4 @@ telnet_gets(prompt, result, length, echo) TerminalNewMode(om); return(res); } -#endif +#endif /* defined(AUTHENTICATION) */ diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index 43f44803a420..2d8643c89354 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/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,13 +32,13 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)commands.c 5.5 (Berkeley) 3/22/91";*/ -static char rcsid[] = "$Id: commands.c,v 1.4 1993/08/01 18:07:25 mycroft Exp $"; +/* from: static char sccsid[] = "@(#)commands.c 8.1 (Berkeley) 6/6/93"; */ +static char *rcsid = "$Id: commands.c,v 1.5 1994/02/25 03:00:22 cgd Exp $"; #endif /* not lint */ #if defined(unix) #include -#ifdef CRAY +#if defined(CRAY) || defined(sysV88) #include #endif #include @@ -58,7 +58,6 @@ static char rcsid[] = "$Id: commands.c,v 1.4 1993/08/01 18:07:25 mycroft Exp $"; #include #include -#include #include #include "general.h" @@ -69,12 +68,12 @@ static char rcsid[] = "$Id: commands.c,v 1.4 1993/08/01 18:07:25 mycroft Exp $"; #include "defines.h" #include "types.h" -#ifndef CRAY +#if !defined(CRAY) && !defined(sysV88) #include # if (defined(vax) || defined(tahoe) || defined(hp300)) && !defined(ultrix) # include # endif /* vax */ -#endif /* CRAY */ +#endif /* !defined(CRAY) && !defined(sysV88) */ #include @@ -256,12 +255,6 @@ static int send_willcmd P((char *)), send_wontcmd P((char *)); -extern int - send_do P((int, int)), - send_dont P((int, int)), - send_will P((int, int)), - send_wont P((int, int)); - static struct sendlist Sendlist[] = { { "ao", "Send Telnet Abort output", 1, 0, 0, 2, AO }, { "ayt", "Send Telnet 'Are You There'", 1, 0, 0, 2, AYT }, @@ -418,21 +411,23 @@ send_tncmd(func, cmd, name) { char **cpp; extern char *telopts[]; + register int val = 0; if (isprefix(name, "help") || isprefix(name, "?")) { register int col, len; - printf("Usage: send %s