From 870608984c1d51850a8db5e0a3ab04d2986973d6 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 1 Nov 2013 12:21:54 -0200 Subject: Teach system_timezone_configure() to deal with symlinks to avoid having timezone misconfigured. This fixes #3293 --- etc/inc/system.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'etc/inc/system.inc') 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(); -- cgit v1.1