Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2016 13:01:08 -0700
From:      Devin Teske <dteske@freebsd.org>
To:        Steven Hartland <smh@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske <dteske@FreeBSD.org>
Subject:   Re: svn commit: r301131 - head/usr.sbin/tzsetup
Message-ID:  <9FC87174-ADC7-4E78-AE4A-C0EAD35AC1B1@freebsd.org>
In-Reply-To: <201606011539.u51FdB8J011181@repo.freebsd.org>
References:  <201606011539.u51FdB8J011181@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <smh@FreeBSD.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9FC87174-ADC7-4E78-AE4A-C0EAD35AC1B1>