From d62b2c8fd06b1e3de1a928d7b205bea2ce2924a2 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 26 Feb 1996 08:36:47 +0000 Subject: [PATCH] Use MAXDNAME for the maximum length of a domain, *not* MAXHOSTNAMELEN, which is the maximum length of an argument to gethostname or sethostname. Look for arpa/nameser.h to find this constant, defining it to 256 inf not present in an included file. Call USE_ANAME in the configure.in, so db library is included. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7549 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/telnetd/ChangeLog | 12 ++++++++++++ src/appl/telnet/telnetd/configure.in | 3 ++- src/appl/telnet/telnetd/telnetd.c | 13 ++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index b0916a5ab..f15d82bad 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,15 @@ +Mon Feb 26 03:33:48 1996 Sam Hartman + + * configure.in: Call USE_ANAME + +Sun Feb 25 20:26:00 1996 Sam Hartman + + * telnetd.c: Use MAXDNAME not MAXHOSTNAMELEN; MAXHOSTNAMELEN is + only for gethostname() and sethostname() and has nothing to do + with domains. + + * configure.in : Check for arpa/nameser.h for MAXDNAME + Tue Feb 13 16:23:23 1996 Ezra Peisach * ext.h, utility.c (fatalperror, fatal): Add const to argument. diff --git a/src/appl/telnet/telnetd/configure.in b/src/appl/telnet/telnetd/configure.in index 73a5e6cf8..b579207ea 100644 --- a/src/appl/telnet/telnetd/configure.in +++ b/src/appl/telnet/telnetd/configure.in @@ -2,6 +2,7 @@ AC_INIT(telnetd.c) CONFIG_RULES AC_PROG_INSTALL AC_CHECK_LIB(util,main) +USE_ANAME AC_CHECK_LIB(termcap,main,AC_DEFINE(TERMCAP) LIBS="$LIBS -ltermcap") AC_HEADER_CHECK(termios.h,AC_DEFINE(USE_TERMIO) ac_termio=1) @@ -19,7 +20,7 @@ if test -z "$ac_sysv_termio"; then fi fi AC_HEADER_TIME -AC_CHECK_HEADERS(string.h) +AC_CHECK_HEADERS(string.h arpa/nameser.h) AC_CHECK_HEADERS(sys/time.h sys/tty.h) AC_HAVE_FUNCS(vhangup) AC_FUNC_CHECK(grantpt,AC_DEFINE(STREAMSPTY)) diff --git a/src/appl/telnet/telnetd/telnetd.c b/src/appl/telnet/telnetd/telnetd.c index b91343ebf..72716ab09 100644 --- a/src/appl/telnet/telnetd/telnetd.c +++ b/src/appl/telnet/telnetd/telnetd.c @@ -807,14 +807,17 @@ terminaltypeok(s) return(0); return(1); } +#if HAVE_ARPA_NAMESER_H +#include +#endif -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 64 -#endif /* MAXHOSTNAMELEN */ +#ifndef MAXDNAME +#define MAXDNAME 256 /*per the rfc*/ +#endif char *hostname; -char host_name[MAXHOSTNAMELEN]; -char remote_host_name[MAXHOSTNAMELEN]; +char host_name[MAXDNAME]; +char remote_host_name[MAXDNAME]; #ifndef convex extern void telnet P((int, int)); -- 2.26.2