From zach@blizzard.gaffaneys.com  Tue Apr  1 23:42:16 1997
Received: from murkwood.gaffaneys.com (dialup1.gaffaneys.com [134.129.252.20])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA12950
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 1 Apr 1997 23:41:55 -0800 (PST)
Received: (from zach@localhost)
	by murkwood.gaffaneys.com (8.8.5/8.8.5) id BAA02459;
	Wed, 2 Apr 1997 01:42:27 -0600 (CST)
Message-Id: <199704020742.BAA02459@murkwood.gaffaneys.com>
Date: Wed, 2 Apr 1997 01:42:27 -0600 (CST)
From: Zach Heilig <zach@blizzard.gaffaneys.com>
Reply-To: zach@blizzard.gaffaneys.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: utmp and wtmp programs out of sync.
X-Send-Pr-Version: 3.2

>Number:         3173
>Category:       bin
>Synopsis:       utmp and wtmp programs out of sync.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr  1 23:50:01 PST 1997
>Closed-Date:    Mon Apr 14 17:55:27 PDT 1997
>Last-Modified:  Mon Apr 14 17:56:09 PDT 1997
>Originator:     Zach Heilig
>Release:        FreeBSD 2.2-STABLE i386
>Organization:
>Environment:

I cvsup'ed the tag RELENG_2_2 on April 1, and built it.  I noticed this
problem from the update I got on March 29, so I tried again before
complaining.

	

>Description:

login writes utmp and wtmp records that 'last' can understand, but
'who', 'w', 'finger', and 'uptime' do not understand.  xterm writes
utmp and wtmp records that 'who', 'w', 'finger', and 'uptime' can
use, but not 'last'.  I'm sure there are more programs that muck around
with utmp/wtmp, but these are the ones I thought to check.

Script started on Wed Apr  2 01:14:58 1997
$ who
zach     ttyp1   Apr  2 01:12	(:0.0)
zach     ttyp2   Apr  2 01:14	(:0.0)
$ w
 1:15AM  up 3 mins, 2 users, load averages: 0.44, 0.21, 0.08
USER     TTY FROM              LOGIN@  IDLE WHAT
zach     p1  :0.0              1:12AM     - /usr/local/bin/jove /tmp//p232
zach     p2  :0.0              1:14AM     - script
$ finger
Login    Name                 TTY  Idle  Login Time   Office     Office Phone
zach     Zach Heilig          p1         Wed    01:12
zach     Zach Heilig          p2         Wed    01:14
$ uptime
 1:15AM  up 3 mins, 2 users, load averages: 0.45, 0.22, 0.09
$ last
reboot    ~                         Wed Apr  2 01:12 
shutdown  ~                         Wed Apr  2 01:10 

wtmp begins Wed Apr  2 01:10 
$ 
Script done on Wed Apr  2 01:15:27 1997

Note the logins on the console do not show up (and if I log too many in,
I get garbage in the 'who' list).

	

>How-To-Repeat:

	

>Fix:

	

>Release-Note:
>Audit-Trail:

From: Zach Heilig <zach@blizzard.gaffaneys.com>
To: gnats@freefall.freebsd.org
Cc:  Subject: Re: bin/3173: utmp and wtmp programs out of sync (update).
Date: Sat, 5 Apr 1997 01:29:59 -0600

 is anyone listening? ;-)
 
 login and telnetd both think that sizeof (utmp) == 44 (I'm not sure why yet,
 they appearantly use libutil, which appears to think that
 sizeof (utmp) == 36... this info from observing the effect of these two
 programs on utmp and wtmp, and looking at their source)
 
 init, who, finger, w, uptime, and xterm [and most other things] get it right,
 and think that sizeof (utmp) == 36.
 
 For example, my /var/log/wtmp is size 256... it has 1 36 byte record, and 5 44
 byte records.  1 reboot record (the 36 byte record), 1 login record for ttyv0,
 one login and logout record for ttyp3 (from telnetd), and one login and logout
 record for ttyp2 (also from telnetd).  xterm doesn't seem to write to wtmp.
 
 My /var/run/utmp has two entries for ttyp2, one at 24*36 (from xterm), and
 one at 24*44 (from telnetd).
 
 I already tried:
 rm -rf /usr/obj
 rm -rf /usr/src
 rm -rf /usr/sup
 
 and getting a fresh copy of /usr/src, and make'ing world, but no difference.
 
 This is 2.2-STABLE, btw...
 
 -- 
 Zach Heilig (zach@blizzard.gaffaneys.com) | ALL unsolicited commercial email
                                           | is unwelcome.  I avoid dealing
                                           | with companies that email ads.
 
State-Changed-From-To: open->closed 
State-Changed-By: jmg 
State-Changed-When: Mon Apr 14 17:55:27 PDT 1997 
State-Changed-Why:  
closed at originator's request... 
>Unformatted:
