From owner-freebsd-bugs Thu Jul 31 22:40:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id WAA00239 for bugs-outgoing; Thu, 31 Jul 1997 22:40:03 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id WAA00223; Thu, 31 Jul 1997 22:40:01 -0700 (PDT) Resent-Date: Thu, 31 Jul 1997 22:40:01 -0700 (PDT) Resent-Message-Id: <199708010540.WAA00223@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, tolik@www.tomsk.su Received: from www.tomsk.su (www.tomsk.su [193.124.185.18]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id WAA29657 for ; Thu, 31 Jul 1997 22:32:24 -0700 (PDT) Received: (from tolik@localhost) by www.tomsk.su (8.8.5/8.8.5) id NAA05400; Fri, 1 Aug 1997 13:31:08 +0800 (TSD) Message-Id: <199708010531.NAA05400@www.tomsk.su> Date: Fri, 1 Aug 1997 13:31:08 +0800 (TSD) From: "Anatoly A. Orehovsky" Reply-To: tolik@www.tomsk.su To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/4204: Getting wrong ac report Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4204 >Category: bin >Synopsis: ac printed wrong report about tty users >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 31 22:40:00 PDT 1997 >Last-Modified: >Originator: Anatoly A. Orehovsky >Organization: CISA Ltd. >Release: FreeBSD 2.2.2-RELEASE i386 >Environment: Correct wtmp file. >Description: Running ac with it any keys result in wrong printed times for tty users. For example: running ac -p in /etc/monthly. Also default rotate value for wtmp (168 hours) in /etc/newsyslog.conf is not compatible with running ac -p from /etc/monthly. >How-To-Repeat: ac -p ac -d ... >Fix: This problem is result mixed '!=' and '==' operators in ac.c(ac()). Patch: -- BEGIN of patch-- *** ac.c.orig Fri Oct 27 06:10:10 1995 --- ac.c Fri Aug 1 12:54:53 1997 *************** *** 506,513 **** * a login session if the ut_host field is non-empty */ if (*usr.ut_name) { ! if (strncmp(usr.ut_line, "tty", 3) != 0 || ! strchr("pqrstuvwxy", usr.ut_line[3]) == 0 || *usr.ut_host != '\0') head = log_in(head, &usr); } else --- 506,513 ---- * a login session if the ut_host field is non-empty */ if (*usr.ut_name) { ! if (strncmp(usr.ut_line, "tty", 3) == 0 || ! strchr("pqrstuvwxy", usr.ut_line[3]) != 0 || *usr.ut_host != '\0') head = log_in(head, &usr); } else -- END of patch -- For remove noncompatibilty /etc/newsyslog.conf with /etc/monthly require to move follow code from /etc/monthly: --BEGIN of code echo "Doing login accounting:" ac -p | sort -nr +1 -- END of code -- to /etc/weekly. And stay to receive "ac -p" report every week. >Audit-Trail: >Unformatted: