From tim@pool1.convey.ru  Wed Oct  8 23:58:57 1997
Received: from pool1.convey.ru (tim@pool1.convey.ru [195.182.128.3])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA13275
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 8 Oct 1997 23:58:53 -0700 (PDT)
          (envelope-from tim@pool1.convey.ru)
Received: (from tim@localhost) by pool1.convey.ru (8.8.5/8.7.3) id KAA23699; Thu, 9 Oct 1997 10:58:44 +0400 (MSD)
Message-Id: <199710090658.KAA23699@pool1.convey.ru>
Date: Thu, 9 Oct 1997 10:58:44 +0400 (MSD)
From: Andrew Timonin <tim@pool1.convey.ru>
Reply-To: tim@pool1.convey.ru
To: FreeBSD-gnats-submit@freebsd.org
Subject: ac command works incorrect with old wtmp files
X-Send-Pr-Version: 3.2

>Number:         4732
>Category:       bin
>Synopsis:       ac command works incorrect with old wtmp files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    steve
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct  9 00:00:01 PDT 1997
>Closed-Date:    Thu Jun 4 14:44:40 PDT 1998
>Last-Modified:  Thu Jun  4 14:45:12 PDT 1998
>Originator:     Andrew Timonin
>Release:        FreeBSD 2.2.2-RELEASE i386
>Organization:
Internet Services Ltd.
>Environment:


>Description:

	issuing ac -w some_old_wtmp_file gives wrong times

>How-To-Repeat:

	cp /var/log/wtmp /tmp/wtmp
	ac -p -w /tmp/wtmp > /tmp/ac1
	sleep 10
	ac -p -w /tmp/wtmp > /tmp/ac2
	diff /tmp/ac[12]

>Fix:
	

*** ac.c.orig	Fri Oct 27 02:10:10 1995
--- ac.c	Thu Oct  9 10:22:22 1997
***************
*** 516,522 ****
  		}
  	}
  	(void)fclose(fp);
! 	usr.ut_time = time((time_t *)0);
  	(void)strcpy(usr.ut_line, "~");
  
  	if (Flags & AC_D) {
--- 516,523 ----
  		}
  	}
  	(void)fclose(fp);
! 	if (!(Flags & AC_W))
! 		usr.ut_time = time((time_t *)0);
  	(void)strcpy(usr.ut_line, "~");
  
  	if (Flags & AC_D) {

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->steve 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sun May 24 22:26:47 PDT 1998 
Responsible-Changed-Why:  
Patch committed, thanks!  I will commit this to -stable soon. 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Thu Jun 4 14:44:40 PDT 1998 
State-Changed-Why:  
Fixed in both -current and -stable, thanks! 
>Unformatted:
