From nobody@FreeBSD.org  Sat Feb 11 07:17:29 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D82B0106566C
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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" <Devin.Teske@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] tzsetup(8): Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         164976
>Category:       bin
>Synopsis:       [PATCH] tzsetup(8): Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dteske
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 11 07:20:06 UTC 2012
>Closed-Date:    Mon Mar 04 11:45:13 UTC 2013
>Last-Modified:  Mon Mar  4 11:50:01 UTC 2013
>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:
Responsible-Changed-From-To: freebsd-bugs->dteske 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun Apr 15 20:26:31 UTC 2012 
Responsible-Changed-Why:  
submitter has a commit bit now 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164976 

From: Devin Teske <devin.teske@fisglobal.com>
To: <bug-followup@FreeBSD.org>, <Devin.Teske@FreeBSD.org>
Cc:  
Subject: Re: bin/164976: [PATCH] tzsetup(8): Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option
Date: Sun, 15 Apr 2012 15:24:56 -0700

 Working way through new-committer's guidelines.
 
 Haven't committed my authority entity to the SGML docs yet (first on list o=
 f things to do).
 
 This will be the first PR I handle when I'm all set up and have announcemen=
 t myself to developers@.
 --=20
 Devin
 
 _____________
 The information contained in this message is proprietary and/or confidentia=
 l. If you are not the intended recipient, please: (i) delete the message an=
 d all copies; (ii) do not disclose, distribute or use the message in any ma=
 nner; and (iii) notify the sender immediately. In addition, please be aware=
  that any message addressed to our domain is subject to archiving and revie=
 w by persons other than the intended recipient. Thank you.
State-Changed-From-To: open->patched 
State-Changed-By: dteske 
State-Changed-When: Mon Mar 4 11:34:55 UTC 2013 
State-Changed-Why:  
Committed to HEAD as r247780 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164976 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/164976: commit references a PR
Date: Mon,  4 Mar 2013 11:34:39 +0000 (UTC)

 Author: dteske
 Date: Mon Mar  4 11:34:31 2013
 New Revision: 247780
 URL: http://svnweb.freebsd.org/changeset/base/247780
 
 Log:
   Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option.
   
   PR:		bin/164976
   Submitted by:	dteske
 
 Modified:
   head/usr.sbin/tzsetup/tzsetup.c
 
 Modified: head/usr.sbin/tzsetup/tzsetup.c
 ==============================================================================
 --- head/usr.sbin/tzsetup/tzsetup.c	Mon Mar  4 11:27:41 2013	(r247779)
 +++ head/usr.sbin/tzsetup/tzsetup.c	Mon Mar  4 11:34:31 2013	(r247780)
 @@ -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);
  		}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: dteske 
State-Changed-When: Mon Mar 4 11:43:29 UTC 2013 
State-Changed-Why:  
MFC'd to stable/9 with r247781 and stable/8 with r247782 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164976 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/164976: commit references a PR
Date: Mon,  4 Mar 2013 11:41:01 +0000 (UTC)

 Author: dteske
 Date: Mon Mar  4 11:40:52 2013
 New Revision: 247781
 URL: http://svnweb.freebsd.org/changeset/base/247781
 
 Log:
   MFC r247780:
   
   Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option.
   
   PR:		bin/164976
   Submitted by:	dteske
 
 Modified:
   stable/9/usr.sbin/tzsetup/tzsetup.c
 
 Modified: stable/9/usr.sbin/tzsetup/tzsetup.c
 ==============================================================================
 --- stable/9/usr.sbin/tzsetup/tzsetup.c	Mon Mar  4 11:34:31 2013	(r247780)
 +++ stable/9/usr.sbin/tzsetup/tzsetup.c	Mon Mar  4 11:40:52 2013	(r247781)
 @@ -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);
  		}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/164976: commit references a PR
Date: Mon,  4 Mar 2013 11:43:28 +0000 (UTC)

 Author: dteske
 Date: Mon Mar  4 11:43:20 2013
 New Revision: 247782
 URL: http://svnweb.freebsd.org/changeset/base/247782
 
 Log:
   MFC r247780:
   
   Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option.
   
   PR:		bin/164976
   Submitted by:	dteske
 
 Modified:
   stable/8/usr.sbin/tzsetup/tzsetup.c
 
 Modified: stable/8/usr.sbin/tzsetup/tzsetup.c
 ==============================================================================
 --- stable/8/usr.sbin/tzsetup/tzsetup.c	Mon Mar  4 11:40:52 2013	(r247781)
 +++ stable/8/usr.sbin/tzsetup/tzsetup.c	Mon Mar  4 11:43:20 2013	(r247782)
 @@ -588,8 +588,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);
  		}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
