From owner-svn-src-head@freebsd.org Wed Jun 1 20:01:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3834BB60D6C; Wed, 1 Jun 2016 20:01:15 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (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 2B21F1F08; Wed, 1 Jun 2016 20:01:15 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=65483 helo=[10.0.0.103]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1b81t6-0008mM-SK; Wed, 01 Jun 2016 01:52:28 -0700 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r301131 - head/usr.sbin/tzsetup From: Devin Teske In-Reply-To: <201606011539.u51FdB8J011181@repo.freebsd.org> Date: Wed, 1 Jun 2016 13:01:08 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Content-Transfer-Encoding: quoted-printable Message-Id: <9FC87174-ADC7-4E78-AE4A-C0EAD35AC1B1@freebsd.org> References: <201606011539.u51FdB8J011181@repo.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2016 20:01:15 -0000 I think this should have been reviewed first before commit. 1. Changes should be mirrored with "bsdconfig timezone" to keep the two = aligned 2. Not all users are unaware of the linkage between /etc/localtime and = tzsetup and as-such, are left without a way of knowing how to clear the = state-change from "no localtime file" to instead "localtime file exists" = (as now tzsetup lacks any interface to unlink localtime as was the = option for UTC) I did not consider the lack of installing the UTC compiled zoneinfo file = as a bug, because calling that routine with a NULL argument was = effective in requesting the localtime file be unlinked to return to that = state. Yes, those that are plentifully aware that /etc/localtime is generated = after running tzsetup will know that you can simply rm it. But there are = situations such as maybe sudo allowing you to run tzsetup but not = allowing you to use rm that come to mind which throw a monkey-wrench = (aka spanner) in the works for even normal folk that may have relied on = the functionality to have /etc/localtime unlinked by selecting the UTC = option at the bottom of the list. --=20 Devin > On Jun 1, 2016, at 8:39 AM, Steven Hartland wrote: >=20 > Author: smh > Date: Wed Jun 1 15:39:11 2016 > New Revision: 301131 > URL: https://svnweb.freebsd.org/changeset/base/301131 >=20 > Log: > Fix tzsetup not installing /etc/localtime for UTC >=20 > If tzsetup UTC is run then it successfully configured the system for = UTC > including installing /etc/localtime however if the user ran just = tzsetup > for interactive configuration and select UTC no /etc/localtime was = installed > which resulted in failures for utilities which require said file. >=20 > Change set_zone_utc to call install_zoneinfo("UTC") to ensure that > /etc/localtime is created for interactive UTC selection. >=20 > Users who have previously run tzsetup in interactive mode and select = UTC > can install the missing /etc/localtime by running tzsetup -r. >=20 > Also correct static miss-match for set_zone_utc. >=20 > MFC after: 2 weeks > Relnotes: Yes > Sponsored by: Multiplay >=20 > Modified: > head/usr.sbin/tzsetup/tzsetup.c >=20 > Modified: head/usr.sbin/tzsetup/tzsetup.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.sbin/tzsetup/tzsetup.c Wed Jun 1 15:19:49 2016 = (r301130) > +++ head/usr.sbin/tzsetup/tzsetup.c Wed Jun 1 15:39:11 2016 = (r301131) > @@ -199,6 +199,7 @@ static char *chrootenv =3D NULL; > static void usage(void); > static int confirm_zone(const char *filename); > static int continent_country_menu(dialogMenuItem *); > +static int install_zoneinfo(const char *zoneinfo); > static int install_zoneinfo_file(const char *zoneinfo_file); > static int set_zone_multi(dialogMenuItem *); > static int set_zone_whole_country(dialogMenuItem *); > @@ -633,13 +634,13 @@ set_zone_menu(dialogMenuItem *dmi) > return (DITEM_LEAVE_MENU); > } >=20 > -int > +static int > set_zone_utc(void) > { > if (!confirm_zone(NULL)) > return (DITEM_FAILURE | DITEM_RECREATE); >=20 > - return (install_zoneinfo_file(NULL)); > + return (install_zoneinfo("UTC")); > } >=20 > static int >=20