From owner-freebsd-bugs Fri Dec 20 3:10: 7 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D859637B405 for ; Fri, 20 Dec 2002 03:10:04 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 709D543EF4 for ; Fri, 20 Dec 2002 03:10:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBKBA2NS048037 for ; Fri, 20 Dec 2002 03:10:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBKBA2gj048036; Fri, 20 Dec 2002 03:10:02 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F33A37B401 for ; Fri, 20 Dec 2002 03:04:35 -0800 (PST) Received: from kisaragi.fks.ed.jp (kisaragi.fks.ed.jp [210.239.12.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id E34A043EDA for ; Fri, 20 Dec 2002 03:04:33 -0800 (PST) (envelope-from endou@fks.ed.jp) Received: from top1.fks.ed.jp (TAOPrivate-D-top1ad.fks.ed.jp [210.239.18.9]) by kisaragi.fks.ed.jp (8.12.5/8.12.5) with ESMTP id gBKB4KB6043261 for ; Fri, 20 Dec 2002 20:04:20 +0900 (JST) (envelope-from endou@fks.ed.jp) Received: from tetsu.ad.fks.ed.jp (tetsu.ad.fks.ed.jp [10.184.254.210]) by top1.fks.ed.jp (8.12.6/8.12.3/8.12.5) with ESMTP id gBKB4KGH002158 for ; Fri, 20 Dec 2002 20:04:20 +0900 (JST) Received: from top1.fks.ed.jp (localhost [127.0.0.1]) by tetsu.ad.fks.ed.jp (8.12.6/8.12.6/Submit) with ESMTP id gBKB4JNV016981 for ; Fri, 20 Dec 2002 20:04:20 +0900 (JST) Received: from kaede.ut.fks.ed.jp (kaede.ut.fks.ed.jp [192.168.3.6]) by top1.fks.ed.jp (8.12.6/8.12.3/8.12.5) with ESMTP id gBKB4JGH002155 for ; Fri, 20 Dec 2002 20:04:19 +0900 (JST) Received: from fks.ed.jp (ebine.ut.fks.ed.jp [192.168.3.4]) by kaede.ut.fks.ed.jp (8.12.6/8.11.5/8.11.5) with SMTP id gBKB2kcl060166 for ; Fri, 20 Dec 2002 20:03:34 +0900 (JST) (envelope-from endou@fks.ed.jp) Message-Id: <200212201103.gBKB2kcl060166@kaede.ut.fks.ed.jp> Date: Fri, 20 Dec 2002 20:02:46 +0900 (JST) From: endou Reply-To: endou To: FreeBSD-gnats-submit@FreeBSD.org Cc: endou@fks.ed.jp X-Send-Pr-Version: 3.113 Subject: bin/46395: usr/sbin/newsyslog -v daytime incorrect Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46395 >Category: bin >Synopsis: usr.sbin/newsyslog -v daytime incorrect >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 Dec 20 03:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: endou >Release: FreeBSD 4.7-RELEASE-p2 i386 >Organization: FKS.ED.JP >Environment: System: FreeBSD ebine.ut.fks.ed.jp 4.7-RELEASE-p2 FreeBSD 4.7-RELEASE-p2 #1: Fri Nov 15 12:33:32 JST 2002 moto@ebine.ut.fks.ed.jp:/usr/obj/usr/src/sys/FKS i386 >Description: date presentation of line that the logs were turned over is incorrect over write by ctime(&ent->trim_at) >How-To-Repeat: newsyslog -v >Fix: patch for /usr/src/usr.sbin/newsyslog/newsyslog.c --- newsyslog.c.org Fri Dec 20 19:31:48 2002 +++ newsyslog.c Fri Dec 20 19:32:54 2002 @@ -98,7 +98,7 @@ #define MIN_PID 5 #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ char hostname[MAXHOSTNAMELEN]; /* hostname */ -char *daytime; /* timenow in human readable form */ +char daytime[26]; /* timenow in human readable form */ static struct conf_entry *parse_file(char **files); static char *sob(char *p); @@ -220,8 +220,7 @@ char *p; timenow = time((time_t *) 0); - daytime = ctime(&timenow) + 4; - daytime[15] = '\0'; + (void)strncpy(daytime, ctime(&timenow) + 4, 15); /* Let's get our hostname */ (void) gethostname(hostname, sizeof(hostname)); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message