Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 1996 03:33:08 +0930 (CST)
From:      Peter Childs <pjchilds@imforei.apana.org.au>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1665: libexec-telnetd deficiency
Message-ID:  <199609221803.DAA09397@al.imforei.apana.org.au>
Resent-Message-ID: <199609221810.LAA01380@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1665
>Category:       bin
>Synopsis:       telnetd doesn't use gettytab %m %r %v %s tags
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 22 11:10:02 PDT 1996
>Last-Modified:
>Originator:     Peter Childs
>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!
>Release:        FreeBSD 2.2-CURRENT i386
>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 '%':
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609221803.DAA09397>