From: Theodore Tso Date: Mon, 16 Nov 1998 18:04:33 +0000 (+0000) Subject: configure.in: Add check for X-Git-Tag: krb5-1.1-beta1~476 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0c1af467e0b1bd213428d2e45d7e3048ed28cbae;p=krb5.git configure.in: Add check for utility.c (putf): Add support for %s, %m, %r, %v using information from the uname() system call. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11041 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index 2ac0776cf..daa0693a8 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,10 @@ +1998-11-14 Theodore Ts'o + + * configure.in: Add check for . + + * utility.c (putf): Add support for %s, %m, %r, %v using + information from the uname() system call. + 1998-11-13 Theodore Ts'o * Makefile.in: Set the myfulldir and mydir variables (which are diff --git a/src/appl/telnet/telnetd/configure.in b/src/appl/telnet/telnetd/configure.in index 26631b0f6..8a57d84eb 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 utmp.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 sys/utsname.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/utility.c b/src/appl/telnet/telnetd/utility.c index 8f888bc02..408c6f4ad 100644 --- a/src/appl/telnet/telnetd/utility.c +++ b/src/appl/telnet/telnetd/utility.c @@ -36,6 +36,10 @@ #define PRINTOPTIONS #include "telnetd.h" +#ifdef HAVE_SYS_UTSNAME_H +#include +#endif + /* * utility functions performing io related tasks */ @@ -450,6 +454,11 @@ putf(cp, where) char *slash; time_t t; char db[100]; +#ifdef HAVE_SYS_UTSNAME_H + struct utsname utsinfo; + + (void) uname(&utsinfo); +#endif putlocation = where; @@ -483,6 +492,24 @@ putf(cp, where) putstr(db); break; +#ifdef HAVE_SYS_UTSNAME_H + case 's': + putstr(utsinfo.sysname); + break; + + case 'm': + putstr(utsinfo.machine); + break; + + case 'r': + putstr(utsinfo.release); + break; + + case 'v': + putstr(utsinfo.version); + break; +#endif + case '%': putchr('%'); break;