Bug 197313 - tzsetup(8): -C option displays UTC message to user
Summary: tzsetup(8): -C option displays UTC message to user
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-04 04:39 UTC by Nick Frampton
Modified: 2015-10-27 00:38 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Frampton 2015-02-04 04:39:12 UTC
When no zoneinfo data is present on the running system, but is present in a
chroot environment, tzsetup -C incorrectly displays the message "Does the
abbreviation 'UTC' look reasonable?" regardless of the time zone selected.

tzsetup does not do a chroot(2) system call.  Instead, it simulates the effect
by prefixing all paths with the chroot environment.

The problem is that when tzsetup is going to verify your configuration, it
would use tzset(3), which does not respect the simulated chroot effect.  When
no zoneinfo data is present, everything would be considered as UTC.
Comment 1 Xin LI freebsd_committer freebsd_triage 2015-10-13 22:55:39 UTC
Fixed in -HEAD as r289269.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-10-13 22:55:48 UTC
A commit references this bug:

Author: delphij
Date: Tue Oct 13 22:55:17 UTC 2015
New revision: 289269
URL: https://svnweb.freebsd.org/changeset/base/289269

Log:
  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

Changes:
  head/usr.sbin/tzsetup/tzsetup.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-10-27 00:37:49 UTC
A commit references this bug:

Author: delphij
Date: Tue Oct 27 00:37:19 UTC 2015
New revision: 290027
URL: https://svnweb.freebsd.org/changeset/base/290027

Log:
  MFC r289269:

  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

Changes:
_U  stable/10/
  stable/10/usr.sbin/tzsetup/tzsetup.c
Comment 4 Xin LI freebsd_committer freebsd_triage 2015-10-27 00:38:15 UTC
This have been merged to stable/10, thanks for notifying.