summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-11-01 12:21:54 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-11-01 12:21:54 -0200
commit870608984c1d51850a8db5e0a3ab04d2986973d6 (patch)
treec1bc510b0860fb87b1d1ba7db49e11e560420666 /etc/inc/system.inc
parent6ae050ae0ef0f8d6c2c9ca7c41cd430796891f6d (diff)
downloadpfsense-870608984c1d51850a8db5e0a3ab04d2986973d6.zip
pfsense-870608984c1d51850a8db5e0a3ab04d2986973d6.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.inc12
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index f828c61..58408b6 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -1214,7 +1214,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();
OpenPOWER on IntegriCloud