[php-maint] Bug#776564: Patched php5 does not emit error when timezone database is unavailable

Jorrit Schippers - nCode jorrit at ncode.nl
Thu Jan 29 10:36:29 UTC 2015


Package: php5
Version: 5.6.5+dfsg-1
Severity: minor

I am reporting an issue with the Ubuntu version of this package deliberately
with Debian, because the issue lies with the Debian-maintained system
timezone database patch.

use_embedded_timezonedb.patch changes the behavior of the php5 package such
that it reads timezone information from /usr/share/zoneinfo. Among other
files, it reads /usr/share/zoneinfo/zone.tab. On a system I use, this file
was erroneously unavailable due to chroot and not mapping the file properly.
This caused various PHP functions to malfunction with no error or an error
that was hard to debug.

new DateTimeZone('UTC') : Exception: 'Unknown or bad timezone (UTC)'
timezone_identifiers_list() : empty result

The patch does not emit any warning when /usr/share/zoneinfo/zone.tab can't
be read. I suggest adding a warning or error using the regular PHP error
logging functions.

The relevant code of the patch:

+static struct location_info **create_location_table(void)
...
+    fp = fopen(zone_tab, "r");
+    if (!fp) {
+        return NULL;
+    }

NULL is ignored silently in other parts of the code.

Kind regards,

Jorrit Schippers



More information about the pkg-php-maint mailing list