From owner-freebsd-bugs Thu Oct 9 00:00:08 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA13387 for bugs-outgoing; Thu, 9 Oct 1997 00:00:08 -0700 (PDT) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA13363; Thu, 9 Oct 1997 00:00:04 -0700 (PDT) (envelope-from gnats) Resent-Date: Thu, 9 Oct 1997 00:00:04 -0700 (PDT) Resent-Message-Id: <199710090700.AAA13363@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, tim@pool1.convey.ru 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 ; 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 Reply-To: tim@pool1.convey.ru To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/4732: ac command works incorrect with old wtmp files Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4732 >Category: bin >Synopsis: ac command works incorrect with old wtmp files >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 9 00:00:01 PDT 1997 >Last-Modified: >Originator: Andrew Timonin >Organization: Internet Services Ltd. >Release: FreeBSD 2.2.2-RELEASE i386 >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) { >Audit-Trail: >Unformatted: