[2738] in Kerberos-V5-bugs

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

krb5-appl/430: telnetd banner (BSD 4.4!!?)

daemon@ATHENA.MIT.EDU (donn@u.washington.edu)
Tue May 20 11:08:18 1997

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: krb5-unassigned@RT-11.MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, donn@u.washington.edu
Date: Tue, 20 May 1997 08:03:10 -0700
From: donn@u.washington.edu
Reply-To: donn@u.washington.edu
To: krb5-bugs@MIT.EDU


>Number:         430
>Category:       krb5-appl
>Synopsis:       Telnetd banner erroneously proclaims BSD 4.4
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    krb5-unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   unknown
>Arrival-Date:   Tue May 20 11:04:01 EDT 1997
>Last-Modified:
>Originator:     Donn Cave
>Organization:
	University Computing Services
	University of Washington
>Release:        1.0pl1
>Environment:
	Digital UNIX, Ultrix, AIX, HP/UX
System: AIX melville 2 4 000010504900


>Description:
	Telnetd's login banner setup kind of revolves around the notion
	that it's going to come from /etc/gettytab, but the code that
	would actually do that is not compiled on any platform I have.
	The fallback recognizes an inadequate set of UNIX platforms and
	then defaults to BSD 4.4.  While it's delightful to imagine that
	my AIX, Ultrix, HP/UX etc. computers could be miraculously
	transformed into BSD 4.4, the disappointing reality is that the
	banner lies, and we couldn't put that into production.

	So we put in something based on uname(), which seems to work fine
	(although as usually requires special attention on AIX.)

>How-To-Repeat:
	Log in on something other than Solaris.
>Fix:
	Context diff appended.
	----------------------
*** src/appl/telnet/telnetd/telnetd.c.dist	Fri Nov  8 14:25:20 1996
--- src/appl/telnet/telnetd/telnetd.c	Wed Apr 16 13:11:39 1997
***************
*** 179,184 ****
--- 179,204 ----
  	'\0'
  };
  
+ #include <sys/utsname.h>
+ static void
+ osbanner(char *banner)
+ {
+ 	struct utsname name;
+ 
+ 	if (uname(&name) < 0)
+ 		sprintf(banner, "\r\nError getting hostname: %s\r\n",
+ 		    strerror(errno));
+         else {
+ #if defined(_AIX)
+ 		sprintf(banner, "\r\n    %%h (%s release %s.%s)\r\n\r\n",
+ 		    name.sysname, name.version, name.release);
+ #else
+ 		sprintf(banner, "\r\n    %%h (%s release %s %s)\r\n\r\n",
+ 		    name.sysname, name.release, name.version);
+ #endif
+ 	}
+ }
+ 
  main(argc, argv)
  	int argc;
  	char *argv[];
***************
*** 1211,1218 ****
  		HEstr = 0;
  	}
  	edithost(HEstr, host_name);
! 	if (hostinfo && *IM)
! 		putf(IM, ptyibuf2);
  
  	if (pcc)
  		(void) strncat(ptyibuf2, ptyip, pcc+1);
--- 1231,1243 ----
  		HEstr = 0;
  	}
  	edithost(HEstr, host_name);
! 
! 	if (hostinfo && *IM) {
! 		char banner[4096];
! 		osbanner(banner);
! 		putf(banner, ptyibuf2);
!              /* putf(IM, ptyibuf2);    */
!         }
  
  	if (pcc)
  		(void) strncat(ptyibuf2, ptyip, pcc+1);
>Audit-Trail:
>Unformatted:

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