Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 1996 07:24:55 +0900 (JST)
From:      Masafumi NAKANE <masafumi@tky007.tth.expo96.ad.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1182: timed records improper entry in wtmp
Message-ID:  <199605092224.HAA03828@mail.tky007.tth.expo96.ad.jp>
Resent-Message-ID: <199605092230.PAA27440@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605092224.HAA03828>