From pjchilds@al.imforei.apana.org.au  Sun Sep 22 10:27:45 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 KAA03706
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 22 Sep 1996 10:27:41 -0700 (PDT)
Received: (from pjchilds@localhost) by al.imforei.apana.org.au (8.7.6/8.7.3) id CAA08327; Mon, 23 Sep 1996 02:57:37 +0930 (CST)
Message-Id: <199609221727.CAA08327@al.imforei.apana.org.au>
Date: Mon, 23 Sep 1996 02:57:37 +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-getty bug
X-Send-Pr-Version: 3.2

>Number:         1664
>Category:       bin
>Synopsis:       getty doesn't use init kerninfo struct
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    davidn
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 22 10:30:01 PDT 1996
>Closed-Date:    Tue Mar 25 08:24:06 EST 1997
>Last-Modified:  Tue Mar 25 08:26:11 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
>Environment:

	2.2-current system

>Description:

 "man gettytab" shows the following..

 %m, %r, %s, %v
	The type of machine, release of the operating system, name of the
 	operating system, and version of the kernel, respectively, as re-
	turned by uname(2).

 and although most of the code is in /usr/src/libexec/getty it doesn't
 seem to fill in the "kerninfo" structure (see man 3 uname), hence 
 it doesn't work :(

>How-To-Repeat:
 
 Try to get system info in getty's logins.. and dont - ie try this
 in /etc/gettytab

default:\
        :cb:ce:ck:lc:fd#1000:im=\033[1;1H\033[2J\014\r\n\
Hello, this is %h (%t)\r\n\r\n\
%s %r %m\r\n\r\n\
:sp#1200:

>Fix:

 Apply this patch...

*** main.c.orig Mon Sep 23 02:32:49 1996
--- main.c      Mon Sep 23 02:55:22 1996
***************
*** 180,185 ****
--- 180,186 ----
        gethostname(hostname, sizeof(hostname));
        if (hostname[0] == '\0')
                strcpy(hostname, "Amnesiac");
+       uname(&kerninfo);
  
        /*
         * Limit running time to deal with broken or dead lines.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: davidn 
State-Changed-When: Sun Feb 2 23:07:04 EST 1997 
State-Changed-Why:  
I'm working on some patches now. 


Responsible-Changed-From-To: freebsd-bugs->davidn 
Responsible-Changed-By: davidn 
Responsible-Changed-When: Sun Feb 2 23:07:04 EST 1997 
Responsible-Changed-Why:  
I'm taking care of it. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: davidn 
State-Changed-When: Tue Mar 25 08:24:06 EST 1997 
State-Changed-Why:  
Fixed in rev 1.14 of src/libexec/getty/main.c. 
>Unformatted:
