git: d701f45aba19 - main - Remove telnetd sources
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 05 Oct 2022 16:29:40 UTC
The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=d701f45aba19f232ce7817085935f33dd609ed8b commit d701f45aba19f232ce7817085935f33dd609ed8b Author: Brooks Davis <brooks@FreeBSD.org> AuthorDate: 2022-10-05 16:26:30 +0000 Commit: Brooks Davis <brooks@FreeBSD.org> 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 <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#ifdef AUTHENTICATION -#ifdef ENCRYPTION -/* Above "#ifdef"s actually "or"'ed together. XXX MarkM - */ -#include "telnetd.h" -#include <libtelnet/misc.h> - -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 <sys/types.h> -#include <sys/param.h> - -#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 <sys/socket.h> -#include <sys/wait.h> -#include <fcntl.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <sys/time.h> -#ifndef FILIO_H -#include <sys/ioctl.h> -#else -#include <sys/filio.h> -#endif - -#include <netinet/in.h> - -#include <arpa/telnet.h> - -#include <stdio.h> -#ifdef __STDC__ -#include <stdlib.h> -#endif -#include <signal.h> -#include <errno.h> -#include <netdb.h> -#include <syslog.h> -#ifndef LOG_DAEMON -#define LOG_DAEMON 0 -#endif -#ifndef LOG_ODELAY -#define LOG_ODELAY 0 -#endif -#include <ctype.h> -#ifndef NO_STRING_H -#include <string.h> -#else -#include <strings.h> -#endif - -#ifndef USE_TERMIO -#include <sgtty.h> -#else -# ifdef SYSV_TERMIO -# include <termio.h> -# else -# include <termios.h> -# endif -#endif -#if !defined(USE_TERMIO) || defined(NO_CC_T) -typedef unsigned char cc_t; -#endif - -#ifdef __STDC__ -#include <unistd.h> -#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 <sys/cdefs.h> -__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 <paths.h> - -# 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 <sys/cdefs.h> -__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 ***