diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-11-01 12:21:54 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-11-01 12:23:20 -0200 |
commit | add913b1437bf56b61a4ae8739e7a426b8267aff (patch) | |
tree | 90cca2d20e26d7d0cdc22e2622f0c09c0ef54e26 /etc/inc/system.inc | |
parent | d1f6c3bf9794b1fdadc1a512503d82440f7ecf7b (diff) | |
download | pfsense-add913b1437bf56b61a4ae8739e7a426b8267aff.zip pfsense-add913b1437bf56b61a4ae8739e7a426b8267aff.tar.gz |
Teach system_timezone_configure() to deal with symlinks to avoid having timezone misconfigured. This fixes #3293
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 405785d..035c5de 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1273,7 +1273,17 @@ function system_timezone_configure() { /* extract appropriate timezone file */ $timezone = $syscfg['timezone']; - if (!$timezone) + if ($timezone) { + exec('/usr/bin/tar -tvzf /usr/share/zoneinfo.tgz', $tzs); + foreach ($tzs as $tz) { + if (preg_match(",{$timezone}$,", $tz)) + break; + if (preg_match(",{$timezone} link to *(.*)$,", $tz, $matches)) { + $timezone = $matches[1]; + break; + } + } + } else $timezone = "Etc/UTC"; conf_mount_rw(); |