From pjchilds@al.imforei.apana.org.au  Sun Sep 22 11:03:20 1996
Received: from al.imforei.apana.org.au (pjchilds@al.imforei.apana.org.au [202.12.89.41])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA26997
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 22 Sep 1996 11:03:14 -0700 (PDT)
Received: (from pjchilds@localhost) by al.imforei.apana.org.au (8.7.6/8.7.3) id DAA09397; Mon, 23 Sep 1996 03:33:08 +0930 (CST)
Message-Id: <199609221803.DAA09397@al.imforei.apana.org.au>
Date: Mon, 23 Sep 1996 03:33:08 +0930 (CST)
From: Peter Childs <pjchilds@imforei.apana.org.au>
Reply-To: pjchilds@imforei.apana.org.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: libexec-telnetd deficiency
X-Send-Pr-Version: 3.2

>Number:         1665
>Category:       bin
>Synopsis:       telnetd doesn't use gettytab %m %r %v %s tags
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    davidn
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 22 11:10:02 PDT 1996
>Closed-Date:    Tue Mar 25 08:26:54 EST 1997
>Last-Modified:  Tue Mar 25 08:27:24 EST 1997
>Originator:     Peter Childs
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Peter Childs  ---  http://www.imforei.apana.org.au/~pjchilds
  Finger pjchilds@al.imforei.apana.org.au for public PGP key
         Drag me, drop me, treat me like an object!
>Environment:

	2.2-current

>Description:

	Whilst reading discussion on one of the lists about
	/etc/issue vs. gettydefs I tried to modify my gettydefs so
	that logins displaced system info etc.

	This is the second patch that fixes telnetd so it supports
	%m %r %v %s tags as documented in gettytab.5

>How-To-Repeat:

	Adjust /etc/gettytab and find that nothing uses it.

>Fix:
	
	Apply patch to telnetd...

*** defs.h.orig	Mon Sep 23 03:18:11 1996
--- defs.h	Mon Sep 23 03:18:38 1996
***************
*** 78,83 ****
--- 78,84 ----
  #include <sys/file.h>
  #include <sys/stat.h>
  #include <sys/time.h>
+ #include <sys/utsname.h>
  #ifndef	FILIO_H
  #include <sys/ioctl.h>
  #else
*** telnetd.c.orig	Mon Sep 23 03:06:47 1996
--- telnetd.c	Mon Sep 23 03:23:19 1996
***************
*** 115,120 ****
--- 115,121 ----
  #endif /* ! STREAMPTY */
  
  int	hostinfo = 1;			/* do we print login banner? */
+ struct  utsname kerninfo;		/* banner info */
  
  #ifdef	CRAY
  extern int      newmap; /* nonzero if \n maps to ^M^J */
***************
*** 1071,1076 ****
--- 1072,1078 ----
  	if (getenv("USER"))
  		hostinfo = 0;
  #endif
+ 	uname(&kerninfo);
  
  	if (getent(defent, "default") == 1) {
  		char *getstr();
*** utility.c.orig	Mon Sep 23 03:02:49 1996
--- utility.c	Mon Sep 23 03:22:00 1996
***************
*** 41,46 ****
--- 41,48 ----
  #define PRINTOPTIONS
  #include "telnetd.h"
  
+ extern struct  utsname kerninfo; 
+ 
  /*
   * utility functions performing io related tasks
   */
***************
*** 460,465 ****
--- 462,483 ----
  			(void)time(&t);
  			(void)strftime(db, sizeof(db), fmtstr, localtime(&t));
  			putstr(db);
+ 			break;
+ 
+ 		case 's':
+ 			putstr(kerninfo.sysname);
+ 			break;
+ 
+ 		case 'm':
+ 			putstr(kerninfo.machine);
+ 			break;
+ 
+ 		case 'r':
+ 			putstr(kerninfo.release);
+ 			break;
+ 
+ 		case 'v':
+ 			putstr(kerninfo.version);
  			break;
  
  		case '%':
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, pjchilds@imforei.apana.org.au
Cc:  Subject: Re: bin/1665: libexec-telnetd deficiency
Date: Mon, 23 Sep 1996 15:14:39 +1000

 >>Synopsis:       telnetd doesn't use gettytab %m %r %v %s tags
 
 This feature was Considered Harmful and removed when it was first
 introduced in getty.  The broken version of it that you fixed in
 another PR sneaked in with the sgttyb -> termios conversion.
 
 Bruce
 
 RCS file: /a/ncvs/src/libexec/getty/main.c,v
 ...
 ----------------------------
 revision 1.9
 date: 1996/05/05 19:01:10;  author: joerg;  state: Exp;  lines: +183 -117
 Finally commit the changes that make getty(8) no longer depend on the
 COMPAT_43 cruft.  This is supposedly the last core utility that has
 been using it!  (So now, one should be able to remove this option from
 the config files.  Be aware that the last officially released xterm
 however still requires it.)
 
 The getty has been running now for several weeks on my modem line, so
 i feel safe about it.
 
 Obtained from:	mostly from the NetBSD vendor-branch
 ----------------------------
 revision 1.8
 date: 1995/08/03 05:44:46;  author: jkh;  state: Exp;  lines: +1 -27
 Back this change out.  It's just not worth arguing over and any further emails
 I get on this topic will go straight to /dev/null.  This is absolutely the
 last word on this topic you'll see from me.  Too much time has already been
 wasted.
 ----------------------------
 revision 1.7
 date: 1995/08/01 13:12:24;  author: jkh;  state: Exp;  lines: +27 -1
 A useful aid..  Add support for:
 
 	%r:	current release
 	%m:	machine architecture type (i386 for now)
 	%s:	OS name (FreeBSD)
 
 from uname() in banner string.
 ----------------------------

From: Peter Childs <pjchilds@imforei.apana.org.au>
To: bde@zeta.org.au (Bruce Evans)
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, pjchilds@imforei.apana.org.au
Subject: Re: bin/1665: libexec-telnetd deficiency
Date: Mon, 23 Sep 1996 18:00:12 +0930 (CST)

 > >>Synopsis:       telnetd doesn't use gettytab %m %r %v %s tags
 > 
 > This feature was Considered Harmful and removed when it was first
 > introduced in getty.  The broken version of it that you fixed in
 > another PR sneaked in with the sgttyb -> termios conversion.
 
  Ok.  I didn't really expect the telnetd changes to get committed,
  but if the getty stuff isn't going to be fixed then support
  for it should be removed, and the man page changed to reflect
  such (talking about bin/1664 - libexec/getty and gettytab.5 )
 
  I'm not sure why it is considered harmful(?) either, but thats why
  i'm not doing the commits, and you guys are :)
 
  Regards,
    Peter
 
 --
  Peter Childs  ---  http://www.imforei.apana.org.au/~pjchilds
   Finger pjchilds@al.imforei.apana.org.au for public PGP key
          Drag me, drop me, treat me like an object!

From: Bruce Evans <bde@zeta.org.au>
To: bde@zeta.org.au, pjchilds@imforei.apana.org.au
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/1665: libexec-telnetd deficiency
Date: Mon, 23 Sep 1996 18:54:33 +1000

 > I'm not sure why it is considered harmful(?) either, but thats why
 > i'm not doing the commits, and you guys are :)
 
 It's usually non-committers that find things harmful :-).
 
 For gettytab, people complained that advertising the O/S version is
 a security hole.  That was just for %r.  %v gives even more information.
 
 Bruce
State-Changed-From-To: open->analyzed 
State-Changed-By: davidn 
State-Changed-When: Sun Feb 2 23:11:23 EST 1997 
State-Changed-Why:  
This coincides with other work I'm doing. 


Responsible-Changed-From-To: freebsd-bugs->davidn 
Responsible-Changed-By: davidn 
Responsible-Changed-When: Sun Feb 2 23:11:23 EST 1997 
Responsible-Changed-Why:  
I'm working on it. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: davidn 
State-Changed-When: Tue Mar 25 08:26:54 EST 1997 
State-Changed-Why:  
Fixed in rev 1.8 of src/libexec/telnetd/utility.c. 
>Unformatted:
