* Fri Nov 27 2009 Joe Orton <jorton@redhat.com> - 5.3.1-3

- update to v7 of systzdata patch
This commit is contained in:
jorton 2009-11-27 10:01:06 +00:00
parent 4598589248
commit 3bd1eb2581
3 changed files with 23 additions and 42 deletions

View File

@ -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;

View File

@ -3,6 +3,7 @@ Add support for use of the system timezone database, rather
than embedding a copy. Discussed upstream but was not desired. than embedding a copy. Discussed upstream but was not desired.
History: History:
r7: improve check for valid timezone id to exclude directories
r6: fix fd leak in r5, fix country code/BC flag use in r6: fix fd leak in r5, fix country code/BC flag use in
timezone_identifiers_list() using system db, timezone_identifiers_list() using system db,
fix use of PECL timezonedb to override 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 r2: add filesystem trawl to set up name alias index
r1: initial revision r1: initial revision
Index: ext/date/lib/timelib.m4 --- php-5.3.1/ext/date/lib/parse_tz.c.systzdata
=================================================================== +++ php-5.3.1/ext/date/lib/parse_tz.c
--- php-5.3.0/ext/date/lib/parse_tz.c.systzdata
+++ php-5.3.0/ext/date/lib/parse_tz.c
@@ -20,6 +20,16 @@ @@ -20,6 +20,16 @@
#include "timelib.h" #include "timelib.h"
@ -66,7 +65,7 @@ Index: ext/date/lib/timelib.m4
/* read BC flag */ /* read BC flag */
tz->bc = (**tzf == '\1'); tz->bc = (**tzf == '\1');
*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; + 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 +/* Return the mmap()ed tzfile if found, else NULL. On success, the
+ * length of the mapped data is placed in *length. */ + * length of the mapped data is placed in *length. */
+static char *map_tzfile(const char *timezone, size_t *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); + fd = open(fname, O_RDONLY);
+ if (fd == -1) { + if (fd == -1) {
+ return NULL; + return NULL;
+ } else if (fstat(fd, &st) != 0 || st.st_size < 21) { + } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st)) {
+ close(fd); + close(fd);
+ return NULL; + return NULL;
+ } + }
@ -458,7 +464,7 @@ Index: ext/date/lib/timelib.m4
{ {
int left = 0, right = tzdb->index_size - 1; int left = 0, right = tzdb->index_size - 1;
#ifdef HAVE_SETLOCALE #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; return 0;
} }
@ -524,6 +530,7 @@ Index: ext/date/lib/timelib.m4
+#ifdef HAVE_SYSTEM_TZDATA +#ifdef HAVE_SYSTEM_TZDATA
+ if (tzdb == timezonedb_system) { + if (tzdb == timezonedb_system) {
+ char fname[PATH_MAX]; + char fname[PATH_MAX];
+ struct stat st;
+ +
+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { + if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
+ return 0; + return 0;
@ -531,7 +538,7 @@ Index: ext/date/lib/timelib.m4
+ +
+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone); + 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 +#endif
+ +
@ -586,8 +593,8 @@ Index: ext/date/lib/timelib.m4
} else { } else {
tmp = NULL; tmp = NULL;
} }
--- php-5.3.0/ext/date/lib/timelib.m4.systzdata --- php-5.3.1/ext/date/lib/timelib.m4.systzdata
+++ php-5.3.0/ext/date/lib/timelib.m4 +++ php-5.3.1/ext/date/lib/timelib.m4
@@ -78,3 +78,17 @@ stdlib.h @@ -78,3 +78,17 @@ stdlib.h
dnl Check for strtoll, atoll dnl Check for strtoll, atoll

View File

@ -14,7 +14,7 @@
Summary: PHP scripting language for creating dynamic web sites Summary: PHP scripting language for creating dynamic web sites
Name: php Name: php
Version: 5.3.1 Version: 5.3.1
Release: 2%{?dist} Release: 3%{?dist}
License: PHP License: PHP
Group: Development/Languages Group: Development/Languages
URL: http://www.php.net/ URL: http://www.php.net/
@ -43,7 +43,7 @@ Patch21: php-5.2.3-macropen.patch
# Functional changes # Functional changes
Patch40: php-5.0.4-dlopen.patch Patch40: php-5.0.4-dlopen.patch
Patch41: php-5.3.0-easter.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 # Fixes for tests
Patch61: php-5.0.4-tests-wddx.patch Patch61: php-5.0.4-tests-wddx.patch
@ -863,6 +863,9 @@ rm files.* macros.php
%files enchant -f files.enchant %files enchant -f files.enchant
%changelog %changelog
* Fri Nov 27 2009 Joe Orton <jorton@redhat.com> - 5.3.1-3
- update to v7 of systzdata patch
* Wed Nov 25 2009 Joe Orton <jorton@redhat.com> - 5.3.1-2 * Wed Nov 25 2009 Joe Orton <jorton@redhat.com> - 5.3.1-2
- fix build with autoconf 2.6x - fix build with autoconf 2.6x