diff options
author | davidn <davidn@FreeBSD.org> | 1997-02-02 07:33:50 +0000 |
---|---|---|
committer | davidn <davidn@FreeBSD.org> | 1997-02-02 07:33:50 +0000 |
commit | 5c0afad0d23f85e76dc71b2cc1bdf3e345b37a08 (patch) | |
tree | 140a5db89a964082a4e9ea4d959d624525cf5758 /libexec | |
parent | bd62efe166e88da257281ff4cf38609fad2bcdcb (diff) | |
download | FreeBSD-src-5c0afad0d23f85e76dc71b2cc1bdf3e345b37a08.zip FreeBSD-src-5c0afad0d23f85e76dc71b2cc1bdf3e345b37a08.tar.gz |
Added support for %s (sysname) %m (machine) %r (release) and %v (version)
prompt macros to agree with getty(8).
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/telnetd/utility.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libexec/telnetd/utility.c b/libexec/telnetd/utility.c index 8a1b6d9..3bead27 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 <locale.h> +#include <sys/utsname.h> #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; |