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
fgetln(3) will returns NULL if cannot get a line from a stream.
strsep(3) it will returns NULL if the end of the string was reached.
jemalloc(3) malloc will returns NULL if it cannot allocate memory.
fgetln(3) it will returns NULL if it cannot get a line from a stream.
MFC after: 4 weeks
Previously, the code prefixes the chroot path to actual file paths to
simulate the effect. This, however, will not work for tzset(3) which
expects the current system have a working set of timezone data files,
and that is not always the case.
This changeset simplifies the handling of paths and use an actual
chroot(2) call to implement the effect.
PR: bin/197313
MFC after: 2 weeks
- Move the reinstall logic to be before menus are initialised
(menus are not needed when reinstalling a zonefile).
- Remove unnecessary re-initialization of path_db.
- Update variable name and error message because we now use the
zone name relative to /usr/share/zoneinfo, not the full path.
pr: bin/164041
Submitted by: Devin Teske <dteske vicor com>
MFC after: 1 week
Update verbose output to match what actually happens when selecting
the UTC option, and when the -n option is used.
Patch updated slightly for new libdialog.
PR: bin/164042
Submitted by: Devin Teske <dteske vicor com>
MFC after: 2 weeks
If the specified zone file does not exist or the -n flag is specified,
do not update /var/db/zoneinfo.
PR: bin/164039
Submitted by: Devin Teske <dteske vicor com>
MFC after: 1 week
installing zoneinfo. While we're in the vicinity, add some missing
error checking to eliminate an unhelpful error message when unlink()
fails.
/me is embarrassed by the quality of his 16-year-old code.
The whole thing is awful and could stand a complete rewrite.
PR: 164038
Submitted by: Devin Teske (but implemented differently)
adjusting the clock to UTC.
That avoids to write on /etc/wall_cmos_clock which is useful in some
cases (example: host user in a jail).
Sponsored by: Sandvine Incorporated
Initially submitted by: Matt Koivisto <mkoivisto at sandvine dot com>
Approved by: re (kib)
Specifically, change the second level menu title from 'Country' to
'Country or Region', since e.g. Hong Kong is not a country.
Submitted by: Xin LI <delphij@frontfree.net>