From owner-freebsd-bugs@FreeBSD.ORG Sat Feb 11 07:20:08 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E8A7106566C for ; Sat, 11 Feb 2012 07:20:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 10BB18FC0C for ; Sat, 11 Feb 2012 07:20:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q1B7K65f049143 for ; Sat, 11 Feb 2012 07:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q1B7K6UO049142; Sat, 11 Feb 2012 07:20:06 GMT (envelope-from gnats) Resent-Date: Sat, 11 Feb 2012 07:20:06 GMT Resent-Message-Id: <201202110720.q1B7K6UO049142@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "dteske@vicor.com" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D82B0106566C for ; Sat, 11 Feb 2012 07:17:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id C65F28FC12 for ; Sat, 11 Feb 2012 07:17:29 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B7HTSE083182 for ; Sat, 11 Feb 2012 07:17:29 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q1B7HTZn083181; Sat, 11 Feb 2012 07:17:29 GMT (envelope-from nobody) Message-Id: <201202110717.q1B7HTZn083181@red.freebsd.org> Date: Sat, 11 Feb 2012 07:17:29 GMT From: "dteske@vicor.com" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/164976: [PATCH] tzsetup(8): Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 07:20:08 -0000 >Number: 164976 >Category: misc >Synopsis: [PATCH] tzsetup(8): Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option >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: Sat Feb 11 07:20:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: dteske@vicor.com >Release: 9.0-RELEASE >Organization: FIS Global, Inc. >Environment: FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: In SVN 230299, the hunk at line 702 (r230299) is incomplete (shown below): 705 +#ifdef VERBOSE 706 + snprintf(prompt, sizeof(prompt), 707 + "Removed %s", path_localtime); 708 +#endif 709 return (DITEM_LEAVE_MENU); Two issues: 1. prompt is assigned a value but then not used (evident by the return which occurs after assignment). 2. prompt is not global in nature and thus the value is lost upon return. Attached patch.txt: 1. Adds code to utilize the assigned value. >How-To-Repeat: Compiled with VERBOSE and select the "UTC" menu option. Before this patch, you are not informed that /etc/localtime was unlink(2)ed. This is inconsistent with selecting other options (informs you that you have created a symlink or copied a zonefile). After this patch, selecting the UTC option informs you that /etc/localtime was removed. >Fix: See attached patch.txt. Patch attached with submission follows: --- src/usr.sbin/tzsetup/tzsetup.c.orig Tue Feb 7 21:03:04 2012 +++ src/usr.sbin/tzsetup/tzsetup.c Fri Feb 10 22:59:18 2012 @@ -703,8 +703,13 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } #ifdef VERBOSE + snprintf(title, sizeof(title), "Done"); snprintf(prompt, sizeof(prompt), "Removed %s", path_localtime); + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else + fprintf(stderr, "%s\n", prompt); #endif return (DITEM_LEAVE_MENU); } >Release-Note: >Audit-Trail: >Unformatted: