Add new uname() cookies like getty.
(I had thought telnetd spawned a getty. Sigh.)
This commit is contained in:
parent
5bce7d4176
commit
f597ddb137
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)defs.h 5.10 (Berkeley) 3/1/91
|
||||
* $Id: defs.h,v 1.2 1993/08/01 18:29:25 mycroft Exp $
|
||||
* $Id: defs.h,v 1.3 1993/08/30 18:50:53 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -40,6 +40,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
|
||||
#ifndef BSD
|
||||
# define BSD 43
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ext.h 5.7 (Berkeley) 3/1/91
|
||||
* $Id: ext.h,v 1.2 1993/08/01 18:29:23 mycroft Exp $
|
||||
* $Id: ext.h,v 1.3 1993/08/30 18:50:54 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -66,7 +66,7 @@ extern int auth_level;
|
|||
|
||||
extern slcfun slctab[NSLC + 1]; /* slc mapping table */
|
||||
|
||||
char *terminaltype;
|
||||
extern char *terminaltype;
|
||||
|
||||
/*
|
||||
* I/O data buffers, pointers, and counters.
|
||||
|
|
|
@ -33,10 +33,11 @@
|
|||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "from: @(#)utility.c 5.8 (Berkeley) 3/22/91";*/
|
||||
static char rcsid[] = "$Id: utility.c,v 1.2 1993/08/01 18:29:02 mycroft Exp $";
|
||||
static char rcsid[] = "$Id: utility.c,v 1.3 1993/08/30 18:50:55 mycroft Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#define PRINTOPTIONS
|
||||
#include <sys/utsname.h>
|
||||
#include "telnetd.h"
|
||||
|
||||
/*
|
||||
|
@ -374,6 +375,7 @@ fatalperror(f, msg)
|
|||
}
|
||||
|
||||
char editedhost[32];
|
||||
struct utsname kerninfo;
|
||||
|
||||
void
|
||||
edithost(pat, host)
|
||||
|
@ -383,6 +385,8 @@ edithost(pat, host)
|
|||
register char *res = editedhost;
|
||||
char *strncpy();
|
||||
|
||||
uname(&kerninfo);
|
||||
|
||||
if (!pat)
|
||||
pat = "";
|
||||
while (*pat) {
|
||||
|
@ -481,6 +485,19 @@ putf(cp, where)
|
|||
case '%':
|
||||
putchr('%');
|
||||
break;
|
||||
|
||||
case 's':
|
||||
puts(kerninfo.sysname);
|
||||
|
||||
case 'm':
|
||||
puts(kerninfo.machine);
|
||||
|
||||
case 'r':
|
||||
puts(kerninfo.release);
|
||||
|
||||
case 'v':
|
||||
puts(kerninfo.version);
|
||||
break;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue