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