diff options
-rw-r--r-- | php-5.6.9-newzic.patch | 160 | ||||
-rw-r--r-- | php-5.6.9-systzdata-v12.patch | 37 | ||||
-rw-r--r-- | php.spec | 11 |
3 files changed, 26 insertions, 182 deletions
diff --git a/php-5.6.9-newzic.patch b/php-5.6.9-newzic.patch deleted file mode 100644 index d260dad..0000000 --- a/php-5.6.9-newzic.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 957aa220aa175a874f429f97701eede0f1ef14d3 Mon Sep 17 00:00:00 2001 -From: Derick Rethans <github@derickrethans.nl> -Date: Sun, 26 Apr 2015 11:04:16 +0100 -Subject: [PATCH] Fixed location reading due to file format changes - ---- - ext/date/lib/parse_tz.c | 61 ++- - ext/date/lib/timezonedb.h | 1166 ++++++++++++++++++++++----------------------- - 2 files changed, 640 insertions(+), 587 deletions(-) - -diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c -index ec7c6d3..89b8af7 100644 ---- a/ext/date/lib/parse_tz.c -+++ b/ext/date/lib/parse_tz.c -@@ -49,9 +49,12 @@ - #define timelib_conv_int(l) ((l & 0x000000ff) << 24) + ((l & 0x0000ff00) << 8) + ((l & 0x00ff0000) >> 8) + ((l & 0xff000000) >> 24) - #endif - --static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz) -+static int read_preamble(const unsigned char **tzf, timelib_tzinfo *tz) - { -- /* skip ID */ -+ uint32_t version; -+ -+ /* read ID */ -+ version = (*tzf)[3] - '0'; - *tzf += 4; - - /* read BC flag */ -@@ -63,8 +66,10 @@ static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz) - tz->location.country_code[2] = '\0'; - *tzf += 2; - -- /* skip read of preamble */ -+ /* skip rest of preamble */ - *tzf += 13; -+ -+ return version; - } - - static void read_header(const unsigned char **tzf, timelib_tzinfo *tz) -@@ -81,6 +86,14 @@ static void read_header(const unsigned char **tzf, timelib_tzinfo *tz) - *tzf += sizeof(buffer); - } - -+static void skip_transistions_64bit(const unsigned char **tzf, timelib_tzinfo *tz) -+{ -+ if (tz->timecnt) { -+ *tzf += (sizeof(int64_t) * (tz->timecnt + 1)); -+ *tzf += (sizeof(unsigned char) * (tz->timecnt + 1)); -+ } -+} -+ - static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz) - { - int32_t *buffer = NULL; -@@ -111,6 +124,21 @@ static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz) - tz->trans_idx = cbuffer; - } - -+static void skip_types_64bit(const unsigned char **tzf, timelib_tzinfo *tz) -+{ -+ *tzf += sizeof(unsigned char) * 6 * tz->typecnt; -+ *tzf += sizeof(char) * tz->charcnt; -+ if (tz->leapcnt) { -+ *tzf += sizeof(int64_t) * tz->leapcnt * 2; -+ } -+ if (tz->ttisstdcnt) { -+ *tzf += sizeof(unsigned char) * tz->ttisstdcnt; -+ } -+ if (tz->ttisgmtcnt) { -+ *tzf += sizeof(unsigned char) * tz->ttisgmtcnt; -+ } -+} -+ - static void read_types(const unsigned char **tzf, timelib_tzinfo *tz) - { - unsigned char *buffer; -@@ -194,6 +222,18 @@ static void read_types(const unsigned char **tzf, timelib_tzinfo *tz) - } - } - -+static void skip_posix_string(const unsigned char **tzf, timelib_tzinfo *tz) -+{ -+ int n_count = 0; -+ -+ do { -+ if (*tzf[0] == '\n') { -+ n_count++; -+ } -+ (*tzf)++; -+ } while (n_count < 2); -+} -+ - static void read_location(const unsigned char **tzf, timelib_tzinfo *tz) - { - uint32_t buffer[3]; -@@ -312,18 +352,31 @@ int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb) - return (seek_to_tz_position(&tzf, timezone, tzdb)); - } - -+static void skip_2nd_header_and_data(const unsigned char **tzf, timelib_tzinfo *tz) -+{ -+ *tzf += 20; /* skip 2nd header (preamble) */ -+ *tzf += sizeof(int32_t) * 6; /* Counts */ -+} -+ - timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb) - { - const unsigned char *tzf; - timelib_tzinfo *tmp; -+ int version; - - if (seek_to_tz_position(&tzf, timezone, 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); -+ 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); - } else { - tmp = NULL; --- -2.1.4 - -From b5e5098c50397ed910a79ac1d64b7d0fff2c02e1 Mon Sep 17 00:00:00 2001 -From: Matteo Beccati <mbeccati@php.net> -Date: Tue, 28 Apr 2015 10:57:18 +0200 -Subject: [PATCH] Fix segfault in ext/date since 957aa2 - ---- - ext/date/lib/parse_tz.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c -index 89b8af7..32ed639 100644 ---- a/ext/date/lib/parse_tz.c -+++ b/ext/date/lib/parse_tz.c -@@ -89,8 +89,8 @@ static void read_header(const unsigned char **tzf, timelib_tzinfo *tz) - static void skip_transistions_64bit(const unsigned char **tzf, timelib_tzinfo *tz) - { - if (tz->timecnt) { -- *tzf += (sizeof(int64_t) * (tz->timecnt + 1)); -- *tzf += (sizeof(unsigned char) * (tz->timecnt + 1)); -+ *tzf += (sizeof(int64_t) * (tz->timecnt)); -+ *tzf += (sizeof(unsigned char) * (tz->timecnt)); - } - } - --- -2.1.4 - diff --git a/php-5.6.9-systzdata-v12.patch b/php-5.6.9-systzdata-v12.patch index b84b041..aa3277c 100644 --- a/php-5.6.9-systzdata-v12.patch +++ b/php-5.6.9-systzdata-v12.patch @@ -20,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-5.6.9/ext/date/lib/parse_tz.c.systzdata php-5.6.9/ext/date/lib/parse_tz.c ---- php-5.6.9/ext/date/lib/parse_tz.c.systzdata 2015-04-28 11:46:04.736048209 +0200 -+++ php-5.6.9/ext/date/lib/parse_tz.c 2015-04-28 11:56:32.410813578 +0200 +diff -up php-5.6.9RC1/ext/date/lib/parse_tz.c.systzdata php-5.6.9RC1/ext/date/lib/parse_tz.c +--- php-5.6.9RC1/ext/date/lib/parse_tz.c.systzdata 2015-04-30 00:00:18.000000000 +0200 ++++ php-5.6.9RC1/ext/date/lib/parse_tz.c 2015-04-30 06:36:47.019617321 +0200 @@ -20,6 +20,16 @@ #include "timelib.h" @@ -547,6 +547,7 @@ diff -up php-5.6.9/ext/date/lib/parse_tz.c.systzdata php-5.6.9/ext/date/lib/pars { const unsigned char *tzf; - return (seek_to_tz_position(&tzf, timezone, tzdb)); ++ +#ifdef HAVE_SYSTEM_TZDATA + if (tzdb == timezonedb_system) { + char fname[PATH_MAX]; @@ -568,12 +569,11 @@ diff -up php-5.6.9/ext/date/lib/parse_tz.c.systzdata php-5.6.9/ext/date/lib/pars + 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 +857,53 @@ static void skip_2nd_header_and_data(con + static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz) +@@ -374,24 +870,54 @@ static void read_64bit_header(const unsi timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb) { const unsigned char *tzf; @@ -591,10 +591,13 @@ diff -up php-5.6.9/ext/date/lib/parse_tz.c.systzdata php-5.6.9/ext/date/lib/pars read_transistions(&tzf, tmp); read_types(&tzf, tmp); - if (version == 2) { -- skip_2nd_header_and_data(&tzf, tmp); -- skip_transistions_64bit(&tzf, tmp); -- skip_types_64bit(&tzf, tmp); +- skip_64bit_preamble(&tzf, tmp); +- read_64bit_header(&tzf, tmp); +- skip_64bit_transistions(&tzf, tmp); +- skip_64bit_types(&tzf, tmp); - skip_posix_string(&tzf, tmp); +- } +- read_location(&tzf, tmp); + +#ifdef HAVE_SYSTEM_TZDATA + if (memmap) { @@ -622,21 +625,21 @@ diff -up php-5.6.9/ext/date/lib/parse_tz.c.systzdata php-5.6.9/ext/date/lib/pars +#endif + { + if (version == 2) { -+ skip_2nd_header_and_data(&tzf, tmp); -+ skip_transistions_64bit(&tzf, tmp); -+ skip_types_64bit(&tzf, tmp); ++ skip_64bit_preamble(&tzf, tmp); ++ read_64bit_header(&tzf, tmp); ++ skip_64bit_transistions(&tzf, tmp); ++ skip_64bit_types(&tzf, tmp); + skip_posix_string(&tzf, tmp); + } + /* PHP-style - use the embedded info. */ + read_location(&tzf, tmp); - } -- read_location(&tzf, tmp); ++ } } else { tmp = NULL; } -diff -up php-5.6.9/ext/date/lib/timelib.m4.systzdata php-5.6.9/ext/date/lib/timelib.m4 ---- php-5.6.9/ext/date/lib/timelib.m4.systzdata 2015-04-15 20:05:57.000000000 +0200 -+++ php-5.6.9/ext/date/lib/timelib.m4 2015-04-28 11:46:04.752048280 +0200 +diff -up php-5.6.9RC1/ext/date/lib/timelib.m4.systzdata php-5.6.9RC1/ext/date/lib/timelib.m4 +--- php-5.6.9RC1/ext/date/lib/timelib.m4.systzdata 2015-04-30 00:00:18.000000000 +0200 ++++ php-5.6.9RC1/ext/date/lib/timelib.m4 2015-04-30 06:32:08.549500385 +0200 @@ -78,3 +78,17 @@ stdlib.h dnl Check for strtoll, atoll @@ -127,12 +127,12 @@ %global db_devel libdb-devel %endif -#global rcver RC1 -%global rpmrel 2 +%global rcver RC1 +%global rpmrel 1 Summary: PHP scripting language for creating dynamic web sites Name: %{?scl_prefix}php -Version: 5.6.8 +Version: 5.6.9 %if 0%{?rcver:1} Release: 0.%{rpmrel}.%{rcver}%{?dist} %else @@ -174,7 +174,6 @@ Patch21: php-5.4.7-odbctimer.patch # Functional changes Patch40: php-5.4.0-dlopen.patch -Patch41: php-5.6.9-newzic.patch Patch42: php-5.6.9-systzdata-v12.patch # See http://bugs.php.net/53436 Patch43: php-5.4.0-phpize.patch @@ -874,7 +873,6 @@ support for using the enchant library to PHP. %patch21 -p1 -b .odbctimer %patch40 -p1 -b .dlopen -%patch41 -p1 -b .newzic %patch42 -p1 -b .systzdata %patch43 -p1 -b .headers %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 @@ -1783,6 +1781,9 @@ fi %changelog +* Thu Apr 30 2015 Remi Collet <remi@fedoraproject.org> 5.6.9-0.1.RC1 +- update to 5.6.9RC1 + * Tue Apr 28 2015 Remi Collet <remi@fedoraproject.org> 5.6.8-2 - test build (new zic) |