Date: Thu, 9 Oct 1997 10:58:44 +0400 (MSD) From: Andrew Timonin <tim@pool1.convey.ru> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/4732: ac command works incorrect with old wtmp files Message-ID: <199710090658.KAA23699@pool1.convey.ru> Resent-Message-ID: <199710090700.AAA13363@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710090658.KAA23699>
