From eugen@k-45-monitor.sd.rdtc.ru  Fri May 23 06:37:24 2014
Return-Path: <eugen@k-45-monitor.sd.rdtc.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 9802767A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 May 2014 06:37:24 +0000 (UTC)
Received: from k-45-monitor.sd.rdtc.ru (k-45-monitor.sd.rdtc.ru [62.231.191.161])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id 00A4B27F6
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 May 2014 06:37:23 +0000 (UTC)
Received: from k-45-monitor.sd.rdtc.ru (localhost [127.0.0.1])
	by k-45-monitor.sd.rdtc.ru (8.14.8/8.14.8) with ESMTP id s4N6aax5010980;
	Fri, 23 May 2014 13:36:37 +0700 (NOVT)
	(envelope-from eugen@k-45-monitor.sd.rdtc.ru)
Received: (from eugen@localhost)
	by k-45-monitor.sd.rdtc.ru (8.14.8/8.14.8/Submit) id s4N6aZe8010970;
	Fri, 23 May 2014 13:36:35 +0700 (NOVT)
	(envelope-from eugen)
Message-Id: <201405230636.s4N6aZe8010970@k-45-monitor.sd.rdtc.ru>
Date: Fri, 23 May 2014 13:36:35 +0700 (NOVT)
From: Eugene Grosbein <eugen@grosbein.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] last(1) still mentiones non-existing wtmp
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         190133
>Category:       bin
>Synopsis:       [patch] last(1) still mentiones non-existing wtmp
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 23 06:40:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Eugene Grosbein
>Release:        FreeBSD 9.2-STABLE amd64
>Organization:
RDTC JSC
>Environment:
System: FreeBSD k-45-monitor 9.2-STABLE FreeBSD 9.2-STABLE #24 r265054M: Mon May 5 20:04:48 NOVT 2014 root@k-45-monitor:/usr/obj/usr/local/src/sys/K-45-MONITOR amd64

>Description:
	Modern versions of FreeBSD moved from wtmp to utx.log
	and last(1) deals with utx.log but still prints "wtmp begins ..."
	at the end of output.

	Also, "last -f filename" does not affect this output but it should.

>How-To-Repeat:
	Run "last".

>Fix:

--- usr.bin/last/last.c.orig	2013-06-18 14:52:57.000000000 +0700
+++ usr.bin/last/last.c	2014-05-23 13:29:24.000000000 +0700
@@ -229,8 +229,8 @@ wtmp(void)
 		doentry(&buf[--amount]);
 
 	tm = localtime(&t);
-	(void) strftime(ct, sizeof(ct), "\nwtmp begins %+\n", tm);
-	printf("%s", ct);
+	(void) strftime(ct, sizeof(ct), "\n%%s begins %+\n", tm);
+	printf(ct, file);
 }
 
 /*


>Release-Note:
>Audit-Trail:
>Unformatted:
