From ea47af4c11fcb47fe9833b80f14e5e3316174eda Mon Sep 17 00:00:00 2001 From: joerg Date: Thu, 23 Apr 2020 00:03:40 +0000 Subject: [PATCH] Don't play #define games with extern, just have a separate list to avoid commons --- libexec/telnetd/ext.h | 4 ++-- libexec/telnetd/global.c | 51 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/libexec/telnetd/ext.h b/libexec/telnetd/ext.h index 6726aab7b261..c79fe28e7e1d 100644 --- a/libexec/telnetd/ext.h +++ b/libexec/telnetd/ext.h @@ -1,4 +1,4 @@ -/* $NetBSD: ext.h,v 1.22 2012/01/10 23:39:11 joerg Exp $ */ +/* $NetBSD: ext.h,v 1.23 2020/04/23 00:03:40 joerg Exp $ */ /* * Copyright (c) 1989, 1993 @@ -179,7 +179,7 @@ extern char *nclearto; * The following are some clocks used to decide how to interpret * the relationship between various variables. */ -extern struct { +extern struct clockstate { int system, /* what the current time is */ echotoggle, /* last time user entered echo character */ diff --git a/libexec/telnetd/global.c b/libexec/telnetd/global.c index 2b5ef2d4fd7a..89b97ec95156 100644 --- a/libexec/telnetd/global.c +++ b/libexec/telnetd/global.c @@ -1,4 +1,4 @@ -/* $NetBSD: global.c,v 1.8 2003/08/07 09:46:51 agc Exp $ */ +/* $NetBSD: global.c,v 1.9 2020/04/23 00:03:40 joerg Exp $ */ /* * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)global.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: global.c,v 1.8 2003/08/07 09:46:51 agc Exp $"); +__RCSID("$NetBSD: global.c,v 1.9 2020/04/23 00:03:40 joerg Exp $"); #endif #endif /* not lint */ @@ -47,5 +47,50 @@ __RCSID("$NetBSD: global.c,v 1.8 2003/08/07 09:46:51 agc Exp $"); */ #include -#define extern #include + +char options[256]; +char do_dont_resp[256]; +char will_wont_resp[256]; +int linemode; /* linemode on/off */ +#ifdef LINEMODE +int uselinemode; /* what linemode to use (on/off) */ +int editmode; /* edit modes in use */ +int useeditmode; /* edit modes to use */ +int alwayslinemode; /* command line option */ +# ifdef KLUDGELINEMODE +int lmodetype; /* Client support for linemode */ +# endif /* KLUDGELINEMODE */ +#endif /* LINEMODE */ +int flowmode; /* current flow control state */ +int restartany; /* restart output on any character state */ +#ifdef DIAGNOSTICS +int diagnostic; /* telnet diagnostic capabilities */ +#endif /* DIAGNOSTICS */ +#ifdef SECURELOGIN +int require_secure_login; +#endif +#ifdef AUTHENTICATION +int auth_level; +#endif + +slcfun slctab[NSLC + 1]; /* slc mapping table */ +char terminaltype[41]; + +/* + * I/O data buffers, pointers, and counters. + */ +char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp; +char netibuf[BUFSIZ], *netip; +char netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp; +char *neturg; /* one past last bye of urgent data */ +int pcc, ncc; +int pty, net; +char *line; +int SYNCHing; /* we are in TELNET SYNCH mode */ + +#ifdef ENCRYPTION +char *nclearto; +#endif /* ENCRYPTION */ + +struct clockstate clocks;