From 54472d02d278d63b29ee0bcecb4073d6cc578e36 Mon Sep 17 00:00:00 2001 From: David Nugent Date: Sun, 2 Feb 1997 07:33:50 +0000 Subject: [PATCH] Added support for %s (sysname) %m (machine) %r (release) and %v (version) prompt macros to agree with getty(8). --- libexec/telnetd/utility.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/libexec/telnetd/utility.c b/libexec/telnetd/utility.c index 8a1b6d95d2c2..3bead277320a 100644 --- a/libexec/telnetd/utility.c +++ b/libexec/telnetd/utility.c @@ -39,6 +39,7 @@ static char sccsid[] = "@(#)utility.c 8.2 (Berkeley) 12/15/93"; #ifdef __FreeBSD__ #include +#include #endif #define PRINTOPTIONS #include "telnetd.h" @@ -429,6 +430,12 @@ putf(cp, where) #else extern char *rindex(); #endif +#ifdef __FreeBSD__ + static struct utsname kerninfo; + + if (!*kerninfo.sysname) + uname(&kerninfo); +#endif putlocation = where; @@ -465,6 +472,24 @@ putf(cp, where) putstr(db); break; +#ifdef __FreeBSD__ + case 's': + putstr(kerninfo.sysname); + break; + + case 'm': + putstr(kerninfo.machine); + break; + + case 'r': + putstr(kerninfo.release); + break; + + case 'v': + putstr(kerninfo.version); + break; +#endif + case '%': putchr('%'); break;