summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-10-10 15:14:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-10-10 15:14:56 +0000
commitef16d0a0f532446d30ea972a1c4d35e4c1caab5c (patch)
treef5515b58a0a59639e759f41e5018cfbf7c1e6a5f
parentbb7631942dcc6370156118c834fe56c8da632dff (diff)
Link with curses, not ocurses and use setupterm(). For now, telnet(1)
still needs ocurses but that will change.
-rw-r--r--libexec/telnetd/Makefile7
-rw-r--r--libexec/telnetd/telnetd.c20
2 files changed, 11 insertions, 16 deletions
diff --git a/libexec/telnetd/Makefile b/libexec/telnetd/Makefile
index 5eced15f9bb..c9eb0505568 100644
--- a/libexec/telnetd/Makefile
+++ b/libexec/telnetd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.8 2000/09/03 18:41:16 espie Exp $
+# $OpenBSD: Makefile,v 1.9 2000/10/10 15:14:54 millert Exp $
# from: @(#)Makefile 8.2 (Berkeley) 12/15/93
# $NetBSD: Makefile,v 1.6 1996/02/24 01:22:12 jtk Exp $
@@ -6,11 +6,10 @@ PROG= telnetd
CFLAGS+=-DLINEMODE -DKLUDGELINEMODE -DUSE_TERMIO -DDIAGNOSTICS
CFLAGS+=-DOLD_ENVIRON -DENV_HACK -I${.CURDIR} -Wall -Wno-unused
-CFLAGS+=-D_USE_OLD_CURSES_
SRCS= authenc.c global.c slc.c state.c sys_term.c telnetd.c \
termstat.c utility.c
-DPADD= ${LIBUTIL} ${LIBOLDCURSES} ${LIBTELNET}
-LDADD+= -lutil -locurses -ltelnet
+DPADD= ${LIBUTIL} ${LIBCURSES} ${LIBTELNET}
+LDADD+= -lutil -lcurses -ltelnet
MAN= telnetd.8
.include <bsd.own.mk> # for KERBEROS
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c
index cf8fbd00609..bc90a8442d7 100644
--- a/libexec/telnetd/telnetd.c
+++ b/libexec/telnetd/telnetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: telnetd.c,v 1.24 2000/10/06 10:55:00 hin Exp $ */
+/* $OpenBSD: telnetd.c,v 1.25 2000/10/10 15:14:55 millert Exp $ */
/* $NetBSD: telnetd.c,v 1.6 1996/03/20 04:25:57 tls Exp $ */
/*
@@ -45,11 +45,12 @@ 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.24 2000/10/06 10:55:00 hin Exp $";
+static char rcsid[] = "$OpenBSD: telnetd.c,v 1.25 2000/10/10 15:14:55 millert Exp $";
#endif
#endif /* not lint */
-#include "curses.h"
+#include <curses.h>
+#include <term.h>
#include "telnetd.h"
#include "pathnames.h"
@@ -763,21 +764,16 @@ _gettermname()
terminaltypeok(s)
char *s;
{
- char buf[1024];
if (terminaltype == NULL)
return(1);
/*
- * tgetent() will return 1 if the type is known, and
- * 0 if it is not known. If it returns -1, it couldn't
- * open the database. But if we can't open the database,
- * it won't help to say we failed, because we won't be
- * able to verify anything else. So, we treat -1 like 1.
+ * setupterm() will return OK if the type is known, and
+ * ERR if it is not known.
+ * We return 0 on success and 1 on failure.
*/
- if (tgetent(buf, s) == 0)
- return(0);
- return(1);
+ return(setupterm(s, STDOUT_FILENO, NULL) == ERR);
}
#ifndef MAXHOSTNAMELEN