From 3bd1eb25817be09af1ab566a343253d416e3d869 Mon Sep 17 00:00:00 2001 From: jorton Date: Fri, 27 Nov 2009 10:01:06 +0000 Subject: [PATCH] * Fri Nov 27 2009 Joe Orton - 5.3.1-3 - update to v7 of systzdata patch --- php-5.3.0-openssl.patch | 29 ------------------- ...a-v6.patch => php-5.3.1-systzdata-v7.patch | 29 ++++++++++++------- php.spec | 7 +++-- 3 files changed, 23 insertions(+), 42 deletions(-) delete mode 100644 php-5.3.0-openssl.patch rename php-5.3.0-systzdata-v6.patch => php-5.3.1-systzdata-v7.patch (95%) diff --git a/php-5.3.0-openssl.patch b/php-5.3.0-openssl.patch deleted file mode 100644 index 3dbc1b9..0000000 --- a/php-5.3.0-openssl.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -up php-5.3.0/ext/openssl/openssl.c.openssl php-5.3.0/ext/openssl/openssl.c ---- php-5.3.0/ext/openssl/openssl.c.openssl 2009-04-20 11:44:29.000000000 +0200 -+++ php-5.3.0/ext/openssl/openssl.c 2009-08-25 18:16:30.000000000 +0200 -@@ -502,8 +502,13 @@ inline static int php_openssl_safe_mode_ - static char default_ssl_conf_filename[MAXPATHLEN]; - - struct php_x509_request { /* {{{ */ -+#if OPENSSL_VERSION_NUMBER >= 0x10000000L -+ LHASH_OF(CONF_VALUE) * global_config; /* Global SSL config */ -+ LHASH_OF(CONF_VALUE) * req_config; /* SSL config for this request */ -+#else - LHASH * global_config; /* Global SSL config */ - LHASH * req_config; /* SSL config for this request */ -+#endif - const EVP_MD * md_alg; - const EVP_MD * digest; - char * section_name, -@@ -680,7 +685,11 @@ static time_t asn1_time_to_time_t(ASN1_U - } - /* }}} */ - -+#if OPENSSL_VERSION_NUMBER >= 0x10000000L -+static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * config TSRMLS_DC) /* {{{ */ -+#else - static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH * config TSRMLS_DC) /* {{{ */ -+#endif - { - X509V3_CTX ctx; - diff --git a/php-5.3.0-systzdata-v6.patch b/php-5.3.1-systzdata-v7.patch similarity index 95% rename from php-5.3.0-systzdata-v6.patch rename to php-5.3.1-systzdata-v7.patch index 02bf3db..6247aea 100644 --- a/php-5.3.0-systzdata-v6.patch +++ b/php-5.3.1-systzdata-v7.patch @@ -3,6 +3,7 @@ Add support for use of the system timezone database, rather than embedding a copy. Discussed upstream but was not desired. History: +r7: improve check for valid timezone id to exclude directories r6: fix fd leak in r5, fix country code/BC flag use in timezone_identifiers_list() using system db, fix use of PECL timezonedb to override system db, @@ -14,10 +15,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 -Index: ext/date/lib/timelib.m4 -=================================================================== ---- php-5.3.0/ext/date/lib/parse_tz.c.systzdata -+++ php-5.3.0/ext/date/lib/parse_tz.c +--- php-5.3.1/ext/date/lib/parse_tz.c.systzdata ++++ php-5.3.1/ext/date/lib/parse_tz.c @@ -20,6 +20,16 @@ #include "timelib.h" @@ -66,7 +65,7 @@ Index: ext/date/lib/timelib.m4 /* read BC flag */ tz->bc = (**tzf == '\1'); *tzf += 1; -@@ -253,7 +273,390 @@ void timelib_dump_tzinfo(timelib_tzinfo +@@ -253,7 +273,397 @@ void timelib_dump_tzinfo(timelib_tzinfo } } @@ -422,6 +421,13 @@ Index: ext/date/lib/timelib.m4 + sysdb->data = (unsigned char *)data; +} + ++/* Returns true if the passed-in stat structure describes a ++ * probably-valid timezone file. */ ++static int is_valid_tzfile(const struct stat *st) ++{ ++ return S_ISREG(st->st_mode) && st->st_size > 20; ++} ++ +/* 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) @@ -440,7 +446,7 @@ Index: ext/date/lib/timelib.m4 + fd = open(fname, O_RDONLY); + if (fd == -1) { + return NULL; -+ } else if (fstat(fd, &st) != 0 || st.st_size < 21) { ++ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st)) { + close(fd); + return NULL; + } @@ -458,7 +464,7 @@ Index: ext/date/lib/timelib.m4 { int left = 0, right = tzdb->index_size - 1; #ifdef HAVE_SETLOCALE -@@ -292,36 +695,124 @@ static int seek_to_tz_position(const uns +@@ -292,36 +702,125 @@ static int seek_to_tz_position(const uns return 0; } @@ -524,14 +530,15 @@ Index: ext/date/lib/timelib.m4 +#ifdef HAVE_SYSTEM_TZDATA + if (tzdb == timezonedb_system) { + char fname[PATH_MAX]; -+ ++ struct stat st; ++ + if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { + return 0; + } + + snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone); + -+ return access(fname, R_OK) == 0 ? 1 : 0; ++ return stat(fname, &st) == 0 && is_valid_tzfile(&st); + } +#endif + @@ -586,8 +593,8 @@ Index: ext/date/lib/timelib.m4 } else { tmp = NULL; } ---- php-5.3.0/ext/date/lib/timelib.m4.systzdata -+++ php-5.3.0/ext/date/lib/timelib.m4 +--- php-5.3.1/ext/date/lib/timelib.m4.systzdata ++++ php-5.3.1/ext/date/lib/timelib.m4 @@ -78,3 +78,17 @@ stdlib.h dnl Check for strtoll, atoll diff --git a/php.spec b/php.spec index e7f72be..13cd516 100644 --- a/php.spec +++ b/php.spec @@ -14,7 +14,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: php Version: 5.3.1 -Release: 2%{?dist} +Release: 3%{?dist} License: PHP Group: Development/Languages URL: http://www.php.net/ @@ -43,7 +43,7 @@ Patch21: php-5.2.3-macropen.patch # Functional changes Patch40: php-5.0.4-dlopen.patch Patch41: php-5.3.0-easter.patch -Patch42: php-5.3.0-systzdata-v6.patch +Patch42: php-5.3.1-systzdata-v7.patch # Fixes for tests Patch61: php-5.0.4-tests-wddx.patch @@ -863,6 +863,9 @@ rm files.* macros.php %files enchant -f files.enchant %changelog +* Fri Nov 27 2009 Joe Orton - 5.3.1-3 +- update to v7 of systzdata patch + * Wed Nov 25 2009 Joe Orton - 5.3.1-2 - fix build with autoconf 2.6x