History log of /freebsd-current/usr.sbin/tzsetup/tzsetup.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 40b57cb6 25-Mar-2024 Ed Maste <emaste@FreeBSD.org>

tzsetup: be explicit about *timezone* abbreviation

During the install process tzsetup asks a question like

Does the abbreviation `EDT' look reasonable?

The installer asks lots of questions, some that relate to the previous
screen or topic and some that do not. A new user installed FreeBSD for
the first time and was confused by this question, not realizing that it
was asking whether the abbreviation is correct for the selected
timezone.

Reviewed by: bapt, brooks, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44500


# 5e16809c 13-Oct-2022 Ed Maste <emaste@FreeBSD.org>

tzsetup: symlink /etc/localtime instead of copying

Using a symlink means that new timezone data (installed by an errata
update, say) will be usable without having to be copied again.

Reviewed by: bapt, kevans, philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37005


# 6f7c4505 30-Oct-2023 Brooks Davis <brooks@FreeBSD.org>

tzsetup: make UTC the first (default) region

Many sysadmins prefer to configure their systems to UTC and it's a
reasonable default when installing, making it easier to get a usable
system by just hitting <return> repeatidly.

Renumber UTC to 0 to preserve the finger memory of those selecting a
region by shortcut.

Reviewed by: jrtc27, emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42383


# 914ab28c 27-Jul-2023 Pierre Pronchery <pierre@freebsdfoundation.org>

tzsetup: add support for countries in two continents

This supports countries located across multiple continents, as per the
zone1970.tab file. This only affects Cyprus and Türkiye at the moment.

PR: 236874
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41306


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# bb255cee 25-Jul-2023 Yuri Pankov <yuripv@FreeBSD.org>

tzsetup: fix "misleading indentation" warning with -DVERBOSE


# 08ed8751 27-Apr-2023 Yuri Pankov <yuripv@FreeBSD.org>

tzsetup: appease checkstyle9


# cfd0217a 27-Apr-2023 Yuri Pankov <yuripv@FreeBSD.org>

tzsetup: adopt zone1970.tab changes

- assumption that single-zone countries do not have description
is no longer correct; do not try to optimize this case as it's
only going to make the code more confusing and we now have menus
with a single zone selection because of this
- remove the single-country continent short cut, it also only serves
to confuse users as we now have such a continent
- instead add a single-zone contry short cut (see above), now all
single-zone countries fall here
- use the #@ continent overrides that zone1970.tab introduces (this is
visible at least fixing Iceland being currently listed under Africa)
- add Arctic Ocean "continent" coming only from the overrides at the
moment
- update baseline with the changes

Reviewed by: bapt, philip
Differential Revision: https://reviews.freebsd.org/D39606


# 989a0e1d 26-Apr-2023 Yuri Pankov <yuripv@FreeBSD.org>

tzsetup: fix bootstrapping for github CI jobs

Move dump_zonetab() under HAVE_BSDDIALOG as the parsing code
it relies on already is.


# 336c4682 23-Apr-2023 Yuri Pankov <yuripv@FreeBSD.org>

tzsetup: add baseline file to control parsed zonetab contents

Introduce undocumented option -d to dump parsed zonetab file contents
and add a "baseline" target along with instructions on updating it.

Reviewed by: philip
Differential Revision: https://reviews.freebsd.org/D39634


# 94cb21cd 11-Apr-2022 Alfonso S. Siciliano <asiciliano@FreeBSD.org>

tzsetup(8): Refactoring to delete dialog(3) code

Little refactoring to complete the conversion to bsddialog(3),
not functional changes:

* Delete: remaining code for autosizing using BSDDIALOG_AUTOSIZE.
* Add: constants to delete magical numbers and to avoid unclear
returned values.
* Delete: redundant 'conf.button.default_cancel=false', performed by
bsddialog_initconf().
* Add: a new function message_zoneinfo_file() to merge features.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34862


# 263660c0 28-Jan-2022 Alfonso Siciliano <alfsiciliano@gmail.com>

bsddialog: import version 0.1

Import bsddialog 0.1 Utility and Library, fully refatorized, API stable,
manuals completed, easier to maintain and improve.

Update deps for new API:
add mixedgauge consts, delete __DECONST and add bsddialog_geterror()
info to avoid silent errors

* tzsetup
* kbdmap
* distextract

Differential Revision: https://reviews.freebsd.org/D34066


# be0236eb 17-Dec-2021 Alfonso Siciliano <alfsiciliano@gmail.com>

tzsetup: Fix unicode support

Differential revision: https://reviews.freebsd.org/D33532

# 0a7e19b3 13-Dec-2021 Alfonso Siciliano <alfsiciliano@gmail.com>

tzsetup: adapt for libbsddialog 0.0.1

libbsdialog 0.0.1 provides:
* bsddialog_conf.auto_minwidth:
* menurows is variable with autosize (properly defines max menurows)

Then tzsetup can use BSDDIALOG_AUTOSIZE keeping the dialog behavior:
min 24 cols, max 16 menurows

Differential revision: https://reviews.freebsd.org/D33397

# 547fc67f 08-Dec-2021 Emmanuel Vadot <manu@FreeBSD.org>

tzsetup: Default to UTC

Restore old behavior.

Fixes: f872dde34c ("tzsetup: replace libdialog with libbsddialog")

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D33334
Sponsored by: Beckhoff Automation GmbH & Co. KG

# f499134d 06-Dec-2021 Baptiste Daroussin <bapt@FreeBSD.org>

bsddialog: import snapshot 2021-12-05


# 6ea39dd6 24-Nov-2021 Baptiste Daroussin <bapt@FreeBSD.org>

tzsetup: remove dedundant declaration

# f872dde3 15-Nov-2021 Baptiste Daroussin <bapt@FreeBSD.org>

tzsetup: replace libdialog with libbsddialog

Reviewed by: alfix86_gmail.com (bsddialog author)
Differential Revision: https://reviews.freebsd.org/D33077

# 7047dcee 10-Feb-2020 Warner Losh <imp@FreeBSD.org>

Remove sparc64 ifdef

Now we default to setting the hardware clock to UTC
everywhere. sparc64 was the old odd-man out before.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

# 513419f4 17-Jul-2019 Thomas Munro <tmunro@FreeBSD.org>

tzsetup: upgrade to zone1970.tab

zone.tab is deprecated. Install zone1970.tab alongside it, and use it
for tzsetup(8). This is also useful for other applications that need
the modern better maintained file.

Reviewed by: philip
Approved by: allanjude (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20646

# 963aa85d 08-Aug-2018 Xin LI <delphij@FreeBSD.org>

In read_zones(), check if the file name actually fit in the buffer
and make sure it would terminate with nul with strlcpy().

Reviewed by: imp (earlier revision)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16595

# eabfbad0 07-Aug-2017 Marius Strobl <marius@FreeBSD.org>

Revert the parts of r322097 related to /etc/wall_cmos_clock handling as
the previous behavior actually is required for setting up configurations
in which the RTC is using UTC but the timezone is not. Still, besides
uniform error handling, that file should get the same treatment in the
non-interactive variants supported by tzsetup(8).

# 4b382861 04-Aug-2017 Marius Strobl <marius@FreeBSD.org>

- Move creation and unlinking of /etc/wall_cmos_clock from the handling
of the initial UTC dialog to install_zoneinfo() so that file gets the
necessary treatment also when that dialog is skipped via "-s", when
selecting UTC from the time zone menu or on the command-line instead
etc.
- Make the initial UTC dialog actually work by giving the relevant files
the necessary treatment and then exit when choosing "Yes" there instead
of moving on to the time zone menu regardless.
- Since r301131, /etc/localtime is also installed when selecting UTC in
interactive configurations (which previously meant only via the time
zone menu, though). Thus, the code added in r230298 which treats a
NULL zone file name as UTC and removes /etc/localtime in that case can
go again.
- Consistently refer to "could not delete" (as chosen by the oldest such
code in here) when unlink(2) fails instead of a to mixture of "delete"
and "unlink" in error messages.

# 4fe54d42 22-Oct-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build of tzsetup when WITHOUT_DIALOG is set

Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped
down version (missing the dialog UI) but perfectly function tzsetup when
world is built WITHOUT_DIALOG

Reorganise a bit the code to limit the number of blocks under HAVE_DIALOG

Reviewed by: emaste
Sponsored by: https://reviews.freebsd.org/D8325

# dc30160e 01-Jun-2016 Steven Hartland <smh@FreeBSD.org>

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

# ee67f7cc 25-May-2016 Don Lewis <truckman@FreeBSD.org>

Avoid buffer overflow or truncation when constructing path_zoneinfo_file.

Reported by: Coverity
CID: 1011160
MFC after: 1 week

# b9165344 14-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use NULL instead of 0 for pointers.

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

# 427c435f 26-Oct-2015 Xin LI <delphij@FreeBSD.org>

Revert r289269 for now. After looking at share/zoneinfo/Makefile this could
potentially break non-root installs and we need a better solution, probably
by doing it differently when no UI is involved.

# a2668e81 13-Oct-2015 Xin LI <delphij@FreeBSD.org>

Use chroot(2) instead of using prefixes for files.

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

# b1abc637 19-Apr-2015 Eitan Adler <eadler@FreeBSD.org>

tzsetup: remove set but unused variable
- leave a comment explaining which variable it used to be

Reported by: gcc5.1

# 7e31e025 11-Nov-2014 Devin Teske <dteske@FreeBSD.org>

Fix whitespace.

Thanks to: nwhitehorn

# e91afc1c 11-Nov-2014 Devin Teske <dteske@FreeBSD.org>

Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM.

Recommended by: cperciva
Reviewed by: cperciva
Relnotes: tzsetup and bsdconfig now assume that the "hardware" clock inside a VM is set to UTC

# d2dc532d 04-Mar-2013 Devin Teske <dteske@FreeBSD.org>

Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option.

PR: bin/164976
Submitted by: dteske

# 41b549dc 07-Feb-2012 Garrett Wollman <wollman@FreeBSD.org>

It's not an error if unlink(2) fails because the pathname doesn't exist.

Noticed by: kevlo
Pointy hat to: wollman

# 3129859c 24-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Clean up reinstall option and remove duplicate code

- 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

# da4b02cf 17-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Fix #ifdef VERBOSE for UTC case

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

# e2027608 17-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Don't write /var/db/zoneinfo when zone is not actually changed.

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

# 8c261aea 11-Jan-2012 Garrett Wollman <wollman@FreeBSD.org>

Use a reasonable-sized buffer when formatting error messages about
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)

# fcc050e7 01-Dec-2011 Max Khon <fjoe@FreeBSD.org>

Sync xdialog_menu() implementation with sade.

# 8396c7de 24-Nov-2011 Max Khon <fjoe@FreeBSD.org>

calloc +1 DIALOG_LISTITEM to prevent possible wild pointer access
in dlg_default_listitem().

# 3567b2c4 24-Nov-2011 Max Khon <fjoe@FreeBSD.org>

Port to new libdialog.

# 983ac1b7 01-Nov-2011 Doug Barton <dougb@FreeBSD.org>

If the user is moving from any other time zone to UTC we need
to delete any old /var/db/zoneinfo file that may exist so that
tzsetup -r does the right thing.

# 81046d3c 20-May-2011 Ruslan Ermilov <ru@FreeBSD.org>

- add missing options and arguments to program's usage()
and sync it with manpage's SYNOPSIS

- generally clean up a manpage's formatting

Reviewed by: edwin

# 75a59404 30-Mar-2011 Edwin Groothuis <edwin@FreeBSD.org>

Add a menu entry for UTC in the main menu.

PR: bin/156019
Submitted by: Daniel O'Conner
Reviewed by: Garrett Cooper <gcooper@FreeBSD.org>
MFC after: 1 week

# 33ac3bc5 19-Jul-2010 Norikatsu Shigemura <nork@FreeBSD.org>

Fix support for chrooted installs.

Approved by: imp (mentor)

# 781e51d3 14-Jun-2010 Ed Maste <emaste@FreeBSD.org>

Use literal format strings. Found by clang.

# 7ba8f730 04-Jun-2010 Edwin Groothuis <edwin@FreeBSD.org>

Add comment that this value is unused.
It is obvious that it isn't used, but both clang and Coverity talk about it.

Found with: Coverity Prevent(tm)
CID: 8066

# 3b8d8bd7 04-Jun-2010 Edwin Groothuis <edwin@FreeBSD.org>

When there is a problem with writing, also bail out.

Found with the clang checker.

# b5f58d77 21-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

- Add support for chrooted installs.
- Add examples to the man-page.

MFC after: 1 week

# ada5f18a 20-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

Instead of having to know which timezone was picked last time, you
now can run "tzsetup -r" which will reinstall the last choice. This
data is recorded in /var/db/zoneinfo.

MFC after: 1 week

# 08c7e8c8 19-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

When tzsetup is run as non-root and the "CMOS clock question on
UTC" is answered as No, it would abort without properly ending the
dialog session.

MFC after: 1 week

# 5d279e65 04-Jul-2009 Attilio Rao <attilio@FreeBSD.org>

Add a new options (-s) that, when specified, skips the question about
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)

# 659a596a 03-Jun-2008 Jung-uk Kim <jkim@FreeBSD.org>

- Replace rcsid with __FBSDID.
- Remove paths.h and embed it in the source.
- Remove stale alpha support.
- Clean up compiler warnings and fix style(9) bugs.

# 62467b25 02-Jun-2008 Jung-uk Kim <jkim@FreeBSD.org>

Fix a crash when Arctic Ocean is selected.

MFC after: 1 week

# 84b7e70d 09-Aug-2004 Murray Stokely <murray@FreeBSD.org>

Update wording regarding geography to match the man page and web site.
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>

# 50c956f0 28-Nov-2003 Jimmy Olgeni <olgeni@FreeBSD.org>

Cosmetic fix: a message was mixed with a dialog box border line.

Approved by: re (rwatson)

# cb20e5a9 15-May-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Explicitly cast NCONTINENTS to int to silence an overflow warning.

# a956ec3b 05-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Default to UTC on sparc64 also.

# 2881e583 04-Apr-2001 David E. O'Brien <obrien@FreeBSD.org>

Default the UTC question to "yes" on the Alpha.

# d0d78e13 29-Dec-2000 Ben Smithurst <ben@FreeBSD.org>

Convert to use the <sys/queue.h> macros rather than fiddling with the queue
structure internals.

Reviewed by: markm

# 0e3099f5 15-Dec-2000 Jordan K. Hubbard <jkh@FreeBSD.org>

Use dialog_noyes() for UTC selection; uses No as default answer now.

# eb2fc780 09-Oct-2000 Garrett Wollman <wollman@FreeBSD.org>

Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and thereby
<time.h>).

# e3975643 25-May-2000 Jake Burkholder <jake@FreeBSD.org>

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others

# 740a1973 23-May-2000 Jake Burkholder <jake@FreeBSD.org>

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd

# bb897a87 23-Jan-2000 Philippe Charnier <charnier@FreeBSD.org>

Convert err() to errx(), reason is already provided. Complete the
abort on allocation failure instead of deferencing NULL later.

# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$

# c43651a6 05-Aug-1999 Ruslan Ermilov <ru@FreeBSD.org>

- ignore the user-supplied umask, set it to 0022 by default
- install /etc/wall_cmos_clock with 0444 mode rather than 0666
- -Wall inspection

PR: 12967

# 3256d507 22-Jun-1999 Michael Haro <mharo@FreeBSD.org>

Make UTC or local time message a little more clear.

# 239e57d0 02-Feb-1999 Garrett Wollman <wollman@FreeBSD.org>

Add a `default' feature to tzsetup for use in script-driven installation
(if someone writes the other half). Also rewrite the man page in a more
appropriate (formal) style.

# 8b315e85 15-Dec-1998 Peter Wemm <peter@FreeBSD.org>

Old stuff lying around a source tree:
Create/remove /etc/wall_cmos_clock without using system() and magic paths.

# f8ddb109 10-Jan-1998 Steve Price <steve@FreeBSD.org>

Minor brace gymnastics so that /etc/wall_cmos_clock is really
created.

PR: 5473
Submitted by: MIHIRA Yoshiro <sanpei@yy.cs.keio.ac.jp>

# 8f8262da 06-Nov-1997 Joerg Wunsch <joerg@FreeBSD.org>

Teach tzsetup to understand blank lines in the iso3166 file.

Found by: evanc@synapse.net (Evan Champion)

# 342afc34 27-Oct-1997 Philippe Charnier <charnier@FreeBSD.org>

Add usage(). Document -n flag. Do not touch/remove /etc/wall_cmos_clock
when -n (do nothing) is used.

# 476602a9 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$

# b9467913 16-Feb-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Ask about local or UTC here, like we used to.

# 3e70cf1f 01-Feb-1997 John Hay <jhay@FreeBSD.org>

At the end it was much simpler than I thought. 26 * 26 = 676 and not 576.
South Africa and a few other countries exists again. This fix pr 2595.
This should go into 2.2.

# c9af0102 21-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make some of the less necessary user feedback #ifdef VERBOSE.

We could also make this stuff only come out when getpid() != 1
and thus avoid the install case (where it really is just too verbose,
and people have complained), but this seems less messy and no one
complained when tzsetup didn't print the final "things went fine!"
messages (which sort of contravene the UNIX spirit of only yelling
when you need to anyway).

# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.

# b0fa330d 19-Nov-1996 Joerg Wunsch <joerg@FreeBSD.org>

Remove two uninitialized and unused variables that used to cause a
segfault before.

# 037def96 19-Nov-1996 Garrett Wollman <wollman@FreeBSD.org>

Completely re-vamped `tzsetup':

- It no longer attempts to fiddle wall-vs-UTC-in-RTC. The results
were just confusing most of the time.

- The program no longer contains a pre-compiled list of timezones
(compiled by groveling through the tzdata source files for comments
starting with `ZONE-DESCR'). Now it uses the new `zone.tab' file
supplied with current versions of the timezone data files, to determine
the list at run time. (It also requires the ISO 3166 table I
committed some months ago.)

AS A RESULT, this program will NOT work until the new timezone data files
are committed (should happen sometime soon).

# be0236eb 17-Dec-2021 Alfonso Siciliano <alfsiciliano@gmail.com>

tzsetup: Fix unicode support

Differential revision: https://reviews.freebsd.org/D33532


# 0a7e19b3 13-Dec-2021 Alfonso Siciliano <alfsiciliano@gmail.com>

tzsetup: adapt for libbsddialog 0.0.1

libbsdialog 0.0.1 provides:
* bsddialog_conf.auto_minwidth:
* menurows is variable with autosize (properly defines max menurows)

Then tzsetup can use BSDDIALOG_AUTOSIZE keeping the dialog behavior:
min 24 cols, max 16 menurows

Differential revision: https://reviews.freebsd.org/D33397


# 547fc67f 08-Dec-2021 Emmanuel Vadot <manu@FreeBSD.org>

tzsetup: Default to UTC

Restore old behavior.

Fixes: f872dde34c ("tzsetup: replace libdialog with libbsddialog")

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D33334
Sponsored by: Beckhoff Automation GmbH & Co. KG


# f499134d 06-Dec-2021 Baptiste Daroussin <bapt@FreeBSD.org>

bsddialog: import snapshot 2021-12-05


# 6ea39dd6 24-Nov-2021 Baptiste Daroussin <bapt@FreeBSD.org>

tzsetup: remove dedundant declaration

# f872dde3 15-Nov-2021 Baptiste Daroussin <bapt@FreeBSD.org>

tzsetup: replace libdialog with libbsddialog

Reviewed by: alfix86_gmail.com (bsddialog author)
Differential Revision: https://reviews.freebsd.org/D33077

# 7047dcee 10-Feb-2020 Warner Losh <imp@FreeBSD.org>

Remove sparc64 ifdef

Now we default to setting the hardware clock to UTC
everywhere. sparc64 was the old odd-man out before.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

# 513419f4 17-Jul-2019 Thomas Munro <tmunro@FreeBSD.org>

tzsetup: upgrade to zone1970.tab

zone.tab is deprecated. Install zone1970.tab alongside it, and use it
for tzsetup(8). This is also useful for other applications that need
the modern better maintained file.

Reviewed by: philip
Approved by: allanjude (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20646

# 963aa85d 08-Aug-2018 Xin LI <delphij@FreeBSD.org>

In read_zones(), check if the file name actually fit in the buffer
and make sure it would terminate with nul with strlcpy().

Reviewed by: imp (earlier revision)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16595

# eabfbad0 07-Aug-2017 Marius Strobl <marius@FreeBSD.org>

Revert the parts of r322097 related to /etc/wall_cmos_clock handling as
the previous behavior actually is required for setting up configurations
in which the RTC is using UTC but the timezone is not. Still, besides
uniform error handling, that file should get the same treatment in the
non-interactive variants supported by tzsetup(8).

# 4b382861 04-Aug-2017 Marius Strobl <marius@FreeBSD.org>

- Move creation and unlinking of /etc/wall_cmos_clock from the handling
of the initial UTC dialog to install_zoneinfo() so that file gets the
necessary treatment also when that dialog is skipped via "-s", when
selecting UTC from the time zone menu or on the command-line instead
etc.
- Make the initial UTC dialog actually work by giving the relevant files
the necessary treatment and then exit when choosing "Yes" there instead
of moving on to the time zone menu regardless.
- Since r301131, /etc/localtime is also installed when selecting UTC in
interactive configurations (which previously meant only via the time
zone menu, though). Thus, the code added in r230298 which treats a
NULL zone file name as UTC and removes /etc/localtime in that case can
go again.
- Consistently refer to "could not delete" (as chosen by the oldest such
code in here) when unlink(2) fails instead of a to mixture of "delete"
and "unlink" in error messages.

# 4fe54d42 22-Oct-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build of tzsetup when WITHOUT_DIALOG is set

Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped
down version (missing the dialog UI) but perfectly function tzsetup when
world is built WITHOUT_DIALOG

Reorganise a bit the code to limit the number of blocks under HAVE_DIALOG

Reviewed by: emaste
Sponsored by: https://reviews.freebsd.org/D8325

# dc30160e 01-Jun-2016 Steven Hartland <smh@FreeBSD.org>

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

# ee67f7cc 25-May-2016 Don Lewis <truckman@FreeBSD.org>

Avoid buffer overflow or truncation when constructing path_zoneinfo_file.

Reported by: Coverity
CID: 1011160
MFC after: 1 week

# b9165344 14-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use NULL instead of 0 for pointers.

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

# 427c435f 26-Oct-2015 Xin LI <delphij@FreeBSD.org>

Revert r289269 for now. After looking at share/zoneinfo/Makefile this could
potentially break non-root installs and we need a better solution, probably
by doing it differently when no UI is involved.

# a2668e81 13-Oct-2015 Xin LI <delphij@FreeBSD.org>

Use chroot(2) instead of using prefixes for files.

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

# b1abc637 19-Apr-2015 Eitan Adler <eadler@FreeBSD.org>

tzsetup: remove set but unused variable
- leave a comment explaining which variable it used to be

Reported by: gcc5.1

# 7e31e025 11-Nov-2014 Devin Teske <dteske@FreeBSD.org>

Fix whitespace.

Thanks to: nwhitehorn

# e91afc1c 11-Nov-2014 Devin Teske <dteske@FreeBSD.org>

Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM.

Recommended by: cperciva
Reviewed by: cperciva
Relnotes: tzsetup and bsdconfig now assume that the "hardware" clock inside a VM is set to UTC

# d2dc532d 04-Mar-2013 Devin Teske <dteske@FreeBSD.org>

Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option.

PR: bin/164976
Submitted by: dteske

# 41b549dc 07-Feb-2012 Garrett Wollman <wollman@FreeBSD.org>

It's not an error if unlink(2) fails because the pathname doesn't exist.

Noticed by: kevlo
Pointy hat to: wollman

# 3129859c 24-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Clean up reinstall option and remove duplicate code

- 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

# da4b02cf 17-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Fix #ifdef VERBOSE for UTC case

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

# e2027608 17-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Don't write /var/db/zoneinfo when zone is not actually changed.

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

# 8c261aea 11-Jan-2012 Garrett Wollman <wollman@FreeBSD.org>

Use a reasonable-sized buffer when formatting error messages about
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)

# fcc050e7 01-Dec-2011 Max Khon <fjoe@FreeBSD.org>

Sync xdialog_menu() implementation with sade.

# 8396c7de 24-Nov-2011 Max Khon <fjoe@FreeBSD.org>

calloc +1 DIALOG_LISTITEM to prevent possible wild pointer access
in dlg_default_listitem().

# 3567b2c4 24-Nov-2011 Max Khon <fjoe@FreeBSD.org>

Port to new libdialog.

# 983ac1b7 01-Nov-2011 Doug Barton <dougb@FreeBSD.org>

If the user is moving from any other time zone to UTC we need
to delete any old /var/db/zoneinfo file that may exist so that
tzsetup -r does the right thing.

# 81046d3c 20-May-2011 Ruslan Ermilov <ru@FreeBSD.org>

- add missing options and arguments to program's usage()
and sync it with manpage's SYNOPSIS

- generally clean up a manpage's formatting

Reviewed by: edwin

# 75a59404 30-Mar-2011 Edwin Groothuis <edwin@FreeBSD.org>

Add a menu entry for UTC in the main menu.

PR: bin/156019
Submitted by: Daniel O'Conner
Reviewed by: Garrett Cooper <gcooper@FreeBSD.org>
MFC after: 1 week

# 33ac3bc5 19-Jul-2010 Norikatsu Shigemura <nork@FreeBSD.org>

Fix support for chrooted installs.

Approved by: imp (mentor)

# 781e51d3 14-Jun-2010 Ed Maste <emaste@FreeBSD.org>

Use literal format strings. Found by clang.

# 7ba8f730 04-Jun-2010 Edwin Groothuis <edwin@FreeBSD.org>

Add comment that this value is unused.
It is obvious that it isn't used, but both clang and Coverity talk about it.

Found with: Coverity Prevent(tm)
CID: 8066

# 3b8d8bd7 04-Jun-2010 Edwin Groothuis <edwin@FreeBSD.org>

When there is a problem with writing, also bail out.

Found with the clang checker.

# b5f58d77 21-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

- Add support for chrooted installs.
- Add examples to the man-page.

MFC after: 1 week

# ada5f18a 20-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

Instead of having to know which timezone was picked last time, you
now can run "tzsetup -r" which will reinstall the last choice. This
data is recorded in /var/db/zoneinfo.

MFC after: 1 week

# 08c7e8c8 19-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

When tzsetup is run as non-root and the "CMOS clock question on
UTC" is answered as No, it would abort without properly ending the
dialog session.

MFC after: 1 week

# 5d279e65 04-Jul-2009 Attilio Rao <attilio@FreeBSD.org>

Add a new options (-s) that, when specified, skips the question about
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)

# 659a596a 03-Jun-2008 Jung-uk Kim <jkim@FreeBSD.org>

- Replace rcsid with __FBSDID.
- Remove paths.h and embed it in the source.
- Remove stale alpha support.
- Clean up compiler warnings and fix style(9) bugs.

# 62467b25 02-Jun-2008 Jung-uk Kim <jkim@FreeBSD.org>

Fix a crash when Arctic Ocean is selected.

MFC after: 1 week

# 84b7e70d 09-Aug-2004 Murray Stokely <murray@FreeBSD.org>

Update wording regarding geography to match the man page and web site.
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>

# 50c956f0 28-Nov-2003 Jimmy Olgeni <olgeni@FreeBSD.org>

Cosmetic fix: a message was mixed with a dialog box border line.

Approved by: re (rwatson)

# cb20e5a9 15-May-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Explicitly cast NCONTINENTS to int to silence an overflow warning.

# a956ec3b 05-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Default to UTC on sparc64 also.

# 2881e583 04-Apr-2001 David E. O'Brien <obrien@FreeBSD.org>

Default the UTC question to "yes" on the Alpha.

# d0d78e13 29-Dec-2000 Ben Smithurst <ben@FreeBSD.org>

Convert to use the <sys/queue.h> macros rather than fiddling with the queue
structure internals.

Reviewed by: markm

# 0e3099f5 15-Dec-2000 Jordan K. Hubbard <jkh@FreeBSD.org>

Use dialog_noyes() for UTC selection; uses No as default answer now.

# eb2fc780 09-Oct-2000 Garrett Wollman <wollman@FreeBSD.org>

Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and thereby
<time.h>).

# e3975643 25-May-2000 Jake Burkholder <jake@FreeBSD.org>

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others

# 740a1973 23-May-2000 Jake Burkholder <jake@FreeBSD.org>

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd

# bb897a87 23-Jan-2000 Philippe Charnier <charnier@FreeBSD.org>

Convert err() to errx(), reason is already provided. Complete the
abort on allocation failure instead of deferencing NULL later.

# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$

# c43651a6 05-Aug-1999 Ruslan Ermilov <ru@FreeBSD.org>

- ignore the user-supplied umask, set it to 0022 by default
- install /etc/wall_cmos_clock with 0444 mode rather than 0666
- -Wall inspection

PR: 12967

# 3256d507 22-Jun-1999 Michael Haro <mharo@FreeBSD.org>

Make UTC or local time message a little more clear.

# 239e57d0 02-Feb-1999 Garrett Wollman <wollman@FreeBSD.org>

Add a `default' feature to tzsetup for use in script-driven installation
(if someone writes the other half). Also rewrite the man page in a more
appropriate (formal) style.

# 8b315e85 15-Dec-1998 Peter Wemm <peter@FreeBSD.org>

Old stuff lying around a source tree:
Create/remove /etc/wall_cmos_clock without using system() and magic paths.

# f8ddb109 10-Jan-1998 Steve Price <steve@FreeBSD.org>

Minor brace gymnastics so that /etc/wall_cmos_clock is really
created.

PR: 5473
Submitted by: MIHIRA Yoshiro <sanpei@yy.cs.keio.ac.jp>

# 8f8262da 06-Nov-1997 Joerg Wunsch <joerg@FreeBSD.org>

Teach tzsetup to understand blank lines in the iso3166 file.

Found by: evanc@synapse.net (Evan Champion)

# 342afc34 27-Oct-1997 Philippe Charnier <charnier@FreeBSD.org>

Add usage(). Document -n flag. Do not touch/remove /etc/wall_cmos_clock
when -n (do nothing) is used.

# 476602a9 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$

# b9467913 16-Feb-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Ask about local or UTC here, like we used to.

# 3e70cf1f 01-Feb-1997 John Hay <jhay@FreeBSD.org>

At the end it was much simpler than I thought. 26 * 26 = 676 and not 576.
South Africa and a few other countries exists again. This fix pr 2595.
This should go into 2.2.

# c9af0102 21-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make some of the less necessary user feedback #ifdef VERBOSE.

We could also make this stuff only come out when getpid() != 1
and thus avoid the install case (where it really is just too verbose,
and people have complained), but this seems less messy and no one
complained when tzsetup didn't print the final "things went fine!"
messages (which sort of contravene the UNIX spirit of only yelling
when you need to anyway).

# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.

# b0fa330d 19-Nov-1996 Joerg Wunsch <joerg@FreeBSD.org>

Remove two uninitialized and unused variables that used to cause a
segfault before.

# 037def96 19-Nov-1996 Garrett Wollman <wollman@FreeBSD.org>

Completely re-vamped `tzsetup':

- It no longer attempts to fiddle wall-vs-UTC-in-RTC. The results
were just confusing most of the time.

- The program no longer contains a pre-compiled list of timezones
(compiled by groveling through the tzdata source files for comments
starting with `ZONE-DESCR'). Now it uses the new `zone.tab' file
supplied with current versions of the timezone data files, to determine
the list at run time. (It also requires the ISO 3166 table I
committed some months ago.)

AS A RESULT, this program will NOT work until the new timezone data files
are committed (should happen sometime soon).

# 6ea39dd6 24-Nov-2021 Baptiste Daroussin <bapt@FreeBSD.org>

tzsetup: remove dedundant declaration


# f872dde3 15-Nov-2021 Baptiste Daroussin <bapt@FreeBSD.org>

tzsetup: replace libdialog with libbsddialog

Reviewed by: alfix86_gmail.com (bsddialog author)
Differential Revision: https://reviews.freebsd.org/D33077


# 7047dcee 10-Feb-2020 Warner Losh <imp@FreeBSD.org>

Remove sparc64 ifdef

Now we default to setting the hardware clock to UTC
everywhere. sparc64 was the old odd-man out before.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593


# 513419f4 17-Jul-2019 Thomas Munro <tmunro@FreeBSD.org>

tzsetup: upgrade to zone1970.tab

zone.tab is deprecated. Install zone1970.tab alongside it, and use it
for tzsetup(8). This is also useful for other applications that need
the modern better maintained file.

Reviewed by: philip
Approved by: allanjude (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20646


# 963aa85d 08-Aug-2018 Xin LI <delphij@FreeBSD.org>

In read_zones(), check if the file name actually fit in the buffer
and make sure it would terminate with nul with strlcpy().

Reviewed by: imp (earlier revision)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16595


# eabfbad0 07-Aug-2017 Marius Strobl <marius@FreeBSD.org>

Revert the parts of r322097 related to /etc/wall_cmos_clock handling as
the previous behavior actually is required for setting up configurations
in which the RTC is using UTC but the timezone is not. Still, besides
uniform error handling, that file should get the same treatment in the
non-interactive variants supported by tzsetup(8).


# 4b382861 04-Aug-2017 Marius Strobl <marius@FreeBSD.org>

- Move creation and unlinking of /etc/wall_cmos_clock from the handling
of the initial UTC dialog to install_zoneinfo() so that file gets the
necessary treatment also when that dialog is skipped via "-s", when
selecting UTC from the time zone menu or on the command-line instead
etc.
- Make the initial UTC dialog actually work by giving the relevant files
the necessary treatment and then exit when choosing "Yes" there instead
of moving on to the time zone menu regardless.
- Since r301131, /etc/localtime is also installed when selecting UTC in
interactive configurations (which previously meant only via the time
zone menu, though). Thus, the code added in r230298 which treats a
NULL zone file name as UTC and removes /etc/localtime in that case can
go again.
- Consistently refer to "could not delete" (as chosen by the oldest such
code in here) when unlink(2) fails instead of a to mixture of "delete"
and "unlink" in error messages.


# 4fe54d42 22-Oct-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build of tzsetup when WITHOUT_DIALOG is set

Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped
down version (missing the dialog UI) but perfectly function tzsetup when
world is built WITHOUT_DIALOG

Reorganise a bit the code to limit the number of blocks under HAVE_DIALOG

Reviewed by: emaste
Sponsored by: https://reviews.freebsd.org/D8325


# dc30160e 01-Jun-2016 Steven Hartland <smh@FreeBSD.org>

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


# ee67f7cc 25-May-2016 Don Lewis <truckman@FreeBSD.org>

Avoid buffer overflow or truncation when constructing path_zoneinfo_file.

Reported by: Coverity
CID: 1011160
MFC after: 1 week


# b9165344 14-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use NULL instead of 0 for pointers.

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


# 427c435f 26-Oct-2015 Xin LI <delphij@FreeBSD.org>

Revert r289269 for now. After looking at share/zoneinfo/Makefile this could
potentially break non-root installs and we need a better solution, probably
by doing it differently when no UI is involved.


# a2668e81 13-Oct-2015 Xin LI <delphij@FreeBSD.org>

Use chroot(2) instead of using prefixes for files.

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


# b1abc637 19-Apr-2015 Eitan Adler <eadler@FreeBSD.org>

tzsetup: remove set but unused variable
- leave a comment explaining which variable it used to be

Reported by: gcc5.1


# 7e31e025 11-Nov-2014 Devin Teske <dteske@FreeBSD.org>

Fix whitespace.

Thanks to: nwhitehorn


# e91afc1c 11-Nov-2014 Devin Teske <dteske@FreeBSD.org>

Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM.

Recommended by: cperciva
Reviewed by: cperciva
Relnotes: tzsetup and bsdconfig now assume that the "hardware" clock inside a VM is set to UTC


# d2dc532d 04-Mar-2013 Devin Teske <dteske@FreeBSD.org>

Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option.

PR: bin/164976
Submitted by: dteske


# 41b549dc 07-Feb-2012 Garrett Wollman <wollman@FreeBSD.org>

It's not an error if unlink(2) fails because the pathname doesn't exist.

Noticed by: kevlo
Pointy hat to: wollman


# 3129859c 24-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Clean up reinstall option and remove duplicate code

- 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


# da4b02cf 17-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Fix #ifdef VERBOSE for UTC case

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


# e2027608 17-Jan-2012 Ed Maste <emaste@FreeBSD.org>

Don't write /var/db/zoneinfo when zone is not actually changed.

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


# 8c261aea 11-Jan-2012 Garrett Wollman <wollman@FreeBSD.org>

Use a reasonable-sized buffer when formatting error messages about
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)


# fcc050e7 01-Dec-2011 Max Khon <fjoe@FreeBSD.org>

Sync xdialog_menu() implementation with sade.


# 8396c7de 24-Nov-2011 Max Khon <fjoe@FreeBSD.org>

calloc +1 DIALOG_LISTITEM to prevent possible wild pointer access
in dlg_default_listitem().


# 3567b2c4 24-Nov-2011 Max Khon <fjoe@FreeBSD.org>

Port to new libdialog.


# 983ac1b7 01-Nov-2011 Doug Barton <dougb@FreeBSD.org>

If the user is moving from any other time zone to UTC we need
to delete any old /var/db/zoneinfo file that may exist so that
tzsetup -r does the right thing.


# 81046d3c 20-May-2011 Ruslan Ermilov <ru@FreeBSD.org>

- add missing options and arguments to program's usage()
and sync it with manpage's SYNOPSIS

- generally clean up a manpage's formatting

Reviewed by: edwin


# 75a59404 30-Mar-2011 Edwin Groothuis <edwin@FreeBSD.org>

Add a menu entry for UTC in the main menu.

PR: bin/156019
Submitted by: Daniel O'Conner
Reviewed by: Garrett Cooper <gcooper@FreeBSD.org>
MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 33ac3bc5 19-Jul-2010 Norikatsu Shigemura <nork@FreeBSD.org>

Fix support for chrooted installs.

Approved by: imp (mentor)


# 781e51d3 14-Jun-2010 Ed Maste <emaste@FreeBSD.org>

Use literal format strings. Found by clang.


# 7ba8f730 04-Jun-2010 Edwin Groothuis <edwin@FreeBSD.org>

Add comment that this value is unused.
It is obvious that it isn't used, but both clang and Coverity talk about it.

Found with: Coverity Prevent(tm)
CID: 8066


# 3b8d8bd7 04-Jun-2010 Edwin Groothuis <edwin@FreeBSD.org>

When there is a problem with writing, also bail out.

Found with the clang checker.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# b5f58d77 21-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

- Add support for chrooted installs.
- Add examples to the man-page.

MFC after: 1 week


# ada5f18a 20-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

Instead of having to know which timezone was picked last time, you
now can run "tzsetup -r" which will reinstall the last choice. This
data is recorded in /var/db/zoneinfo.

MFC after: 1 week


# 08c7e8c8 19-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

When tzsetup is run as non-root and the "CMOS clock question on
UTC" is answered as No, it would abort without properly ending the
dialog session.

MFC after: 1 week


# 5d279e65 04-Jul-2009 Attilio Rao <attilio@FreeBSD.org>

Add a new options (-s) that, when specified, skips the question about
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)


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 659a596a 03-Jun-2008 Jung-uk Kim <jkim@FreeBSD.org>

- Replace rcsid with __FBSDID.
- Remove paths.h and embed it in the source.
- Remove stale alpha support.
- Clean up compiler warnings and fix style(9) bugs.


# 62467b25 02-Jun-2008 Jung-uk Kim <jkim@FreeBSD.org>

Fix a crash when Arctic Ocean is selected.

MFC after: 1 week


# 84b7e70d 09-Aug-2004 Murray Stokely <murray@FreeBSD.org>

Update wording regarding geography to match the man page and web site.
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>


# 50c956f0 28-Nov-2003 Jimmy Olgeni <olgeni@FreeBSD.org>

Cosmetic fix: a message was mixed with a dialog box border line.

Approved by: re (rwatson)


# cb20e5a9 15-May-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Explicitly cast NCONTINENTS to int to silence an overflow warning.


# a956ec3b 05-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Default to UTC on sparc64 also.


# 2881e583 04-Apr-2001 David E. O'Brien <obrien@FreeBSD.org>

Default the UTC question to "yes" on the Alpha.


# d0d78e13 29-Dec-2000 Ben Smithurst <ben@FreeBSD.org>

Convert to use the <sys/queue.h> macros rather than fiddling with the queue
structure internals.

Reviewed by: markm


# 0e3099f5 15-Dec-2000 Jordan K. Hubbard <jkh@FreeBSD.org>

Use dialog_noyes() for UTC selection; uses No as default answer now.


# eb2fc780 09-Oct-2000 Garrett Wollman <wollman@FreeBSD.org>

Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and thereby
<time.h>).


# e3975643 25-May-2000 Jake Burkholder <jake@FreeBSD.org>

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


# 740a1973 23-May-2000 Jake Burkholder <jake@FreeBSD.org>

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd


# bb897a87 23-Jan-2000 Philippe Charnier <charnier@FreeBSD.org>

Convert err() to errx(), reason is already provided. Complete the
abort on allocation failure instead of deferencing NULL later.


# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# c43651a6 05-Aug-1999 Ruslan Ermilov <ru@FreeBSD.org>

- ignore the user-supplied umask, set it to 0022 by default
- install /etc/wall_cmos_clock with 0444 mode rather than 0666
- -Wall inspection

PR: 12967


# 3256d507 22-Jun-1999 Michael Haro <mharo@FreeBSD.org>

Make UTC or local time message a little more clear.


# 239e57d0 02-Feb-1999 Garrett Wollman <wollman@FreeBSD.org>

Add a `default' feature to tzsetup for use in script-driven installation
(if someone writes the other half). Also rewrite the man page in a more
appropriate (formal) style.


# 8b315e85 15-Dec-1998 Peter Wemm <peter@FreeBSD.org>

Old stuff lying around a source tree:
Create/remove /etc/wall_cmos_clock without using system() and magic paths.


# f8ddb109 10-Jan-1998 Steve Price <steve@FreeBSD.org>

Minor brace gymnastics so that /etc/wall_cmos_clock is really
created.

PR: 5473
Submitted by: MIHIRA Yoshiro <sanpei@yy.cs.keio.ac.jp>


# 8f8262da 06-Nov-1997 Joerg Wunsch <joerg@FreeBSD.org>

Teach tzsetup to understand blank lines in the iso3166 file.

Found by: evanc@synapse.net (Evan Champion)


# 342afc34 27-Oct-1997 Philippe Charnier <charnier@FreeBSD.org>

Add usage(). Document -n flag. Do not touch/remove /etc/wall_cmos_clock
when -n (do nothing) is used.


# 476602a9 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# b9467913 16-Feb-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Ask about local or UTC here, like we used to.


# 3e70cf1f 01-Feb-1997 John Hay <jhay@FreeBSD.org>

At the end it was much simpler than I thought. 26 * 26 = 676 and not 576.
South Africa and a few other countries exists again. This fix pr 2595.
This should go into 2.2.


# c9af0102 21-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make some of the less necessary user feedback #ifdef VERBOSE.

We could also make this stuff only come out when getpid() != 1
and thus avoid the install case (where it really is just too verbose,
and people have complained), but this seems less messy and no one
complained when tzsetup didn't print the final "things went fine!"
messages (which sort of contravene the UNIX spirit of only yelling
when you need to anyway).


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# b0fa330d 19-Nov-1996 Joerg Wunsch <joerg@FreeBSD.org>

Remove two uninitialized and unused variables that used to cause a
segfault before.


# 037def96 19-Nov-1996 Garrett Wollman <wollman@FreeBSD.org>

Completely re-vamped `tzsetup':

- It no longer attempts to fiddle wall-vs-UTC-in-RTC. The results
were just confusing most of the time.

- The program no longer contains a pre-compiled list of timezones
(compiled by groveling through the tzdata source files for comments
starting with `ZONE-DESCR'). Now it uses the new `zone.tab' file
supplied with current versions of the timezone data files, to determine
the list at run time. (It also requires the ISO 3166 table I
committed some months ago.)

AS A RESULT, this program will NOT work until the new timezone data files
are committed (should happen sometime soon).