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
+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
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.
#define PRINTOPTIONS
#include "telnetd.h"
+#ifdef HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+
/*
* utility functions performing io related tasks
*/
char *slash;
time_t t;
char db[100];
+#ifdef HAVE_SYS_UTSNAME_H
+ struct utsname utsinfo;
+
+ (void) uname(&utsinfo);
+#endif
putlocation = 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;