summaryrefslogtreecommitdiffstats
path: root/src/appl
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1998-11-16 18:04:33 +0000
committerTheodore Tso <tytso@mit.edu>1998-11-16 18:04:33 +0000
commit0c1af467e0b1bd213428d2e45d7e3048ed28cbae (patch)
tree956e3e34015b145f3afe0531175101f40342e790 /src/appl
parent530c5da1d759dd96c2e69e0fc7e7ed34685828fa (diff)
downloadkrb5-0c1af467e0b1bd213428d2e45d7e3048ed28cbae.tar.gz
krb5-0c1af467e0b1bd213428d2e45d7e3048ed28cbae.tar.xz
krb5-0c1af467e0b1bd213428d2e45d7e3048ed28cbae.zip
configure.in: Add check for <sys/utsname.h>
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
Diffstat (limited to 'src/appl')
-rw-r--r--src/appl/telnet/telnetd/ChangeLog7
-rw-r--r--src/appl/telnet/telnetd/configure.in2
-rw-r--r--src/appl/telnet/telnetd/utility.c27
3 files changed, 35 insertions, 1 deletions
diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog
index 2ac0776cf0..daa0693a8b 100644
--- a/src/appl/telnet/telnetd/ChangeLog
+++ b/src/appl/telnet/telnetd/ChangeLog
@@ -1,3 +1,10 @@
+1998-11-14 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * configure.in: Add check for <sys/utsname.h>.
+
+ * utility.c (putf): Add support for %s, %m, %r, %v using
+ information from the uname() system call.
+
1998-11-13 Theodore Ts'o <tytso@rsts-11.mit.edu>
* 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 26631b0f6c..8a57d84eb8 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 8f888bc023..408c6f4adf 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 <sys/utsname.h>
+#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;