Bug 194173 - Timezones (zoneinfo) starting from October 2014 wrong for Russia, etc
Summary: Timezones (zoneinfo) starting from October 2014 wrong for Russia, etc
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.3-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: Xin LI
Depends on:
Reported: 2014-10-05 19:56 UTC by leo
Modified: 2014-10-22 23:15 UTC (History)
5 users (show)

See Also:

Package with zoneinfo data files (111.87 KB, application/x-xz)
2014-10-05 20:49 UTC, leo
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description leo 2014-10-05 19:56:35 UTC
The current installed version of FreeBSD 8.4-RELEASE-p16, 9.3-RELEASE-p2 and 10.0-RELEASE-p9 incorrectly convert UTC to/from local time. Differences between actual zoneinfo IANA and FreeBSD versions [name wrong source file from the directory contrib/tzdata (share/zoneinfo); country; one of the cities for which an error has been observed; the near future for which the observed error]:

FreeBSD 8.4-RELEASE-p16:

europe  Russia          Europe/Moscow   (26 Oct 2014)
africa  Egypt           Africa/Cairo    (24 Apr 2015)
        Libya           Africa/Tripoli  (31 Oct 2014)
asia    Palestine       Asia/Hebron     (27 Mar 2015)
        Zion            Asia/Jerusalem  (6 Oct 2014)

FreeBSD 10.0-RELEASE-p9:

europe  Russia          Europe/Moscow   (26 Oct 2014)
africa  Egypt           Africa/Cairo    (24 Apr 2015)

FreeBSD 9.3-RELEASE-p2:

europe  Russia          Europe/Moscow   (26 Oct 2014)


1. Temporarily use the current version of /usr/ports/misc/zoneinfo (see attachment zoneinfo-2014.f.txz):
    # portsnap fetch
    # portsnap update
    # cd /usr/ports/misc/zoneinfo
    # make install
    Add WITHOUT_ZONEINFO="yes" to your /etc/src.conf;
    Run tzsetup(8) again to install the right file to /etc/localtime.

2. Copy directory /usr/share/zoneinfo from FreeBSD stable/8, stable/9 or 10.1-RC1.

Updated source files, see: 



Comment 1 leo 2014-10-05 20:28:55 UTC
Require changes only zone info data files (one, two, or three files). C code or command files changes do not require.

-- Sorry for my best English.
Comment 2 leo 2014-10-05 20:49:10 UTC
Created attachment 148016 [details]
Package with zoneinfo data files
Comment 3 leo 2014-10-06 18:15:20 UTC
Also, this problem may cause application errors. For example:

[XXX@YYY ~]# freebsd-upgrade fetch
[XXX@YYY ~]# freebsd-upgrade install
[XXX@YYY ~]# pkg upgrade
[XXX@YYY ~]# date +'%d.%m.%Y %H:%M:%S %Z'
27.10.2014 12:30:00 MSK
[XXX@YYY ~]# TZ=Europe/Moscow date +'%d.%m.%Y %H:%M:%S %Z'
27.10.2014 12:30:06 MSK

[XXX@YYY ~]# php -r '
echo date("r e\n");'
Mon, 27 Oct 2014 11:30:21 +0300 Europe/Moscow

[XXX@YYY ~]# ruby -e "require 'tzinfo' ;
puts TZInfo::Timezone.get('Europe/Moscow').strftime('%d.%m.%Y %H:%M:%S %Z')"
27.10.2014 11:30:33 MSK

libc localtime may differ from localtime ruby, php and others with unpredictable consequences
Comment 4 Victor Sudakov 2014-10-09 02:05:47 UTC
I think outdated timezone information is a critical condition affecting many installations in various ways, so the updated timezone files should make it into the security branch, be available via freebsd-update etc. as a critical update.
Comment 5 Victor Sudakov 2014-10-09 02:07:25 UTC
And yes, we have a precedent set by https://www.freebsd.org/security/advisories/FreeBSD-EN-07:04.zoneinfo.asc
Comment 6 Xin LI freebsd_committer 2014-10-09 17:17:55 UTC
re@ will issue an errata for this.
Comment 7 Xin LI freebsd_committer 2014-10-22 00:14:46 UTC
Patch committed to all supported release errata branches.  Errata notice will be out really soon.
Comment 8 leo 2014-10-22 19:10:24 UTC
Thank you. Possible Errata should be mentioned that some FreeBSD ported application does not use the system zoneinfo, so additionally you may need to update packages. As far as I know: php, ruby, java, perl (DateTime module), such updates available for `pkg update'.
-- Sorry for my best English
Comment 9 leo 2014-10-22 23:15:30 UTC
Congratulations. <https://www.freebsd.org/security/advisories/FreeBSD-EN-14:10.tzdata.asc> was published. However, IMHO, there is one inaccuracy in section "V. Solution", pp. 1 and 2 look right, if I remember correctly, and update the system and `make install world' implicitly run `tzsetup -r' in the process of their work, but `freebsd-update install' not start `tzsetup -r'. Therefore, p.3 need to add:

# freebsd-update fetch
# freebsd-update install
# tzsetup -r

For install zone info updates to /etc/localtime