From e6a9351cb19a160c0845af3a42aa474c2fcab176 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 17 Sep 2014 10:00:47 +0200 Subject: PHP 5.5.17 --- php-bug65641.patch | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ php-bug67865.patch | 64 ------------------------------------------------------ php55.spec | 14 ++++++++---- 3 files changed, 73 insertions(+), 68 deletions(-) create mode 100644 php-bug65641.patch delete mode 100644 php-bug67865.patch diff --git a/php-bug65641.patch b/php-bug65641.patch new file mode 100644 index 0000000..d9b31d1 --- /dev/null +++ b/php-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-bug67865.patch b/php-bug67865.patch deleted file mode 100644 index e5cc8cd..0000000 --- a/php-bug67865.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 46ee0e087e5bd6520051cb66d765fc428c51b1a4 Mon Sep 17 00:00:00 2001 -From: Stanislav Malyshev -Date: Wed, 20 Aug 2014 13:15:22 -0700 -Subject: [PATCH] Revert "Fixed Bug #67724" - -This reverts commit e4ff7f2ee346d641715694209e61704c9e815483. -Reverted since it causes https://bugs.php.net/bug.php?id=67865 ---- - ext/zlib/tests/bug67724.gz.gz | Bin 171 -> 0 bytes - ext/zlib/tests/bug67724.phpt | 26 -------------------------- - ext/zlib/zlib_filter.c | 3 +-- - 3 files changed, 1 insertion(+), 28 deletions(-) - delete mode 100644 ext/zlib/tests/bug67724.gz.gz - delete mode 100644 ext/zlib/tests/bug67724.phpt - -diff --git a/ext/zlib/tests/bug67724.phpt b/ext/zlib/tests/bug67724.phpt -deleted file mode 100644 -index 1e5026f..0000000 ---- a/ext/zlib/tests/bug67724.phpt -+++ /dev/null -@@ -1,26 +0,0 @@ ----TEST-- --Bug #67724 (chained zlib filters silently fail with large amounts of data) ----SKIPIF-- -- ----FILE-- -- 30]); --stream_filter_append($f, "zlib.inflate", STREAM_FILTER_READ, ["window" => 30]); --for ($i = 0; !feof($f); $i += strlen(fread($f, 0x1000))) -- ; --fclose($f); -- --var_dump($i); -- --?> --DONE ----EXPECT-- --Test --int(25600000) --DONE -diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c -index 47a68e2..2054ec2 100644 ---- a/ext/zlib/zlib_filter.c -+++ b/ext/zlib/zlib_filter.c -@@ -302,8 +302,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f - - data->strm.zalloc = (alloc_func) php_zlib_alloc; - data->strm.zfree = (free_func) php_zlib_free; -- data->strm.avail_out = data->outbuf_len = 0x8000; -- data->inbuf_len = 2048; -+ data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048; - data->strm.next_in = data->inbuf = (Bytef *) pemalloc(data->inbuf_len, persistent); - if (!data->inbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", data->inbuf_len); --- -1.9.2 - diff --git a/php55.spec b/php55.spec index 0e39fa6..7eaf69d 100644 --- a/php55.spec +++ b/php55.spec @@ -125,11 +125,11 @@ Summary: PHP scripting language for creating dynamic web sites Name: php -Version: 5.5.16 +Version: 5.5.17 %if 0%{?snapdate:1}%{?rcver:1} Release: 0.1.%{?snapdate}%{?rcver}%{?dist} %else -Release: 1%{?dist}.2 +Release: 1%{?dist} %endif # All files licensed under PHP version 3.01, except # Zend is licensed under Zend @@ -190,7 +190,7 @@ Patch47: php-5.4.9-phpinfo.patch Patch91: php-5.3.7-oci8conf.patch # Upstream fixes (100+) -Patch100: php-bug67865.patch +Patch100: php-bug65641.patch # Security fixes (200+) @@ -942,7 +942,7 @@ rm -rf ext/json %patch91 -p1 -b .remi-oci8 # upstream patches -%patch100 -p1 -b .bug67865 +%patch100 -p1 -b .bug65641 # security patches @@ -1946,6 +1946,12 @@ fi %changelog +* Wed Sep 17 2014 Remi Collet 5.5.17-1 +- Update to 5.5.17 + http://www.php.net/releases/5_5_17.php +- fpm: fix script_name with mod_proxy_fcgi / proxypass + add upstream patch for https://bugs.php.net/65641 + * Wed Sep 3 2014 Remi Collet 5.5.16-1.2 - ensure gd-last 2.1.0-3, with libvpx support, is used -- cgit