From f597ddb137c3c3b76fe39095d7fb1fd2045c181e Mon Sep 17 00:00:00 2001 From: mycroft Date: Mon, 30 Aug 1993 18:50:53 +0000 Subject: [PATCH] Add new uname() cookies like getty. (I had thought telnetd spawned a getty. Sigh.) --- libexec/telnetd/defs.h | 3 ++- libexec/telnetd/ext.h | 4 ++-- libexec/telnetd/utility.c | 19 ++++++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/libexec/telnetd/defs.h b/libexec/telnetd/defs.h index cf0483750878..7ae1ec822cc5 100644 --- a/libexec/telnetd/defs.h +++ b/libexec/telnetd/defs.h @@ -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 #include + #ifndef BSD # define BSD 43 #endif diff --git a/libexec/telnetd/ext.h b/libexec/telnetd/ext.h index 11f9c21b567c..7188d65c1e31 100644 --- a/libexec/telnetd/ext.h +++ b/libexec/telnetd/ext.h @@ -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. diff --git a/libexec/telnetd/utility.c b/libexec/telnetd/utility.c index c3777bf9c4f7..1bd4df24c399 100644 --- a/libexec/telnetd/utility.c +++ b/libexec/telnetd/utility.c @@ -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 #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++; }