summaryrefslogtreecommitdiffstats
path: root/eBones/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'eBones/libexec')
-rw-r--r--eBones/libexec/telnetd/authenc.c2
-rw-r--r--eBones/libexec/telnetd/global.c2
-rw-r--r--eBones/libexec/telnetd/slc.c40
-rw-r--r--eBones/libexec/telnetd/state.c5
-rw-r--r--eBones/libexec/telnetd/sys_term.c15
-rw-r--r--eBones/libexec/telnetd/telnetd.c21
-rw-r--r--eBones/libexec/telnetd/termstat.c8
-rw-r--r--eBones/libexec/telnetd/utility.c14
8 files changed, 66 insertions, 41 deletions
diff --git a/eBones/libexec/telnetd/authenc.c b/eBones/libexec/telnetd/authenc.c
index ccb463c..bff80a2 100644
--- a/eBones/libexec/telnetd/authenc.c
+++ b/eBones/libexec/telnetd/authenc.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)authenc.c 8.2 (Berkeley) 5/30/95";
+static const char sccsid[] = "@(#)authenc.c 8.2 (Berkeley) 5/30/95";
#endif /* not lint */
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
diff --git a/eBones/libexec/telnetd/global.c b/eBones/libexec/telnetd/global.c
index af21acc..0699d00 100644
--- a/eBones/libexec/telnetd/global.c
+++ b/eBones/libexec/telnetd/global.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)global.c 8.1 (Berkeley) 6/4/93";
+static const char sccsid[] = "@(#)global.c 8.1 (Berkeley) 6/4/93";
#endif /* not lint */
/*
diff --git a/eBones/libexec/telnetd/slc.c b/eBones/libexec/telnetd/slc.c
index 6cbb7ab..9579d0d 100644
--- a/eBones/libexec/telnetd/slc.c
+++ b/eBones/libexec/telnetd/slc.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)slc.c 8.2 (Berkeley) 5/30/95";
+static const char sccsid[] = "@(#)slc.c 8.2 (Berkeley) 5/30/95";
#endif /* not lint */
#include "telnetd.h"
@@ -288,15 +288,15 @@ change_slc(func, flag, val)
register int hislevel, mylevel;
hislevel = flag & SLC_LEVELBITS;
- mylevel = slctab[func].defset.flag & SLC_LEVELBITS;
+ mylevel = slctab[(int)func].defset.flag & SLC_LEVELBITS;
/*
* If client is setting a function to NOSUPPORT
* or DEFAULT, then we can easily and directly
* accomodate the request.
*/
if (hislevel == SLC_NOSUPPORT) {
- slctab[func].current.flag = flag;
- slctab[func].current.val = (cc_t)_POSIX_VDISABLE;
+ slctab[(int)func].current.flag = flag;
+ slctab[(int)func].current.val = (cc_t)_POSIX_VDISABLE;
flag |= SLC_ACK;
add_slc(func, flag, val);
return;
@@ -309,13 +309,13 @@ change_slc(func, flag, val)
* default level of DEFAULT.
*/
if (mylevel == SLC_DEFAULT) {
- slctab[func].current.flag = SLC_NOSUPPORT;
+ slctab[(int)func].current.flag = SLC_NOSUPPORT;
} else {
- slctab[func].current.flag = slctab[func].defset.flag;
+ slctab[(int)func].current.flag = slctab[(int)func].defset.flag;
}
- slctab[func].current.val = slctab[func].defset.val;
- add_slc(func, slctab[func].current.flag,
- slctab[func].current.val);
+ slctab[(int)func].current.val = slctab[(int)func].defset.val;
+ add_slc(func, slctab[(int)func].current.flag,
+ slctab[(int)func].current.val);
return;
}
@@ -329,13 +329,13 @@ change_slc(func, flag, val)
* the place to put the new value, so change it,
* otherwise, continue the negotiation.
*/
- if (slctab[func].sptr) {
+ if (slctab[(int)func].sptr) {
/*
* We can change this one.
*/
- slctab[func].current.val = val;
- *(slctab[func].sptr) = val;
- slctab[func].current.flag = flag;
+ slctab[(int)func].current.val = val;
+ *(slctab[(int)func].sptr) = val;
+ slctab[(int)func].current.flag = flag;
flag |= SLC_ACK;
slcchange = 1;
add_slc(func, flag, val);
@@ -355,22 +355,22 @@ change_slc(func, flag, val)
* our value as well.
*/
if (mylevel == SLC_DEFAULT) {
- slctab[func].current.flag = flag;
- slctab[func].current.val = val;
+ slctab[(int)func].current.flag = flag;
+ slctab[(int)func].current.val = val;
flag |= SLC_ACK;
} else if (hislevel == SLC_CANTCHANGE &&
mylevel == SLC_CANTCHANGE) {
flag &= ~SLC_LEVELBITS;
flag |= SLC_NOSUPPORT;
- slctab[func].current.flag = flag;
+ slctab[(int)func].current.flag = flag;
} else {
flag &= ~SLC_LEVELBITS;
flag |= mylevel;
- slctab[func].current.flag = flag;
+ slctab[(int)func].current.flag = flag;
if (mylevel == SLC_CANTCHANGE) {
- slctab[func].current.val =
- slctab[func].defset.val;
- val = slctab[func].current.val;
+ slctab[(int)func].current.val =
+ slctab[(int)func].defset.val;
+ val = slctab[(int)func].current.val;
}
}
add_slc(func, flag, val);
diff --git a/eBones/libexec/telnetd/state.c b/eBones/libexec/telnetd/state.c
index 4ee8bea..faf4088 100644
--- a/eBones/libexec/telnetd/state.c
+++ b/eBones/libexec/telnetd/state.c
@@ -32,13 +32,16 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)state.c 8.5 (Berkeley) 5/30/95";
+static const char sccsid[] = "@(#)state.c 8.5 (Berkeley) 5/30/95";
#endif /* not lint */
#include "telnetd.h"
#if defined(AUTHENTICATION)
#include <libtelnet/auth.h>
#endif
+#if defined(ENCRYPTION)
+#include <libtelnet/encrypt.h>
+#endif
unsigned char doopt[] = { IAC, DO, '%', 'c', 0 };
unsigned char dont[] = { IAC, DONT, '%', 'c', 0 };
diff --git a/eBones/libexec/telnetd/sys_term.c b/eBones/libexec/telnetd/sys_term.c
index cb8245f..5ebd2ad 100644
--- a/eBones/libexec/telnetd/sys_term.c
+++ b/eBones/libexec/telnetd/sys_term.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
+static const char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
#endif /* not lint */
#include "telnetd.h"
@@ -43,6 +43,8 @@ static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
#endif
extern char *altlogin;
+int cleanopen(char *line);
+void scrub_env(void);
#if defined(CRAY) || defined(__hpux)
# define PARENT_DOES_UTMP
@@ -75,6 +77,8 @@ char utmpf[] = "/etc/utmp";
char wtmpf[] = "/etc/wtmp";
# endif /* PARENT_DOES_UTMP */
+#include <libutil.h>
+
# ifdef CRAY
#include <tmpdir.h>
#include <sys/wait.h>
@@ -1074,7 +1078,7 @@ extern void utmp_sig_notify P((int));
* that is necessary. The return value is a file descriptor
* for the slave side.
*/
- int
+ void
getptyslave()
{
register int t = -1;
@@ -1397,7 +1401,6 @@ startslave(host, autologin, autoname)
{
register int i;
long time();
- char name[256];
#ifdef NEWINIT
extern char *ptyip;
struct init_request request;
@@ -1530,7 +1533,7 @@ init_env()
char **envp;
envp = envinit;
- if (*envp = getenv("TZ"))
+ if ((*envp = getenv("TZ")))
*envp++ -= 3;
#if defined(CRAY) || defined(__hpux)
else
@@ -1555,7 +1558,6 @@ start_login(host, autologin, name)
int autologin;
char *name;
{
- register char *cp;
register char **argv;
char **addarg(), *user;
extern char *getenv();
@@ -1742,7 +1744,7 @@ start_login(host, autologin, name)
# endif
} else
#endif
- if (user = getenv("USER")) {
+ if ((user = getenv("USER"))) {
if (strchr(user, '-')) {
syslog(LOG_ERR, "tried to pass user \"%s\" to login",
user);
@@ -1834,6 +1836,7 @@ addarg(argv, val)
* Remove a few things from the environment that
* don't need to be there.
*/
+ void
scrub_env()
{
register char **cpp, **cpp2;
diff --git a/eBones/libexec/telnetd/telnetd.c b/eBones/libexec/telnetd/telnetd.c
index 40fdad5..5785279 100644
--- a/eBones/libexec/telnetd/telnetd.c
+++ b/eBones/libexec/telnetd/telnetd.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
+static const char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
#endif /* not lint */
#include "telnetd.h"
@@ -75,6 +75,10 @@ struct socket_security ss;
#include <libtelnet/auth.h>
int auth_level = 0;
#endif
+#if defined(ENCRYPTION)
+#include <libtelnet/encrypt.h>
+#endif
+#include <libtelnet/misc.h>
#if defined(SecurID)
int require_SecurID = 0;
#endif
@@ -101,8 +105,6 @@ char ptyibuf2[BUFSIZ];
unsigned char ctlbuf[BUFSIZ];
struct strbuf strbufc, strbufd;
-int readstream();
-
#else /* ! STREAMPTY */
/*
@@ -112,6 +114,13 @@ int readstream();
char ptyibuf[BUFSIZ], *ptyip = ptyibuf;
char ptyibuf2[BUFSIZ];
+# include <termcap.h>
+
+int readstream(int p, char *ibuf, int bufsize);
+void doit(struct sockaddr_in *who);
+int terminaltypeok(char *s);
+void startslave(char *host, int autologin, char *autoname);
+
#endif /* ! STREAMPTY */
int hostinfo = 1; /* do we print login banner? */
@@ -390,7 +399,7 @@ main(argc, argv)
usage();
/* NOT REACHED */
} else if (argc == 1) {
- if (sp = getservbyname(*argv, "tcp")) {
+ if ((sp = getservbyname(*argv, "tcp"))) {
sin.sin_port = sp->s_port;
} else {
sin.sin_port = atoi(*argv);
@@ -792,11 +801,11 @@ char user_name[256];
/*
* Get a pty, scan input lines.
*/
+void
doit(who)
struct sockaddr_in *who;
{
char *host, *inet_ntoa();
- int t;
struct hostent *hp;
int ptynum;
diff --git a/eBones/libexec/telnetd/termstat.c b/eBones/libexec/telnetd/termstat.c
index f499137..551355d 100644
--- a/eBones/libexec/telnetd/termstat.c
+++ b/eBones/libexec/telnetd/termstat.c
@@ -32,11 +32,15 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)termstat.c 8.2 (Berkeley) 5/30/95";
+static const char sccsid[] = "@(#)termstat.c 8.2 (Berkeley) 5/30/95";
#endif /* not lint */
#include "telnetd.h"
+#if defined(ENCRYPTION)
+#include <libtelnet/encrypt.h>
+#endif
+
/*
* local variables
*/
@@ -488,7 +492,7 @@ clientstat(code, parm1, parm2)
ack = (useeditmode & MODE_ACK);
useeditmode &= ~MODE_ACK;
- if (changed = (useeditmode ^ editmode)) {
+ if ((changed = (useeditmode ^ editmode))) {
/*
* This check is for a timing problem. If the
* state of the tty has changed (due to the user
diff --git a/eBones/libexec/telnetd/utility.c b/eBones/libexec/telnetd/utility.c
index e2f285a..c8e34b8 100644
--- a/eBones/libexec/telnetd/utility.c
+++ b/eBones/libexec/telnetd/utility.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
+static const char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
#endif /* not lint */
#ifdef __FreeBSD__
@@ -41,6 +41,13 @@ static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
#define PRINTOPTIONS
#include "telnetd.h"
+#if defined(AUTHENTICATION)
+#include <libtelnet/auth.h>
+#endif
+#if defined(ENCRYPTION)
+#include <libtelnet/encrypt.h>
+#endif
+
/*
* utility functions performing io related tasks
*/
@@ -949,7 +956,6 @@ printsub(direction, pointer, length)
break;
default:
- def_case:
if (isprint(pointer[i]) && pointer[i] != '"') {
if (noquote) {
*nfrontp++ = '"';
@@ -1120,12 +1126,12 @@ printsub(direction, pointer, length)
break;
case ENCRYPT_ENC_KEYID:
- sprintf(nfrontp, " ENC_KEYID", pointer[1]);
+ sprintf(nfrontp, " ENC_KEYID");
nfrontp += strlen(nfrontp);
goto encommon;
case ENCRYPT_DEC_KEYID:
- sprintf(nfrontp, " DEC_KEYID", pointer[1]);
+ sprintf(nfrontp, " DEC_KEYID");
nfrontp += strlen(nfrontp);
goto encommon;
OpenPOWER on IntegriCloud