sys_term.c: #include utmp.h if present, and use _PATH_WTMP and
authorTheodore Tso <tytso@mit.edu>
Wed, 27 May 1998 19:33:00 +0000 (19:33 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 27 May 1998 19:33:00 +0000 (19:33 +0000)
_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
src/appl/telnet/telnetd/configure.in
src/appl/telnet/telnetd/sys_term.c

index f71de74f15a87c834ee28fabd14b2584f33c8cc5..84c1fe77f5d99b4275cdf769ed37901ca19470f8 100644 (file)
@@ -1,3 +1,11 @@
+1998-05-26  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * 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  <tytso@rsts-11.mit.edu>
 
        * telnetd.c (main): 
index 177b119de8e28a2d9b4c5fad1dd7c28bcff43bde..26631b0f6cda87b7a28baf7808d528506e44d683 100644 (file)
@@ -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.
index 282608f8d09e9c8af55e13417f4ec570dd2060fc..d989f6fff631eb65b2066dfbd26092e1c86c3d8f 100644 (file)
@@ -57,9 +57,22 @@ char *login_program = LOGIN_PROGRAM;
 int    utmp_len = MAXHOSTNAMELEN;      /* sizeof(init_request.host) */
 #else  /* NEWINIT*/
 
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#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 <tmpdir.h>
 #include <sys/wait.h>