From masafumi@tky007.tth.expo96.ad.jp  Thu May  9 15:25:10 1996
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 <FreeBSD-gnats-submit@freebsd.org>; 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 <masafumi@tky007.tth.expo96.ad.jp>
Reply-To: masafumi@tky007.tth.expo96.ad.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: timed records improper entry in wtmp
X-Send-Pr-Version: 3.2

>Number:         1182
>Category:       bin
>Synopsis:       timed records improper entry in wtmp
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May  9 15:30:01 PDT 1996
>Closed-Date:    Mon Oct 21 22:05:34 PDT 1996
>Last-Modified:  Mon Oct 21 22:14:02 PDT 1996
>Originator:     Masafumi NAKANE
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
>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",

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: scrappy 
State-Changed-When: Mon Oct 21 21:29:01 PDT 1996 
State-Changed-Why:  

confirm status 
State-Changed-From-To: feedback->closed 
State-Changed-By: scrappy 
State-Changed-When: Mon Oct 21 22:05:34 PDT 1996 
State-Changed-Why:  

Patch for master.c/slave.c applied 

>Unformatted:
