summaryrefslogtreecommitdiff
path: root/libexec/telnetd
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-14 01:40:40 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-14 01:40:40 +0000
commit7c55d0863dde7b422f67740ba162f9d07bd40984 (patch)
tree6d82d265f8f77e8fe52cad5f3d6124a912bbfc80 /libexec/telnetd
parent20e0128be14e1cf60321f9f8ee8c2af1cb68cb7a (diff)
-Wall
Diffstat (limited to 'libexec/telnetd')
-rw-r--r--libexec/telnetd/ext.h3
-rw-r--r--libexec/telnetd/sys_term.c20
-rw-r--r--libexec/telnetd/telnetd.c13
-rw-r--r--libexec/telnetd/utility.c5
4 files changed, 25 insertions, 16 deletions
diff --git a/libexec/telnetd/ext.h b/libexec/telnetd/ext.h
index 9ab99b556ef..4b352bb71ab 100644
--- a/libexec/telnetd/ext.h
+++ b/libexec/telnetd/ext.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext.h,v 1.2 1996/03/28 23:21:56 niklas Exp $ */
+/* $OpenBSD: ext.h,v 1.3 1997/07/14 01:40:38 millert Exp $ */
/* $NetBSD: ext.h,v 1.6 1996/02/28 20:38:13 thorpej Exp $ */
/*
@@ -153,6 +153,7 @@ extern void
extern int
end_slc P((unsigned char **)),
+ getent P((char *, char *)),
getnpty P((void)),
#ifndef convex
getpty P((int *)),
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c
index 8ac411d4839..8bf0ac93a8a 100644
--- a/libexec/telnetd/sys_term.c
+++ b/libexec/telnetd/sys_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_term.c,v 1.6 1997/02/16 05:59:43 deraadt Exp $ */
+/* $OpenBSD: sys_term.c,v 1.7 1997/07/14 01:40:38 millert Exp $ */
/* $NetBSD: sys_term.c,v 1.9 1996/03/20 04:25:53 tls Exp $ */
/*
@@ -39,13 +39,14 @@
static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: sys_term.c,v 1.8 1996/02/28 20:38:21 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: sys_term.c,v 1.6 1997/02/16 05:59:43 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: sys_term.c,v 1.7 1997/07/14 01:40:38 millert Exp $";
#endif
#endif /* not lint */
#include "telnetd.h"
#include "pathnames.h"
+#include <util.h>
#include <sys/cdefs.h>
#define P __P
@@ -182,6 +183,9 @@ int ttyfd = -1;
# endif
#endif /* USE_TERMIO */
+int cleanopen P((char *));
+void scrub_env P((void));
+
/*
* init_termbuf()
* copy_termbuf(cp)
@@ -1073,10 +1077,9 @@ extern void utmp_sig_notify P((int));
* getptyslave()
*
* Open the slave side of the pty, and do any initialization
- * that is necessary. The return value is a file descriptor
- * for the slave side.
+ * that is necessary.
*/
- int
+ void
getptyslave()
{
register int t = -1;
@@ -1394,7 +1397,6 @@ startslave(host, autologin, autoname)
char *autoname;
{
register int i;
- char name[256];
#ifdef NEWINIT
extern char *ptyip;
struct init_request request;
@@ -1552,7 +1554,6 @@ start_login(host, autologin, name)
int autologin;
char *name;
{
- register char *cp;
register char **argv;
char **addarg();
extern char *getenv();
@@ -1845,6 +1846,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;
@@ -2262,7 +2264,7 @@ rmut()
if (SCMPN(u->ut_line, line+5) ||
u->ut_name[0]==0)
continue;
- (void) lseek(f, ((long)u)-((long)utmp), L_SET);
+ (void) lseek(f, ((off_t)u)-((off_t)utmp), L_SET);
SCPYN(u->ut_name, "");
SCPYN(u->ut_host, "");
(void) time(&u->ut_time);
@@ -2306,7 +2308,7 @@ char *line;
/* write it out only if it exists */
if (utptr) {
utptr->ut_type = DEAD_PROCESS;
- utptr->ut_time = time((long *) 0);
+ utptr->ut_time = time((time_t *) 0);
(void) pututline(utptr);
/* set wtmp entry if wtmp file exists */
if ((fd = open(wtmpf, O_WRONLY | O_APPEND)) >= 0) {
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c
index d61084308a5..ef7d3d38b2b 100644
--- a/libexec/telnetd/telnetd.c
+++ b/libexec/telnetd/telnetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: telnetd.c,v 1.6 1997/01/15 23:41:05 millert Exp $ */
+/* $OpenBSD: telnetd.c,v 1.7 1997/07/14 01:40:39 millert Exp $ */
/* $NetBSD: telnetd.c,v 1.6 1996/03/20 04:25:57 tls Exp $ */
/*
@@ -45,16 +45,22 @@ static char copyright[] =
static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: telnetd.c,v 1.5 1996/02/28 20:38:23 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: telnetd.c,v 1.6 1997/01/15 23:41:05 millert Exp $";
+static char rcsid[] = "$OpenBSD: telnetd.c,v 1.7 1997/07/14 01:40:39 millert Exp $";
#endif
#endif /* not lint */
+#include <term.h>
#include "telnetd.h"
#include "pathnames.h"
#include <sys/cdefs.h>
#define P __P
+void doit P((struct sockaddr_in *));
+void startslave P((char *, int, char *));
+int terminaltypeok P((char *));
+
+
#if defined(_SC_CRAY_SECURE_SYS) && !defined(SCM_SECURITY)
/*
* UNICOS 6.0/6.1 do not have SCM_SECURITY defined, so we can
@@ -170,6 +176,7 @@ char valid_opts[] = {
'\0'
};
+ int
main(argc, argv)
char *argv[];
{
@@ -776,11 +783,11 @@ extern void telnet P((int, int, char *));
/*
* Get a pty, scan input lines.
*/
+ void
doit(who)
struct sockaddr_in *who;
{
char *host, *inet_ntoa();
- int t;
struct hostent *hp;
int level;
int ptynum;
diff --git a/libexec/telnetd/utility.c b/libexec/telnetd/utility.c
index aabe1adf824..4b1ff91e0bb 100644
--- a/libexec/telnetd/utility.c
+++ b/libexec/telnetd/utility.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utility.c,v 1.6 1996/12/23 13:10:10 robin Exp $ */
+/* $OpenBSD: utility.c,v 1.7 1997/07/14 01:40:39 millert Exp $ */
/* $NetBSD: utility.c,v 1.9 1996/02/28 20:38:29 thorpej Exp $ */
/*
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: utility.c,v 1.9 1996/02/28 20:38:29 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: utility.c,v 1.6 1996/12/23 13:10:10 robin Exp $";
+static char rcsid[] = "$OpenBSD: utility.c,v 1.7 1997/07/14 01:40:39 millert Exp $";
#endif
#endif /* not lint */
@@ -515,7 +515,6 @@ printsub(direction, pointer, length)
int length; /* length of suboption data */
{
register int i;
- char buf[512];
if (!(diagnostic & TD_OPTIONS))
return;