From owner-freebsd-bugs Thu May 9 15:30:04 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA27448 for bugs-outgoing; Thu, 9 May 1996 15:30:04 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA27440 Thu, 9 May 1996 15:30:02 -0700 (PDT) Resent-Date: Thu, 9 May 1996 15:30:02 -0700 (PDT) Resent-Message-Id: <199605092230.PAA27440@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, masafumi@tky007.tth.expo96.ad.jp Received: from mail.tky007.tth.expo96.ad.jp (root@tky007.tth.expo96.ad.jp [133.246.32.58]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id PAA26900 for ; Thu, 9 May 1996 15:25:08 -0700 (PDT) Received: (from masafumi@localhost) by mail.tky007.tth.expo96.ad.jp (8.7.5/3.4W4-SMTP) id HAA03828; Fri, 10 May 1996 07:24:55 +0900 (JST) Message-Id: <199605092224.HAA03828@mail.tky007.tth.expo96.ad.jp> Date: Fri, 10 May 1996 07:24:55 +0900 (JST) From: Masafumi NAKANE Reply-To: masafumi@tky007.tth.expo96.ad.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/1182: timed records improper entry in wtmp Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1182 >Category: bin >Synopsis: timed records improper entry in wtmp >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 9 15:30:01 PDT 1996 >Last-Modified: >Originator: Masafumi NAKANE >Organization: >Release: FreeBSD 2.2-CURRENT i386 >Environment: >Description: If timed is running when system clock is changed by date command, improper wtmp entry is made. According to wtmp(5), two entries, one with "|" as ut_line field and one with "{" for ut_line, should be recorded, but, one with "|" and one with "}" are made. So, output of last command looks like: date } Fri May 10 01:09 still logged in date | Fri May 10 01:08 Where it should be as: date { Fri May 10 01:10 date | Fri May 10 01:10 >How-To-Repeat: Run timed and change system clock using date command. >Fix: The following patch to /usr/src/usr.sbin/timed/timed/master.c and /usr/src/usr.sbin/timed/timed/slave.c should fix the problem. *** master.c.orig Thu May 26 14:23:24 1994 --- master.c Fri May 10 07:09:46 1996 *************** *** 390,396 **** #else logwtmp("|", "date", ""); (void)settimeofday(&msg->tsp_time, 0); ! logwtmp("}", "date", ""); #endif /* sgi */ spreadtime(); } --- 390,396 ---- #else logwtmp("|", "date", ""); (void)settimeofday(&msg->tsp_time, 0); ! logwtmp("{", "date", ""); #endif /* sgi */ spreadtime(); } *** slave.c.orig Thu May 26 14:23:23 1994 --- slave.c Fri May 10 07:09:19 1996 *************** *** 294,300 **** #else logwtmp("|", "date", ""); (void)settimeofday(&msg->tsp_time, 0); ! logwtmp("}", "date", ""); #endif /* sgi */ syslog(LOG_NOTICE, "date changed by %s from %s", --- 294,300 ---- #else logwtmp("|", "date", ""); (void)settimeofday(&msg->tsp_time, 0); ! logwtmp("{", "date", ""); #endif /* sgi */ syslog(LOG_NOTICE, "date changed by %s from %s", >Audit-Trail: >Unformatted: