From 4ff208c032dc785d4a04f7b3e46bfc6e35477027 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 27 May 1998 19:33:00 +0000 Subject: [PATCH] sys_term.c: #include utmp.h if present, and use _PATH_WTMP and _PATH_UTMP if defined to determine location of the wtmp and utmp files. configure.in: Add check for utmp.h git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10592 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/telnetd/ChangeLog | 8 ++++++++ src/appl/telnet/telnetd/configure.in | 2 +- src/appl/telnet/telnetd/sys_term.c | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index f71de74f1..84c1fe77f 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,11 @@ +1998-05-26 Theodore Ts'o + + * sys_term.c: #include utmp.h if present, and use _PATH_WTMP and + _PATH_UTMP if defined to determine location of the wtmp + and utmp files. + + * configure.in: Add check for utmp.h + 1998-05-06 Theodore Ts'o * telnetd.c (main): diff --git a/src/appl/telnet/telnetd/configure.in b/src/appl/telnet/telnetd/configure.in index 177b119de..26631b0f6 100644 --- a/src/appl/telnet/telnetd/configure.in +++ b/src/appl/telnet/telnetd/configure.in @@ -21,7 +21,7 @@ if test -z "$ac_sysv_termio"; then fi fi AC_HEADER_TIME -AC_CHECK_HEADERS(string.h arpa/nameser.h sys/time.h sys/tty.h sac.h sys/ptyvar.h sys/filio.h sys/stream.h) +AC_CHECK_HEADERS(string.h arpa/nameser.h utmp.h sys/time.h sys/tty.h sac.h sys/ptyvar.h sys/filio.h sys/stream.h) AC_CHECK_FUNCS(gettosbyname) dnl Make our operating system-specific security checks and definitions for dnl login. diff --git a/src/appl/telnet/telnetd/sys_term.c b/src/appl/telnet/telnetd/sys_term.c index 282608f8d..d989f6fff 100644 --- a/src/appl/telnet/telnetd/sys_term.c +++ b/src/appl/telnet/telnetd/sys_term.c @@ -57,9 +57,22 @@ char *login_program = LOGIN_PROGRAM; int utmp_len = MAXHOSTNAMELEN; /* sizeof(init_request.host) */ #else /* NEWINIT*/ +#ifdef HAVE_UTMP_H +#include +#endif + +#ifdef _PATH_WTMP +char wtmpf[] = _PATH_WTMP; +#else char wtmpf[] = "/usr/adm/wtmp"; -char utmpf[] = "/etc/utmp"; +#endif +#ifdef _PATH_UTMP +char utmpf[] = _PATH_UTMP; +#else +char utmpf[] = "/etc/utmp"; +#endif + # ifdef CRAY #include #include -- 2.26.2