mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-28 20:11:00 +01:00
Added support for %s (sysname) %m (machine) %r (release) and %v (version)
prompt macros to agree with getty(8).
This commit is contained in:
parent
bd62efe166
commit
5c0afad0d2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user