[2861] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

telnet/532: telnetd banner escapes

daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Tue Jan 20 15:40:20 1998

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: hartmans@MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, ghudson@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


>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
>Release:        1.0
>Environment:
	
System: SunOS small-gods 5.5.1 Generic_103640-12 sun4u sparc SUNW,Ultra-1
Architecture: sun4

>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.
>How-To-Repeat:
telnet -u to a NetBSD machine, and observer that the banner is
	/ (hostname) (tty)
>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 '%':
>Audit-Trail:
>Unformatted:

home help back first fref pref prev next nref lref last post