diff options
-rw-r--r-- | php-7.0.0-systzdata-v12.patch (renamed from php-7.0.0-systzdata-v11.patch) | 111 | ||||
-rw-r--r-- | php.spec | 11 |
2 files changed, 70 insertions, 52 deletions
diff --git a/php-7.0.0-systzdata-v11.patch b/php-7.0.0-systzdata-v12.patch index 8d1fd05..6232ba2 100644 --- a/php-7.0.0-systzdata-v11.patch +++ b/php-7.0.0-systzdata-v12.patch @@ -2,6 +2,7 @@ Add support for use of the system timezone database, rather than embedding a copy. Discussed upstream but was not desired. History: +r12: adapt for upstream changes for new zic r11: use canonical names to avoid more case sensitivity issues round lat/long from zone.tab towards zero per builtin db r10: make timezone case insensitive @@ -19,9 +20,9 @@ r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert) r2: add filesystem trawl to set up name alias index r1: initial revision -diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz.c.systzdata php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz.c ---- php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz.c.systzdata 2015-03-25 08:59:09.894376319 +0100 -+++ php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz.c 2015-03-25 08:59:22.052426045 +0100 +diff -up php-src-1a4d3e4855619538eb1902b8513473e2cda76804/ext/date/lib/parse_tz.c.systzdata php-src-1a4d3e4855619538eb1902b8513473e2cda76804/ext/date/lib/parse_tz.c +--- php-src-1a4d3e4855619538eb1902b8513473e2cda76804/ext/date/lib/parse_tz.c.systzdata 2015-04-26 12:04:54.000000000 +0200 ++++ php-src-1a4d3e4855619538eb1902b8513473e2cda76804/ext/date/lib/parse_tz.c 2015-04-27 13:02:48.713660916 +0200 @@ -20,6 +20,16 @@ #include "timelib.h" @@ -52,19 +53,19 @@ diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz. #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) # if defined(__LITTLE_ENDIAN__) -@@ -51,6 +66,11 @@ - - static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz) +@@ -53,6 +68,11 @@ static int read_preamble(const unsigned { -+ if (memcmp(tzf, "TZif", 4) == 0) { + uint32_t version; + ++ if (memcmp(*tzf, "TZif", 4) == 0) { + *tzf += 20; -+ return; ++ return 0; + } + - /* skip ID */ + /* read ID */ + version = (*tzf)[3] - '0'; *tzf += 4; - -@@ -256,7 +276,418 @@ void timelib_dump_tzinfo(timelib_tzinfo +@@ -296,7 +316,418 @@ void timelib_dump_tzinfo(timelib_tzinfo } } @@ -102,11 +103,11 @@ diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz. + const unsigned char *p = (const unsigned char *)str; + uint32_t hash = 5381; + int c; -+ ++ + while ((c = tolower(*p++)) != '\0') { + hash = (hash << 5) ^ hash ^ c; + } -+ ++ + return hash % LOCINFO_HASH_SIZE; +} + @@ -484,11 +485,12 @@ diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz. { int left = 0, right = tzdb->index_size - 1; #ifdef HAVE_SETLOCALE -@@ -295,36 +726,135 @@ static int seek_to_tz_position(const uns +@@ -335,21 +766,88 @@ static int seek_to_tz_position(const uns return 0; } -+static int seek_to_tz_position(const unsigned char **tzf, char *timezone, ++ ++static int seek_to_tz_position(const unsigned char **tzf, char *timezone, + char **map, size_t *maplen, + const timelib_tzdb *tzdb) +{ @@ -500,15 +502,14 @@ diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz. + if (orig == NULL) { + return 0; + } -+ -+ (*tzf) = (unsigned char *)orig ; ++ ++ (*tzf) = (unsigned char *)orig; + *map = orig; -+ -+ return 1; ++ return 1; + } -+ else ++ else +#endif -+ { ++ { + return inmem_seek_to_tz_position(tzf, timezone, tzdb); + } +} @@ -523,11 +524,10 @@ diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz. + tmp->data = NULL; + create_zone_index(tmp); + system_location_table = create_location_table(); -+ fake_data_segment(tmp, system_location_table); ++ fake_data_segment(tmp, system_location_table); + timezonedb_system = tmp; + } + -+ + return timezonedb_system; +#else return &timezonedb_builtin; @@ -549,48 +549,54 @@ diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz. { const unsigned char *tzf; - return (seek_to_tz_position(&tzf, timezone, tzdb)); -+ +#ifdef HAVE_SYSTEM_TZDATA -+ if (tzdb == timezonedb_system) { -+ char fname[PATH_MAX]; -+ struct stat st; -+ -+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { -+ return 0; -+ } -+ -+ if (system_location_table) { -+ if (find_zone_info(system_location_table, timezone) != NULL) { -+ /* found in cache */ -+ return 1; -+ } -+ } -+ -+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone)); -+ -+ return stat(fname, &st) == 0 && is_valid_tzfile(&st); -+ } ++ if (tzdb == timezonedb_system) { ++ char fname[PATH_MAX]; ++ struct stat st; ++ ++ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { ++ return 0; ++ } ++ ++ if (system_location_table) { ++ if (find_zone_info(system_location_table, timezone) != NULL) { ++ /* found in cache */ ++ return 1; ++ } ++ } ++ ++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone)); ++ ++ return stat(fname, &st) == 0 && is_valid_tzfile(&st); ++ } +#endif + + return (inmem_seek_to_tz_position(&tzf, timezone, tzdb)); } + static void skip_2nd_header_and_data(const unsigned char **tzf, timelib_tzinfo *tz) +@@ -361,23 +859,53 @@ static void skip_2nd_header_and_data(con timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb) { const unsigned char *tzf; + char *memmap = NULL; + size_t maplen; timelib_tzinfo *tmp; + int version; - if (seek_to_tz_position(&tzf, timezone, tzdb)) { + if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) { tmp = timelib_tzinfo_ctor(timezone); - read_preamble(&tzf, tmp); + version = read_preamble(&tzf, tmp); read_header(&tzf, tmp); read_transistions(&tzf, tmp); read_types(&tzf, tmp); -- read_location(&tzf, tmp); +- if (version == 2) { +- skip_2nd_header_and_data(&tzf, tmp); +- skip_transistions_64bit(&tzf, tmp); +- skip_types_64bit(&tzf, tmp); +- skip_posix_string(&tzf, tmp); + +#ifdef HAVE_SYSTEM_TZDATA + if (memmap) { @@ -618,14 +624,21 @@ diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/parse_tz. +#endif + { + /* PHP-style - use the embedded info. */ ++ if (version == 2) { ++ skip_2nd_header_and_data(&tzf, tmp); ++ skip_transistions_64bit(&tzf, tmp); ++ skip_types_64bit(&tzf, tmp); ++ skip_posix_string(&tzf, tmp); ++ } + read_location(&tzf, tmp); -+ } + } +- read_location(&tzf, tmp); } else { tmp = NULL; } -diff -up php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/timelib.m4.systzdata php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/timelib.m4 ---- php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/timelib.m4.systzdata 2015-03-25 07:01:04.000000000 +0100 -+++ php-src-02be73b5fac63a02313b9fe0f204c65d4828edeb/ext/date/lib/timelib.m4 2015-03-25 08:56:30.412724035 +0100 +diff -up php-src-1a4d3e4855619538eb1902b8513473e2cda76804/ext/date/lib/timelib.m4.systzdata php-src-1a4d3e4855619538eb1902b8513473e2cda76804/ext/date/lib/timelib.m4 +--- php-src-1a4d3e4855619538eb1902b8513473e2cda76804/ext/date/lib/timelib.m4.systzdata 2015-04-26 12:04:54.000000000 +0200 ++++ php-src-1a4d3e4855619538eb1902b8513473e2cda76804/ext/date/lib/timelib.m4 2015-04-27 12:51:05.568644759 +0200 @@ -78,3 +78,17 @@ stdlib.h dnl Check for strtoll, atoll @@ -129,9 +129,9 @@ %global db_devel libdb-devel %endif -%global gh_commit 1f0a6241b496220d6039aac425396fd177ad4be6 +%global gh_commit 1a4d3e4855619538eb1902b8513473e2cda76804 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_date 20150418 +%global gh_date 20150427 %global gh_owner php %global gh_project php-src #global rcver RC1 @@ -181,7 +181,7 @@ Patch21: php-7.0.0-odbctimer.patch # Functional changes Patch40: php-7.0.0-dlopen.patch -Patch42: php-7.0.0-systzdata-v11.patch +Patch42: php-7.0.0-systzdata-v12.patch # See http://bugs.php.net/53436 Patch43: php-5.4.0-phpize.patch # Use -lldap_r for OpenLDAP @@ -948,6 +948,7 @@ rm ext/date/tests/timezone_version_get_basic1.phpt rm ext/sockets/tests/mcast_ipv?_recv.phpt # cause stack exhausion rm Zend/tests/bug54268.phpt +rm Zend/tests/bug68412.phpt # Safety check for API version change. pver=$(sed -n '/#define PHP_VERSION /{s/.* "//;s/".*$//;p}' main/php_version.h) @@ -1804,6 +1805,10 @@ fi %changelog +* Mon Apr 27 2015 Remi Collet <remi@fedoraproject.org> 7.0.0-0.5.20150427git1a4d3e4 +- new snapshot +- adapt system tzdata patch for upstream change for new zic + * Sat Apr 18 2015 Remi Collet <remi@fedoraproject.org> 7.0.0-0.5.20150418git1f0a624 - new snapshot |