Skip Menu |
 

Download (untitled) / with headers
text/plain 2.9KiB
From ghudson@MIT.EDU Tue Jan 20 15:39:22 1998
Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id PAA19733 for <bugs@RT-11.MIT.EDU>; Tue, 20 Jan 1998 15:39:22 -0500
Received: from SMALL-GODS.MIT.EDU by MIT.EDU with SMTP
id AA09896; Tue, 20 Jan 98 15:39:27 EST
Received: by small-gods.MIT.EDU (SMI-8.6/4.7) id PAA12427; Tue, 20 Jan 1998 15:39:19 -0500
Message-Id: <199801202039.PAA12427@small-gods.MIT.EDU>
Date: Tue, 20 Jan 1998 15:39:19 -0500
From: ghudson@MIT.EDU
Reply-To: ghudson@MIT.EDU
To: krb5-bugs@MIT.EDU
Subject: telnetd banner escapes
X-Send-Pr-Version: 3.99

Show quoted text
>Number: 532
>Category: telnet
>Synopsis: telnetd should support more banner escapes
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: hartmans
>State: open
>Class: change-request
>Submitter-Id: unknown
>Arrival-Date: Tue Jan 20 15:40:01 EST 1998
>Last-Modified:
>Originator: Greg Hudson
>Organization:
MIT
Show quoted text
>Release: 1.0
>Environment:

System: SunOS small-gods 5.5.1 Generic_103640-12 sun4u sparc SUNW,Ultra-1
Architecture: sun4

Show quoted text
>Description:
telnetd reads its banner string from /etc/gettytab on systems which have
that. This means that when the krb5 telnetd doesn't support the same
escape sequences as the vendor telnetd does, you get an incomplete banner.
Show quoted text
>How-To-Repeat:
telnet -u to a NetBSD machine, and observer that the banner is
/ (hostname) (tty)
Show quoted text
>Fix:
The following patch implements the additional escapes known to NetBSD
(and presumably to BSD 4.4). It uses uname(), which is common (it
appears in both System V and BSD 4.4-based systems, as well as Linux)
but not entirely universal. Because the krb5 build system is still
somewhat in flux (I think), I did not do the work of conditionalizing
the new code on HAVE_SYS_UTSNAME_H, so someone should do that while
applying this patch.

Index: utility.c
===================================================================
RCS file: /afs/dev.mit.edu/source/repository/third/krb5/src/appl/telnet/telnetd/utility.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 utility.c
*** utility.c 1997/01/21 09:20:09 1.1.1.2
--- utility.c 1998/01/20 20:29:37
***************
*** 35,40 ****
--- 35,41 ----

#define PRINTOPTIONS
#include "telnetd.h"
+ #include <sys/utsname.h>

/*
* utility functions performing io related tasks
***************
*** 448,453 ****
--- 449,457 ----
char *slash;
time_t t;
char db[100];
+ struct utsname utsinfo;
+
+ uname(&utsinfo);

putlocation = where;

***************
*** 479,484 ****
--- 483,504 ----
(void)time(&t);
(void)strftime(db, sizeof(db), fmtstr, localtime(&t));
putstr(db);
+ break;
+
+ case 's':
+ putstr(utsinfo.sysname);
+ break;
+
+ case 'm':
+ putstr(utsinfo.machine);
+ break;
+
+ case 'r':
+ putstr(utsinfo.release);
+ break;
+
+ case 'v':
+ putstr(utsinfo.version);
break;

case '%':
Show quoted text
>Audit-Trail:
>Unformatted: