From nobody Wed Oct 05 16:29:40 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MjKm50WjCz4V8Ct; Wed, 5 Oct 2022 16:29:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MjKm45tP3z3mlD; Wed, 5 Oct 2022 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664987380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWyeF62n7ywrb5T3KeGwc3YR35lS/my/MXl40fDqa3o=; b=sMMsQ0YpUr/7LjZOw+gGmd9aU+otLeiClsMh+ID+xWtxZbfltcJ34EKgGiL2LJqzccbI3n FzDmPzKD1sopM+mRQl3LzmBTOoM8Adf9t6q/NIyZq/Fe8IJw/VW2NP6MSopwmppaBZw7Vz UEEmFLWo0unJrbBSB1w6d2zO6b9zmNaTXktCtqPdlkIZ159p3kZhxN8BI4g6+it4PHUT7M QPS/IkY3+TuQ43x0uzYMs+gHNfHJH9qaKPc9Kwp9/kKyGXbYlDPJKGSHE+svQdPCJOh+nV c8f54cZikOUORv4Q93DSrkupJFSwCdHGyjMTpdVJM1vTWb9w5YCP95CEpQBGpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MjKm44yKkzxmr; Wed, 5 Oct 2022 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 295GTe5k040980; Wed, 5 Oct 2022 16:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 295GTeqq040979; Wed, 5 Oct 2022 16:29:40 GMT (envelope-from git) Date: Wed, 5 Oct 2022 16:29:40 GMT Message-Id: <202210051629.295GTeqq040979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: d701f45aba19 - main - Remove telnetd sources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d701f45aba19f232ce7817085935f33dd609ed8b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664987380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWyeF62n7ywrb5T3KeGwc3YR35lS/my/MXl40fDqa3o=; b=pSL4v+mfyyoeqG4kLwNGAJlNQ4WJba96uSUlUs9kQHfgiGNo0tbDdqWZAON4GJTLjqDEUD ARqXPIT+O7rkJ4pO92ChbATz4sclEmui/judeNRGC5SQaoFJa80SsoiO1a20Wob2Et5wx4 YWXJRi/ZqgeizK2Pu68qkM68I9JTqfMFy0VdBl7gjRUUsVEyGGAZdpNuNvFAFBZyy4Lakx yfDCrcQhXICk1WO97qdbAgggAPZbcEJ1ncc8f2BZevxsVPiAGuceYxbbDdp502kEC5+j/s 0s74KOcasPPK538C73KpVbrla2SoQCIzZp7fu09n581A0dwOJaMM05p072sgIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664987380; a=rsa-sha256; cv=none; b=vm6T0rhPW7Y3ausoY6PA0yh7778IiFqKPXgexcndTJXWT3WwMYl7x82ZMuSVAy36SXwPc/ 4xU7f9Mg8B9wlRWwrCk4ieP4RtTt6YnedujjQ7TjTAXyQSbEkYWkt+BPPCphba14P0E+oT Xal7aDbL4RMaI18Cg0XHVhhsMN2P7Pooh+YaX+dTT/GwbyLnbqcIhjdnNkItj71JZ0qH/K UHH6unKF7R4yKshBR9Ro9SIQL7ghLUjhG51lZMisVfuReesN1pIiSOpp6GKTLdTepHftKR ZKvjacbiUZWzjvbiuyFKSBUb+zpSPKLfFJNUSnqYmpQslGdyCyoGCQexvz0ypA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=d701f45aba19f232ce7817085935f33dd609ed8b commit d701f45aba19f232ce7817085935f33dd609ed8b Author: Brooks Davis AuthorDate: 2022-10-05 16:26:30 +0000 Commit: Brooks Davis CommitDate: 2022-10-05 16:27:14 +0000 Remove telnetd sources Differential Revision: https://reviews.freebsd.org/D36621 --- contrib/telnet/telnetd/authenc.c | 86 -- contrib/telnet/telnetd/defs.h | 254 ------ contrib/telnet/telnetd/ext.h | 218 ----- contrib/telnet/telnetd/global.c | 48 -- contrib/telnet/telnetd/pathnames.h | 52 -- contrib/telnet/telnetd/slc.c | 480 ----------- contrib/telnet/telnetd/state.c | 1631 ------------------------------------ contrib/telnet/telnetd/sys_term.c | 1252 --------------------------- contrib/telnet/telnetd/telnetd.8 | 618 -------------- contrib/telnet/telnetd/telnetd.c | 1256 --------------------------- contrib/telnet/telnetd/telnetd.h | 45 - contrib/telnet/telnetd/termstat.c | 628 -------------- contrib/telnet/telnetd/utility.c | 1087 ------------------------ 13 files changed, 7655 deletions(-) diff --git a/contrib/telnet/telnetd/authenc.c b/contrib/telnet/telnetd/authenc.c deleted file mode 100644 index 80b9f39fed73..000000000000 --- a/contrib/telnet/telnetd/authenc.c +++ /dev/null @@ -1,86 +0,0 @@ -/*- - * 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. 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 0 -#ifndef lint -static const char sccsid[] = "@(#)authenc.c 8.2 (Berkeley) 5/30/95"; -#endif -#endif -#include -__FBSDID("$FreeBSD$"); - -#ifdef AUTHENTICATION -#ifdef ENCRYPTION -/* Above "#ifdef"s actually "or"'ed together. XXX MarkM - */ -#include "telnetd.h" -#include - -int -net_write(unsigned char *str, int len) -{ - if (nfrontp + len < netobuf + BUFSIZ) { - output_datalen(str, len); - return(len); - } - return(0); -} - -void -net_encrypt(void) -{ -#ifdef ENCRYPTION - char *s = (nclearto > nbackp) ? nclearto : nbackp; - if (s < nfrontp && encrypt_output) { - (*encrypt_output)((unsigned char *)s, nfrontp - s); - } - nclearto = nfrontp; -#endif /* ENCRYPTION */ -} - -int -telnet_spin(void) -{ - ttloop(); - return(0); -} - -char * -telnet_getenv(char *val) -{ - return(getenv(val)); -} - -char * -telnet_gets(const char *prompt __unused, char *result __unused, int length __unused, int echo __unused) -{ - return(NULL); -} -#endif /* ENCRYPTION */ -#endif /* AUTHENTICATION */ diff --git a/contrib/telnet/telnetd/defs.h b/contrib/telnet/telnetd/defs.h deleted file mode 100644 index 6baf2bf8ea3c..000000000000 --- a/contrib/telnet/telnetd/defs.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - * 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 - * 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. 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. - * - * @(#)defs.h 8.1 (Berkeley) 6/4/93 - * $FreeBSD$ - */ - -/* - * Telnet server defines - */ -#include -#include - -#ifndef BSD -# define BSD 43 -#endif - -#if defined(PRINTOPTIONS) && defined(DIAGNOSTICS) -#define TELOPTS -#define TELCMDS -#define SLC_NAMES -#endif - -#if defined(SYSV_TERMIO) && !defined(USE_TERMIO) -# define USE_TERMIO -#endif - -#include -#include -#include -#include -#include -#include -#ifndef FILIO_H -#include -#else -#include -#endif - -#include - -#include - -#include -#ifdef __STDC__ -#include -#endif -#include -#include -#include -#include -#ifndef LOG_DAEMON -#define LOG_DAEMON 0 -#endif -#ifndef LOG_ODELAY -#define LOG_ODELAY 0 -#endif -#include -#ifndef NO_STRING_H -#include -#else -#include -#endif - -#ifndef USE_TERMIO -#include -#else -# ifdef SYSV_TERMIO -# include -# else -# include -# endif -#endif -#if !defined(USE_TERMIO) || defined(NO_CC_T) -typedef unsigned char cc_t; -#endif - -#ifdef __STDC__ -#include -#endif - -#ifndef _POSIX_VDISABLE -# ifdef VDISABLE -# define _POSIX_VDISABLE VDISABLE -# else -# define _POSIX_VDISABLE ((unsigned char)'\377') -# endif -#endif - -#if !defined(TIOCSCTTY) && defined(TCSETCTTY) -# define TIOCSCTTY TCSETCTTY -#endif - -#ifndef FD_SET -#ifndef HAVE_fd_set -typedef struct fd_set { int fds_bits[1]; } fd_set; -#endif - -#define FD_SET(n, p) ((p)->fds_bits[0] |= (1<<(n))) -#define FD_CLR(n, p) ((p)->fds_bits[0] &= ~(1<<(n))) -#define FD_ISSET(n, p) ((p)->fds_bits[0] & (1<<(n))) -#define FD_ZERO(p) ((p)->fds_bits[0] = 0) -#endif /* FD_SET */ - -/* - * I/O data buffers defines - */ -#define NETSLOP 64 - -#define NIACCUM(c) { *netip++ = c; \ - ncc++; \ - } - -/* clock manipulations */ -#define settimer(x) (clocks.x = ++clocks.system) -#define sequenceIs(x,y) (clocks.x < clocks.y) - -/* - * Linemode support states, in decreasing order of importance - */ -#define REAL_LINEMODE 0x04 -#define KLUDGE_OK 0x03 -#define NO_AUTOKLUDGE 0x02 -#define KLUDGE_LINEMODE 0x01 -#define NO_LINEMODE 0x00 - -/* - * Structures of information for each special character function. - */ -typedef struct { - unsigned char flag; /* the flags for this function */ - cc_t val; /* the value of the special character */ -} slcent, *Slcent; - -typedef struct { - slcent defset; /* the default settings */ - slcent current; /* the current settings */ - cc_t *sptr; /* a pointer to the char in */ - /* system data structures */ -} slcfun, *Slcfun; - -#ifdef DIAGNOSTICS -/* - * Diagnostics capabilities - */ -#define TD_REPORT 0x01 /* Report operations to client */ -#define TD_EXERCISE 0x02 /* Exercise client's implementation */ -#define TD_NETDATA 0x04 /* Display received data stream */ -#define TD_PTYDATA 0x08 /* Display data passed to pty */ -#define TD_OPTIONS 0x10 /* Report just telnet options */ -#endif /* DIAGNOSTICS */ - -/* - * We keep track of each side of the option negotiation. - */ - -#define MY_STATE_WILL 0x01 -#define MY_WANT_STATE_WILL 0x02 -#define MY_STATE_DO 0x04 -#define MY_WANT_STATE_DO 0x08 - -/* - * Macros to check the current state of things - */ - -#define my_state_is_do(opt) (options[opt]&MY_STATE_DO) -#define my_state_is_will(opt) (options[opt]&MY_STATE_WILL) -#define my_want_state_is_do(opt) (options[opt]&MY_WANT_STATE_DO) -#define my_want_state_is_will(opt) (options[opt]&MY_WANT_STATE_WILL) - -#define my_state_is_dont(opt) (!my_state_is_do(opt)) -#define my_state_is_wont(opt) (!my_state_is_will(opt)) -#define my_want_state_is_dont(opt) (!my_want_state_is_do(opt)) -#define my_want_state_is_wont(opt) (!my_want_state_is_will(opt)) - -#define set_my_state_do(opt) (options[opt] |= MY_STATE_DO) -#define set_my_state_will(opt) (options[opt] |= MY_STATE_WILL) -#define set_my_want_state_do(opt) (options[opt] |= MY_WANT_STATE_DO) -#define set_my_want_state_will(opt) (options[opt] |= MY_WANT_STATE_WILL) - -#define set_my_state_dont(opt) (options[opt] &= ~MY_STATE_DO) -#define set_my_state_wont(opt) (options[opt] &= ~MY_STATE_WILL) -#define set_my_want_state_dont(opt) (options[opt] &= ~MY_WANT_STATE_DO) -#define set_my_want_state_wont(opt) (options[opt] &= ~MY_WANT_STATE_WILL) - -/* - * Tricky code here. What we want to know is if the MY_STATE_WILL - * and MY_WANT_STATE_WILL bits have the same value. Since the two - * bits are adjacent, a little arithmatic will show that by adding - * in the lower bit, the upper bit will be set if the two bits were - * different, and clear if they were the same. - */ -#define my_will_wont_is_changing(opt) \ - ((options[opt]+MY_STATE_WILL) & MY_WANT_STATE_WILL) - -#define my_do_dont_is_changing(opt) \ - ((options[opt]+MY_STATE_DO) & MY_WANT_STATE_DO) - -/* - * Make everything symetrical - */ - -#define HIS_STATE_WILL MY_STATE_DO -#define HIS_WANT_STATE_WILL MY_WANT_STATE_DO -#define HIS_STATE_DO MY_STATE_WILL -#define HIS_WANT_STATE_DO MY_WANT_STATE_WILL - -#define his_state_is_do my_state_is_will -#define his_state_is_will my_state_is_do -#define his_want_state_is_do my_want_state_is_will -#define his_want_state_is_will my_want_state_is_do - -#define his_state_is_dont my_state_is_wont -#define his_state_is_wont my_state_is_dont -#define his_want_state_is_dont my_want_state_is_wont -#define his_want_state_is_wont my_want_state_is_dont - -#define set_his_state_do set_my_state_will -#define set_his_state_will set_my_state_do -#define set_his_want_state_do set_my_want_state_will -#define set_his_want_state_will set_my_want_state_do - -#define set_his_state_dont set_my_state_wont -#define set_his_state_wont set_my_state_dont -#define set_his_want_state_dont set_my_want_state_wont -#define set_his_want_state_wont set_my_want_state_dont - -#define his_will_wont_is_changing my_do_dont_is_changing -#define his_do_dont_is_changing my_will_wont_is_changing diff --git a/contrib/telnet/telnetd/ext.h b/contrib/telnet/telnetd/ext.h deleted file mode 100644 index 795025d94838..000000000000 --- a/contrib/telnet/telnetd/ext.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * 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 - * 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. 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. - * - * @(#)ext.h 8.2 (Berkeley) 12/15/93 - * $FreeBSD$ - */ - -#ifndef EXTERN -#define EXTERN extern -#endif - -/* - * Telnet server variable declarations - */ -EXTERN char options[256]; -EXTERN char do_dont_resp[256]; -EXTERN char will_wont_resp[256]; -EXTERN int linemode; /* linemode on/off */ -#ifdef LINEMODE -EXTERN int uselinemode; /* what linemode to use (on/off) */ -EXTERN int editmode; /* edit modes in use */ -EXTERN int useeditmode; /* edit modes to use */ -EXTERN int alwayslinemode; /* command line option */ -EXTERN int lmodetype; /* Client support for linemode */ -#endif /* LINEMODE */ -EXTERN int flowmode; /* current flow control state */ -EXTERN int restartany; /* restart output on any character state */ -#ifdef DIAGNOSTICS -EXTERN int diagnostic; /* telnet diagnostic capabilities */ -#endif /* DIAGNOSTICS */ -#ifdef BFTPDAEMON -EXTERN int bftpd; /* behave as bftp daemon */ -#endif /* BFTPDAEMON */ -#ifdef AUTHENTICATION -EXTERN int auth_level; -#endif - -EXTERN slcfun slctab[NSLC + 1]; /* slc mapping table */ - -EXTERN char *terminaltype; - -/* - * I/O data buffers, pointers, and counters. - */ -EXTERN char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp; - -EXTERN char netibuf[BUFSIZ], *netip; - -EXTERN char netobuf[BUFSIZ], *nfrontp, *nbackp; -EXTERN char *neturg; /* one past last bye of urgent data */ - -EXTERN int pcc, ncc; - -EXTERN int pty, net; -EXTERN char line[32]; -EXTERN int SYNCHing; /* we are in TELNET SYNCH mode */ - -EXTERN void - _termstat(void), - add_slc(char, char, cc_t), - check_slc(void), - change_slc(char, char, cc_t), - cleanup(int), - clientstat(int, int, int), - copy_termbuf(char *, size_t), - deferslc(void), - defer_terminit(void), - do_opt_slc(unsigned char *, int), - doeof(void), - dooption(int), - dontoption(int), - edithost(char *, char *), - fatal(int, const char *), - fatalperror(int, const char *), - get_slc_defaults(void), - init_env(void), - init_termbuf(void), - interrupt(void), - localstat(void), - flowstat(void), - netclear(void), - netflush(void), -#ifdef DIAGNOSTICS - printoption(const char *, int), - printdata(const char *, char *, int), - printsub(char, unsigned char *, int), -#endif - process_slc(unsigned char, unsigned char, cc_t), - ptyflush(void), - putchr(int), - putf(char *, char *), - recv_ayt(void), - send_do(int, int), - send_dont(int, int), - send_slc(void), - send_status(void), - send_will(int, int), - send_wont(int, int), - sendbrk(void), - sendsusp(void), - set_termbuf(void), - start_login(char *, int, char *), - start_slc(int), -#ifdef AUTHENTICATION - start_slave(char *), -#else - start_slave(char *, int, char *), -#endif - suboption(void), - telrcv(void), - ttloop(void), - tty_binaryin(int), - tty_binaryout(int); - -EXTERN int - end_slc(unsigned char **), - getnpty(void), -#ifndef convex - getpty(int *), -#endif - login_tty(int), - spcset(int, cc_t *, cc_t **), - stilloob(int), - terminit(void), - termstat(void), - tty_flowmode(void), - tty_restartany(void), - tty_isbinaryin(void), - tty_isbinaryout(void), - tty_iscrnl(void), - tty_isecho(void), - tty_isediting(void), - tty_islitecho(void), - tty_isnewmap(void), - tty_israw(void), - tty_issofttab(void), - tty_istrapsig(void), - tty_linemode(void); - -EXTERN void - tty_rspeed(int), - tty_setecho(int), - tty_setedit(int), - tty_setlinemode(int), - tty_setlitecho(int), - tty_setsig(int), - tty_setsofttab(int), - tty_tspeed(int), - willoption(int), - wontoption(int); - -int output_data(const char *, ...) __printflike(1, 2); -void output_datalen(const char *, int); -void startslave(char *, int, char *); - -#ifdef ENCRYPTION -extern void (*encrypt_output)(unsigned char *, int); -extern int (*decrypt_input)(int); -EXTERN char *nclearto; -#endif /* ENCRYPTION */ - - -/* - * The following are some clocks used to decide how to interpret - * the relationship between various variables. - */ - -EXTERN struct { - int - system, /* what the current time is */ - echotoggle, /* last time user entered echo character */ - modenegotiated, /* last time operating mode negotiated */ - didnetreceive, /* last time we read data from network */ - 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 */ -} clocks; - -#ifndef DEFAULT_IM -# ifdef ultrix -# define DEFAULT_IM "\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r" -# else -# ifdef __FreeBSD__ -# define DEFAULT_IM "\r\n\r\nFreeBSD (%h) (%t)\r\n\r\r\n\r" -# else -# define DEFAULT_IM "\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r" -# endif -# endif -#endif diff --git a/contrib/telnet/telnetd/global.c b/contrib/telnet/telnetd/global.c deleted file mode 100644 index 5a6fd0db780a..000000000000 --- a/contrib/telnet/telnetd/global.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * 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. 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 0 -#ifndef lint -static const char sccsid[] = "@(#)global.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ -#endif -#include -__FBSDID("$FreeBSD$"); - -/* - * Allocate global variables. We do this - * by including the header file that defines - * them all as externs, but first we define - * the keyword "extern" to be nothing, so that - * we will actually allocate the space. - */ - -#include "defs.h" -#define EXTERN -#include "ext.h" diff --git a/contrib/telnet/telnetd/pathnames.h b/contrib/telnet/telnetd/pathnames.h deleted file mode 100644 index 39f21405e234..000000000000 --- a/contrib/telnet/telnetd/pathnames.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 - * 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. 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. - * - * @(#)pathnames.h 8.1 (Berkeley) 6/4/93 - * $FreeBSD$ - */ - -#if BSD > 43 - -# include - -# ifndef _PATH_LOGIN -# define _PATH_LOGIN "/usr/bin/login" -# endif - -#else - -# define _PATH_TTY "/dev/tty" -# ifndef _PATH_LOGIN -# define _PATH_LOGIN "/bin/login" -# endif - -#endif - -#ifdef BFTPDAEMON -#define BFTPPATH "/usr/ucb/bftp" -#endif /* BFTPDAEMON */ diff --git a/contrib/telnet/telnetd/slc.c b/contrib/telnet/telnetd/slc.c deleted file mode 100644 index cc0bfbe785d7..000000000000 --- a/contrib/telnet/telnetd/slc.c +++ /dev/null @@ -1,480 +0,0 @@ -/* - * 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 - * 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. 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 0 -#ifndef lint -static const char sccsid[] = "@(#)slc.c 8.2 (Berkeley) 5/30/95"; -#endif -#endif -#include -__FBSDID("$FreeBSD$"); - -#include "telnetd.h" - -#ifdef LINEMODE -/* - * local variables - */ -static unsigned char *def_slcbuf = (unsigned char *)0; -static int def_slclen = 0; -static int slcchange; /* change to slc is requested */ -static unsigned char *slcptr; /* pointer into slc buffer */ -static unsigned char slcbuf[NSLC*6]; /* buffer for slc negotiation */ - -/* - * send_slc - * - * Write out the current special characters to the client. - */ -void -send_slc(void) -{ - int i; - - /* - * Send out list of triplets of special characters - * to client. We only send info on the characters - * that are currently supported. - */ - for (i = 1; i <= NSLC; i++) { - if ((slctab[i].defset.flag & SLC_LEVELBITS) == SLC_NOSUPPORT) - continue; - add_slc((unsigned char)i, slctab[i].current.flag, - slctab[i].current.val); - } - -} /* end of send_slc */ - -/* - * default_slc - * - * Set pty special characters to all the defaults. - */ -static void -default_slc(void) -{ - int i; - - for (i = 1; i <= NSLC; i++) { - slctab[i].current.val = slctab[i].defset.val; - if (slctab[i].current.val == (cc_t)(_POSIX_VDISABLE)) - slctab[i].current.flag = SLC_NOSUPPORT; - else - slctab[i].current.flag = slctab[i].defset.flag; - if (slctab[i].sptr) { - *(slctab[i].sptr) = slctab[i].defset.val; - } - } - slcchange = 1; - -} /* end of default_slc */ -#endif /* LINEMODE */ - -/* - * get_slc_defaults - * - * Initialize the slc mapping table. - */ -void -get_slc_defaults(void) -{ - int i; - - init_termbuf(); - - for (i = 1; i <= NSLC; i++) { - slctab[i].defset.flag = - spcset(i, &slctab[i].defset.val, &slctab[i].sptr); - slctab[i].current.flag = SLC_NOSUPPORT; - slctab[i].current.val = 0; - } - -} /* end of get_slc_defaults */ - -#ifdef LINEMODE -/* - * add_slc - * - * Add an slc triplet to the slc buffer. - */ -void -add_slc(char func, char flag, cc_t val) -{ - - if ((*slcptr++ = (unsigned char)func) == 0xff) - *slcptr++ = 0xff; - - if ((*slcptr++ = (unsigned char)flag) == 0xff) - *slcptr++ = 0xff; - - if ((*slcptr++ = (unsigned char)val) == 0xff) - *slcptr++ = 0xff; - -} /* end of add_slc */ - -/* - * start_slc - * - * Get ready to process incoming slc's and respond to them. - * - * The parameter getit is non-zero if it is necessary to grab a copy - * of the terminal control structures. - */ -void -start_slc(int getit) -{ - - slcchange = 0; - if (getit) - init_termbuf(); - (void) sprintf((char *)slcbuf, "%c%c%c%c", - IAC, SB, TELOPT_LINEMODE, LM_SLC); - slcptr = slcbuf + 4; - -} /* end of start_slc */ - -/* - * end_slc - * - * Finish up the slc negotiation. If something to send, then send it. - */ -int -end_slc(unsigned char **bufp) -{ - int len; - - /* - * If a change has occured, store the new terminal control - * structures back to the terminal driver. - */ - if (slcchange) { - set_termbuf(); - } - - /* - * If the pty state has not yet been fully processed and there is a - * deferred slc request from the client, then do not send any - * sort of slc negotiation now. We will respond to the client's - * request very soon. - */ - if (def_slcbuf && (terminit() == 0)) { - return(0); - } - - if (slcptr > (slcbuf + 4)) { - if (bufp) { - *bufp = &slcbuf[4]; - return(slcptr - slcbuf - 4); - } else { - (void) sprintf((char *)slcptr, "%c%c", IAC, SE); - slcptr += 2; - len = slcptr - slcbuf; - output_datalen(slcbuf, len); - netflush(); /* force it out immediately */ - DIAG(TD_OPTIONS, printsub('>', slcbuf+2, len-2);); - } - } - return (0); - -} /* end of end_slc */ - -/* - * process_slc - * - * Figure out what to do about the client's slc - */ -void -process_slc(unsigned char func, unsigned char flag, cc_t val) -{ - int hislevel, mylevel, ack; - - /* - * Ensure that we know something about this function - */ - if (func > NSLC) { - add_slc(func, SLC_NOSUPPORT, 0); - return; - } - - /* - * Process the special case requests of 0 SLC_DEFAULT 0 - * and 0 SLC_VARIABLE 0. Be a little forgiving here, don't - * worry about whether the value is actually 0 or not. - */ - if (func == 0) { - if ((flag = flag & SLC_LEVELBITS) == SLC_DEFAULT) { - default_slc(); - send_slc(); - } else if (flag == SLC_VARIABLE) { - send_slc(); - } - return; - } - - /* - * Appears to be a function that we know something about. So - * get on with it and see what we know. - */ - - hislevel = flag & SLC_LEVELBITS; - mylevel = slctab[func].current.flag & SLC_LEVELBITS; - ack = flag & SLC_ACK; - /* - * ignore the command if: - * the function value and level are the same as what we already have; - * or the level is the same and the ack bit is set - */ - if (hislevel == mylevel && (val == slctab[func].current.val || ack)) { - return; - } else if (ack) { - /* - * If we get here, we got an ack, but the levels don't match. - * This shouldn't happen. If it does, it is probably because - * we have sent two requests to set a variable without getting - * a response between them, and this is the first response. - * So, ignore it, and wait for the next response. - */ - return; - } else { *** 6775 LINES SKIPPED ***