summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-11-02 09:32:04 +0100
committerRemi Collet <fedora@famillecollet.com>2014-11-02 09:32:04 +0100
commitef4877a7043e5f6f00ba0142c18be7e4003c3b02 (patch)
tree3c3b07ba162d1fd39db45484a1c050f7d4ca6272
parente3dcfa856d93126856dc9e9b25fc2c634cf35c2c (diff)
php 5.4:
- new version of systzdata patch, fix case sensitivity - gmp: fix memory management conflict with other libraries using libgmp, backport fix for https://bugs.php.net/63595
-rw-r--r--php-5.4.34-bug63595.patch72
-rw-r--r--php-5.4.34-systzdata-v11.patch (renamed from php-5.3.1-systzdata-v10.patch)48
-rw-r--r--php54.spec19
3 files changed, 116 insertions, 23 deletions
diff --git a/php-5.4.34-bug63595.patch b/php-5.4.34-bug63595.patch
new file mode 100644
index 0000000..7df8438
--- /dev/null
+++ b/php-5.4.34-bug63595.patch
@@ -0,0 +1,72 @@
+From 3c925b18fa96043e5d7e86f9ce544b143c3c2079 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Mon, 27 Oct 2014 07:45:34 +0100
+Subject: [PATCH] Fix bug #63595 GMP memory management conflicts with other
+ libraries using GMP
+
+Drop use of php memory allocators as this raise various conflicts
+with other extensions and libraries which use libgmp.
+
+No other solution found.
+We cannot for ensure correct use of allocator with shared lib.
+
+Some memory can allocated before php init
+Some memory can be freed after php shutdown
+
+Known broken run cases
+- php + curl + gnutls + gmp
+- mod_gnutls + mod_php + gnutls + gmp
+- php + freetds + gnutls + gmp
+- php + odbc + freetds + gnutls + gmp
+- php + php-mapi (zarafa) + gnutls + gmp
+---
+ ext/gmp/gmp.c | 26 --------------------------
+ 1 file changed, 26 deletions(-)
+
+diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
+index f51bd8c..b1553fa 100644
+--- a/ext/gmp/gmp.c
++++ b/ext/gmp/gmp.c
+@@ -324,30 +324,6 @@ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
+ # define MAX_BASE 36
+ #endif
+
+-/* {{{ gmp_emalloc
+- */
+-static void *gmp_emalloc(size_t size)
+-{
+- return emalloc(size);
+-}
+-/* }}} */
+-
+-/* {{{ gmp_erealloc
+- */
+-static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size)
+-{
+- return erealloc(ptr, new_size);
+-}
+-/* }}} */
+-
+-/* {{{ gmp_efree
+- */
+-static void gmp_efree(void *ptr, size_t size)
+-{
+- efree(ptr);
+-}
+-/* }}} */
+-
+ /* {{{ ZEND_GINIT_FUNCTION
+ */
+ static ZEND_GINIT_FUNCTION(gmp)
+@@ -369,8 +345,6 @@ ZEND_MODULE_STARTUP_D(gmp)
+ #endif
+ REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT);
+
+- mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree);
+-
+ return SUCCESS;
+ }
+ /* }}} */
+--
+2.1.0
+
diff --git a/php-5.3.1-systzdata-v10.patch b/php-5.4.34-systzdata-v11.patch
index b262fae..bfca49b 100644
--- a/php-5.3.1-systzdata-v10.patch
+++ b/php-5.4.34-systzdata-v11.patch
@@ -2,7 +2,9 @@ Add support for use of the system timezone database, rather
than embedding a copy. Discussed upstream but was not desired.
History:
-r10 : make timezone case insensitive
+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
r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
r8: fix compile error without --with-system-tzdata configured
r7: improve check for valid timezone id to exclude directories
@@ -17,6 +19,8 @@ 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 --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
+index 5d2aec9..671b398 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -20,6 +20,16 @@
@@ -67,7 +71,7 @@ r1: initial revision
/* read BC flag */
tz->bc = (**tzf == '\1');
*tzf += 1;
-@@ -256,7 +276,405 @@
+@@ -256,7 +276,418 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
}
}
@@ -165,7 +169,7 @@ r1: initial revision
+ /* Round to five decimal place, not because it's a good idea,
+ * but, because the builtin data uses rounded data, so, match
+ * that. */
-+ *result = round(v * sign * 100000.0) / 100000.0;
++ *result = trunc(v * sign * 100000.0) / 100000.0;
+
+ return p;
+}
@@ -293,7 +297,7 @@ r1: initial revision
+{
+ const timelib_tzdb_index_entry *alpha = first, *beta = second;
+
-+ return strcmp(alpha->id, beta->id);
++ return strcasecmp(alpha->id, beta->id);
+}
+
+
@@ -431,6 +435,26 @@ r1: initial revision
+ return S_ISREG(st->st_mode) && st->st_size > 20;
+}
+
++/* To allow timezone names to be used case-insensitively, find the
++ * canonical name for this timezone, if possible. */
++static const char *canonical_tzname(const char *timezone)
++{
++ if (timezonedb_system) {
++ timelib_tzdb_index_entry *ent, lookup;
++
++ lookup.id = (char *)timezone;
++
++ ent = bsearch(&lookup, timezonedb_system->index,
++ timezonedb_system->index_size, sizeof lookup,
++ sysdbcmp);
++ if (ent) {
++ return ent->id;
++ }
++ }
++
++ return timezone;
++}
++
+/* Return the mmap()ed tzfile if found, else NULL. On success, the
+ * length of the mapped data is placed in *length. */
+static char *map_tzfile(const char *timezone, size_t *length)
@@ -444,14 +468,7 @@ r1: initial revision
+ return NULL;
+ }
+
-+ if (system_location_table) {
-+ const struct location_info *li;
-+ if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
-+ /* Use the stored name to avoid case issue */
-+ timezone = li->name;
-+ }
-+ }
-+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
+
+ fd = open(fname, O_RDONLY);
+ if (fd == -1) {
@@ -474,7 +491,7 @@ r1: initial revision
{
int left = 0, right = tzdb->index_size - 1;
#ifdef HAVE_SETLOCALE
-@@ -295,36 +713,135 @@
+@@ -295,36 +726,135 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
return 0;
}
@@ -556,7 +573,7 @@ r1: initial revision
+ }
+ }
+
-+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
+
+ return stat(fname, &st) == 0 && is_valid_tzfile(&st);
+ }
@@ -613,6 +630,8 @@ r1: initial revision
} else {
tmp = NULL;
}
+diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4
+index c725572..4c837c7 100644
--- a/ext/date/lib/timelib.m4
+++ b/ext/date/lib/timelib.m4
@@ -78,3 +78,17 @@ stdlib.h
@@ -633,3 +652,4 @@ r1: initial revision
+ fi
+fi
+
+
diff --git a/php54.spec b/php54.spec
index fc80110..3fbd992 100644
--- a/php54.spec
+++ b/php54.spec
@@ -79,17 +79,10 @@
%global db_devel libdb-devel
%endif
-#global snapdate 201201041830
-#global rcver RC1
-
Summary: PHP scripting language for creating dynamic web sites
Name: php
Version: 5.4.34
-%if 0%{?snapdate:1}%{?rcver:1}
-Release: 0.2.%{?snapdate}%{?rcver}%{?dist}
-%else
-Release: 1%{?dist}
-%endif
+Release: 2%{?dist}
# All files licensed under PHP version 3.01, except
# Zend is licensed under Zend
# TSRM is licensed under BSD
@@ -126,7 +119,7 @@ Patch21: php-5.4.7-odbctimer.patch
# Functional changes
Patch40: php-5.4.0-dlopen.patch
Patch41: php-5.4.0-easter.patch
-Patch42: php-5.3.1-systzdata-v10.patch
+Patch42: php-5.4.34-systzdata-v11.patch
# See http://bugs.php.net/53436
Patch43: php-5.4.0-phpize.patch
# Use system libzip instead of bundled one
@@ -141,6 +134,8 @@ Patch47: php-5.4.9-phpinfo.patch
# Upstream fixes
# Backported from 5.5.18 for https://bugs.php.net/65641
Patch100: php-5.4.33-bug65641.patch
+# Backported from 5.5.19 for https://bugs.php.net/63595
+Patch101: php-5.4.34-bug63595.patch
# Security fixes
@@ -836,6 +831,7 @@ rm -f ext/json/utf8_to_utf16.*
# upstream patches
%patch100 -p1 -b .bug65641
+%patch101 -p1 -b .bug63595
# security patches
@@ -1701,6 +1697,11 @@ fi
%changelog
+* Sun Nov 2 2014 Remi Collet <remi@fedoraproject.org> 5.4.34-2
+- new version of systzdata patch, fix case sensitivity
+- gmp: fix memory management conflict with other libraries
+ using libgmp, backport fix for https://bugs.php.net/63595
+
* Thu Oct 16 2014 Remi Collet <remi@fedoraproject.org> 5.4.34-1
- Update to 5.4.34
http://www.php.net/releases/5_4_34.php