svn commit: r359404 - head/contrib/telnet/telnetd
Kyle Evans
kevans at FreeBSD.org
Sat Mar 28 19:43:58 UTC 2020
Author: kevans
Date: Sat Mar 28 19:43:45 2020
New Revision: 359404
URL: https://svnweb.freebsd.org/changeset/base/359404
Log:
Re-apply r359399: telnet -fno-common fix
line and auth_level's redefinitions are just extraneous
telnetd will #define extern and then include ext.h to allocate storage for
all of these extern'd vars; however, two of them are actually defined in
libtelnet instead. Instead of doing an #ifdef extern dance around those
function pointers, just add an EXTERN macro to make it easier to
differentiate by sight which ones will get allocated in globals.c and which
ones are defined elsewhere.
MFC after: 3 days
Modified:
head/contrib/telnet/telnetd/ext.h
head/contrib/telnet/telnetd/global.c
head/contrib/telnet/telnetd/state.c
head/contrib/telnet/telnetd/sys_term.c
head/contrib/telnet/telnetd/telnetd.c
Modified: head/contrib/telnet/telnetd/ext.h
==============================================================================
--- head/contrib/telnet/telnetd/ext.h Sat Mar 28 17:57:36 2020 (r359403)
+++ head/contrib/telnet/telnetd/ext.h Sat Mar 28 19:43:45 2020 (r359404)
@@ -30,53 +30,57 @@
* $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 */
+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 */
+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 */
+EXTERN int flowmode; /* current flow control state */
+EXTERN int restartany; /* restart output on any character state */
#ifdef DIAGNOSTICS
-extern int diagnostic; /* telnet diagnostic capabilities */
+EXTERN int diagnostic; /* telnet diagnostic capabilities */
#endif /* DIAGNOSTICS */
#ifdef BFTPDAEMON
-extern int bftpd; /* behave as bftp daemon */
+EXTERN int bftpd; /* behave as bftp daemon */
#endif /* BFTPDAEMON */
#ifdef AUTHENTICATION
-extern int auth_level;
+EXTERN int auth_level;
#endif
-extern slcfun slctab[NSLC + 1]; /* slc mapping table */
+EXTERN slcfun slctab[NSLC + 1]; /* slc mapping table */
-char *terminaltype;
+EXTERN char *terminaltype;
/*
* I/O data buffers, pointers, and counters.
*/
-extern char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
+EXTERN char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
-extern char netibuf[BUFSIZ], *netip;
+EXTERN char netibuf[BUFSIZ], *netip;
-extern char netobuf[BUFSIZ], *nfrontp, *nbackp;
-extern char *neturg; /* one past last bye of urgent data */
+EXTERN char netobuf[BUFSIZ], *nfrontp, *nbackp;
+EXTERN char *neturg; /* one past last bye of urgent data */
-extern int pcc, ncc;
+EXTERN int pcc, ncc;
-extern int pty, net;
-extern char line[32];
-extern int SYNCHing; /* we are in TELNET SYNCH mode */
+EXTERN int pty, net;
+EXTERN char line[32];
+EXTERN int SYNCHing; /* we are in TELNET SYNCH mode */
-extern void
+EXTERN void
_termstat(void),
add_slc(char, char, cc_t),
check_slc(void),
@@ -133,7 +137,7 @@ extern void
tty_binaryin(int),
tty_binaryout(int);
-extern int
+EXTERN int
end_slc(unsigned char **),
getnpty(void),
#ifndef convex
@@ -158,7 +162,7 @@ extern int
tty_istrapsig(void),
tty_linemode(void);
-extern void
+EXTERN void
tty_rspeed(int),
tty_setecho(int),
tty_setedit(int),
@@ -177,7 +181,7 @@ void startslave(char *, int, char *);
#ifdef ENCRYPTION
extern void (*encrypt_output)(unsigned char *, int);
extern int (*decrypt_input)(int);
-extern char *nclearto;
+EXTERN char *nclearto;
#endif /* ENCRYPTION */
@@ -186,7 +190,7 @@ extern char *nclearto;
* the relationship between various variables.
*/
-extern struct {
+EXTERN struct {
int
system, /* what the current time is */
echotoggle, /* last time user entered echo character */
Modified: head/contrib/telnet/telnetd/global.c
==============================================================================
--- head/contrib/telnet/telnetd/global.c Sat Mar 28 17:57:36 2020 (r359403)
+++ head/contrib/telnet/telnetd/global.c Sat Mar 28 19:43:45 2020 (r359404)
@@ -44,5 +44,5 @@ __FBSDID("$FreeBSD$");
*/
#include "defs.h"
-#define extern
+#define EXTERN
#include "ext.h"
Modified: head/contrib/telnet/telnetd/state.c
==============================================================================
--- head/contrib/telnet/telnetd/state.c Sat Mar 28 17:57:36 2020 (r359403)
+++ head/contrib/telnet/telnetd/state.c Sat Mar 28 19:43:45 2020 (r359404)
@@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$");
#include <libtelnet/encrypt.h>
#endif
+char *terminaltype;
+
unsigned char doopt[] = { IAC, DO, '%', 'c', 0 };
unsigned char dont[] = { IAC, DONT, '%', 'c', 0 };
unsigned char will[] = { IAC, WILL, '%', 'c', 0 };
Modified: head/contrib/telnet/telnetd/sys_term.c
==============================================================================
--- head/contrib/telnet/telnetd/sys_term.c Sat Mar 28 17:57:36 2020 (r359403)
+++ head/contrib/telnet/telnetd/sys_term.c Sat Mar 28 19:43:45 2020 (r359404)
@@ -376,8 +376,6 @@ spcset(int func, cc_t *valp, cc_t **valpp)
*
* Returns the file descriptor of the opened pty.
*/
-char line[32];
-
int
getpty(int *ptynum __unused)
{
Modified: head/contrib/telnet/telnetd/telnetd.c
==============================================================================
--- head/contrib/telnet/telnetd/telnetd.c Sat Mar 28 17:57:36 2020 (r359403)
+++ head/contrib/telnet/telnetd/telnetd.c Sat Mar 28 19:43:45 2020 (r359404)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#ifdef AUTHENTICATION
#include <libtelnet/auth.h>
-int auth_level = 0;
#endif
#ifdef ENCRYPTION
#include <libtelnet/encrypt.h>
More information about the svn-src-head
mailing list