Re: svn commit: r301131 - head/usr.sbin/tzsetup

2016-06-01 Thread Devin Teske
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.
-- 
Devin

> On Jun 1, 2016, at 8:39 AM, Steven Hartland  wrote:
> 
> Author: smh
> Date: Wed Jun  1 15:39:11 2016
> New Revision: 301131
> URL: https://svnweb.freebsd.org/changeset/base/301131
> 
> Log:
>  Fix tzsetup not installing /etc/localtime for UTC
> 
>  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.
> 
>  Change set_zone_utc to call install_zoneinfo("UTC") to ensure that
>  /etc/localtime is created for interactive UTC selection.
> 
>  Users who have previously run tzsetup in interactive mode and select UTC
>  can install the missing /etc/localtime by running tzsetup -r.
> 
>  Also correct static miss-match for set_zone_utc.
> 
>  MFC after:   2 weeks
>  Relnotes:Yes
>  Sponsored by:Multiplay
> 
> Modified:
>  head/usr.sbin/tzsetup/tzsetup.c
> 
> Modified: head/usr.sbin/tzsetup/tzsetup.c
> ==
> --- 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 = NULL;
> static void   usage(void);
> static intconfirm_zone(const char *filename);
> static intcontinent_country_menu(dialogMenuItem *);
> +static int   install_zoneinfo(const char *zoneinfo);
> static intinstall_zoneinfo_file(const char *zoneinfo_file);
> static intset_zone_multi(dialogMenuItem *);
> static intset_zone_whole_country(dialogMenuItem *);
> @@ -633,13 +634,13 @@ set_zone_menu(dialogMenuItem *dmi)
>   return (DITEM_LEAVE_MENU);
> }
> 
> -int
> +static int
> set_zone_utc(void)
> {
>   if (!confirm_zone(NULL))
>   return (DITEM_FAILURE | DITEM_RECREATE);
> 
> - return (install_zoneinfo_file(NULL));
> + return (install_zoneinfo("UTC"));
> }
> 
> static int
> 

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301131 - head/usr.sbin/tzsetup

2016-06-01 Thread Steven Hartland
Author: smh
Date: Wed Jun  1 15:39:11 2016
New Revision: 301131
URL: https://svnweb.freebsd.org/changeset/base/301131

Log:
  Fix tzsetup not installing /etc/localtime for UTC
  
  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.
  
  Change set_zone_utc to call install_zoneinfo("UTC") to ensure that
  /etc/localtime is created for interactive UTC selection.
  
  Users who have previously run tzsetup in interactive mode and select UTC
  can install the missing /etc/localtime by running tzsetup -r.
  
  Also correct static miss-match for set_zone_utc.
  
  MFC after:2 weeks
  Relnotes: Yes
  Sponsored by: Multiplay

Modified:
  head/usr.sbin/tzsetup/tzsetup.c

Modified: head/usr.sbin/tzsetup/tzsetup.c
==
--- 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 = NULL;
 static voidusage(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);
 }
 
-int
+static int
 set_zone_utc(void)
 {
if (!confirm_zone(NULL))
return (DITEM_FAILURE | DITEM_RECREATE);
 
-   return (install_zoneinfo_file(NULL));
+   return (install_zoneinfo("UTC"));
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"