Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2014 13:36:35 +0700 (NOVT)
From:      Eugene Grosbein <eugen@grosbein.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/190133: [patch] last(1) still mentiones non-existing wtmp
Message-ID:  <201405230636.s4N6aZe8010970@k-45-monitor.sd.rdtc.ru>
Resent-Message-ID: <201405230640.s4N6e1Fr081717@freefall.freebsd.org>

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

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



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