From cc1ac0d64380223ce7fbb91687adcfbeaaca66a6 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 17 Sep 2014 11:39:34 +0200 Subject: PHP 5.4.33 --- php-5.4.33-bug65641.patch | 63 +++++++++++++++++++++++++++++++++++++++++++++++ php-bug67873.patch | 41 ------------------------------ php54.spec | 14 ++++++++--- 3 files changed, 73 insertions(+), 45 deletions(-) create mode 100644 php-5.4.33-bug65641.patch delete mode 100644 php-bug67873.patch diff --git a/php-5.4.33-bug65641.patch b/php-5.4.33-bug65641.patch new file mode 100644 index 0000000..d9b31d1 --- /dev/null +++ b/php-5.4.33-bug65641.patch @@ -0,0 +1,63 @@ +From 8cac75969e5abb2b6be5bbd489d851a4f9e50979 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 15 Sep 2014 13:29:55 +0200 +Subject: [PATCH] Fixed bug #65641 PHP-FPM incorrectly defines the SCRIPT_NAME + variable when using Apache + +ProxyPass is unable to provide correct PATH_INFO +as it is not aware of file path (while SetHandler is). + +As we can extract PATH_INFO from PATH_TRANSLATED, +we also need to check if present in SCRIPT_NAME +and remove it. + +After applying this patch. +With mod_php +_SERVER["REQUEST_URI"] /info.php/foo/bar?q=1 +_SERVER["SCRIPT_NAME"] /info.php +_SERVER["PATH_INFO"] /foor/bar +_SERVER["PHP_SELF"] /info.php/foo/bar +_SERVER["QUERY_STRING"] q=1 + +With mod_proxy_fcgi + SetHandler +_SERVER["REQUEST_URI"] /info.php/foo/bar?q=1 +_SERVER["SCRIPT_NAME"] /info.php +_SERVER["PATH_INFO"] /foo/bar +_SERVER["PHP_SELF"] /info.php/foo/bar +_SERVER["QUERY_STRING"] q=1 + +With mod_proxy_fcgi + ProxyPass +_SERVER["REQUEST_URI"] /info.php/foo/bar?q=1 +_SERVER["SCRIPT_NAME"] /info.php +_SERVER["PATH_INFO"] /foo/bar +_SERVER["PHP_SELF"] /info.php/foo/bar +_SERVER["QUERY_STRING"] q=1 +--- + sapi/fpm/fpm/fpm_main.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c +index 56a06f9..331342c 100644 +--- a/sapi/fpm/fpm/fpm_main.c ++++ b/sapi/fpm/fpm/fpm_main.c +@@ -1231,6 +1231,17 @@ static void init_request_info(TSRMLS_D) + SG(request_info).request_uri = orig_script_name; + } + path_info[0] = old; ++ } else if (apache_was_here && env_script_name) { ++ /* Using mod_proxy_fcgi and ProxyPass, apache cannot set PATH_INFO ++ * As we can extract PATH_INFO from PATH_TRANSLATED ++ * it is probably also in SCRIPT_NAME and need to be removed ++ */ ++ int snlen = strlen(env_script_name); ++ if (snlen>slen && !strcmp(env_script_name+snlen-slen, path_info)) { ++ _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); ++ env_script_name[snlen-slen] = 0; ++ SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC); ++ } + } + env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC); + } +-- +1.9.2 + diff --git a/php-bug67873.patch b/php-bug67873.patch deleted file mode 100644 index c3b0eb6..0000000 --- a/php-bug67873.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 95ea1e7ca787537a93c25c401dba010d51aa8d59 Mon Sep 17 00:00:00 2001 -From: Anatol Belski -Date: Sat, 11 May 2013 02:47:48 +0200 -Subject: [PATCH] fixed variable corruption under win x64 - ---- - ext/wddx/wddx.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c -index 967da6a..afeca90 100644 ---- a/ext/wddx/wddx.c -+++ b/ext/wddx/wddx.c -@@ -405,7 +405,7 @@ static void php_wddx_serialize_string(wddx_packet *packet, zval *var TSRMLS_DC) - - if (Z_STRLEN_P(var) > 0) { - char *buf; -- int buf_len; -+ size_t buf_len; - - buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), &buf_len, 0, ENT_QUOTES, NULL TSRMLS_CC); - -@@ -626,12 +626,12 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr) - */ - void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC) - { -- char *tmp_buf; -- char *name_esc; -- int name_esc_len; - HashTable *ht; - - if (name) { -+ size_t name_esc_len; -+ char *tmp_buf, *name_esc; -+ - name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC); - tmp_buf = emalloc(name_esc_len + sizeof(WDDX_VAR_S)); - snprintf(tmp_buf, name_esc_len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc); --- -1.9.2 - diff --git a/php54.spec b/php54.spec index a3287a1..7d52789 100644 --- a/php54.spec +++ b/php54.spec @@ -84,7 +84,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: php -Version: 5.4.32 +Version: 5.4.33 %if 0%{?snapdate:1}%{?rcver:1} Release: 0.2.%{?snapdate}%{?rcver}%{?dist} %else @@ -139,7 +139,8 @@ Patch46: php-5.4.9-fixheader.patch Patch47: php-5.4.9-phpinfo.patch # Upstream fixes -Patch100: php-bug67873.patch +# Backported from 5.5.18 for https://bugs.php.net/65641 +Patch100: php-5.4.33-bug65641.patch # Security fixes @@ -831,11 +832,10 @@ rm -f ext/json/utf8_to_utf16.* %patch46 -p1 -b .fixheader %patch47 -p1 -b .phpinfo -%patch100 -p1 -b .wddx - %patch91 -p1 -b .remi-oci8 # upstream patches +%patch100 -p1 -b .bug65641 # security patches @@ -1699,6 +1699,12 @@ fi %changelog +* Wed Sep 17 2014 Remi Collet 5.4.33-1 +- Update to 5.4.33 + http://www.php.net/releases/5_4_33.php +- fpm: fix script_name with mod_proxy_fcgi / proxypass + add upstream patch for https://bugs.php.net/65641 + * Thu Aug 21 2014 Remi Collet 5.4.32-1 - Update to 5.4.32 http://www.php.net/releases/5_4_32.php -- cgit