[php] - update to 5.4.8 - define both session.save_handler and session.save_path - fix possible segfault i

Remi Collet remi at fedoraproject.org
Thu Oct 18 10:36:35 UTC 2012


commit 69e36ec89be9e92855efba50f71be54b1b5ea371
Author: Remi Collet <remi at fedoraproject.org>
Date:   Thu Oct 18 12:36:20 2012 +0200

    - update to 5.4.8
    - define both session.save_handler and session.save_path
    - fix possible segfault in libxml (#828526)
    - php-fpm: create apache user if needed
    - use SKIP_ONLINE_TEST during make test
    - php-devel requires pcre-devel and php-cli (instead of php)

 .gitignore                  |    2 +
 php-5.4.7-fpm-systemd.patch |  279 -------------------------------------------
 php-5.4.7-fpm.patch         |  223 ----------------------------------
 php-5.4.8-libxml.patch      |   50 ++++++++
 php-fpm-www.conf            |    3 +-
 php.spec                    |   45 ++++---
 sources                     |    2 +-
 7 files changed, 82 insertions(+), 522 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ce0851c..e0f8f3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
+clog
 php.spec~
 php-5.3*.bz2
 /php-5.4.4.tar.bz2
 /php-5.4.5.tar.bz2
 /php-5.4.6.tar.bz2
 /php-5.4.7.tar.bz2
+/php-5.4.8.tar.bz2
diff --git a/php-5.4.8-libxml.patch b/php-5.4.8-libxml.patch
new file mode 100644
index 0000000..d9e92e9
--- /dev/null
+++ b/php-5.4.8-libxml.patch
@@ -0,0 +1,50 @@
+From 100bb87f5517484d75191ff4cdbbc1fdf579791d Mon Sep 17 00:00:00 2001
+From: jjacky <i.am.jack.mail at gmail.com>
+Date: Fri, 11 May 2012 22:38:05 +0200
+Subject: [PATCH] CGI/FPM process could crash when using libxml, fixes #61557
+
+Since d8bddb9665637d96f20dc4a2ae5668ba376f3b17 some SAPI would only setup/reset
+callbacks to libxml once, instead of for each request processed. However, this
+also included a callback for structured errors, which should remain per request
+(as it can be defined through PHP's libxml_use_internal_errors).
+
+As a result, after the internal handler was set in a request, processing another
+request would result in the handler being triggered while the memory associated
+with it (LIBXML(error_list)) had been free-d/reset, leading to the process
+segfaulting.
+
+This reset the handler for structured errors after each request.
+
+(see #61325 also possibly the same bug)
+---
+ ext/libxml/libxml.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
+index e42d845..92c1099 100644
+--- a/ext/libxml/libxml.c
++++ b/ext/libxml/libxml.c
+@@ -851,7 +851,6 @@ static PHP_MSHUTDOWN_FUNCTION(libxml)
+ {
+ 	if (!_php_libxml_per_request_initialization) {
+ 		xmlSetGenericErrorFunc(NULL, NULL);
+-		xmlSetStructuredErrorFunc(NULL, NULL);
+ 
+ 		xmlParserInputBufferCreateFilenameDefault(NULL);
+ 		xmlOutputBufferCreateFilenameDefault(NULL);
+@@ -867,11 +866,11 @@ static int php_libxml_post_deactivate()
+ 	/* reset libxml generic error handling */
+ 	if (_php_libxml_per_request_initialization) {
+ 		xmlSetGenericErrorFunc(NULL, NULL);
+-		xmlSetStructuredErrorFunc(NULL, NULL);
+ 
+ 		xmlParserInputBufferCreateFilenameDefault(NULL);
+ 		xmlOutputBufferCreateFilenameDefault(NULL);
+ 	}
++	xmlSetStructuredErrorFunc(NULL, NULL);
+ 
+ 	if (LIBXML(stream_context)) {
+ 		/* the steam_context resource will be released by resource list destructor */
+-- 
+1.7.10.1
+
diff --git a/php-fpm-www.conf b/php-fpm-www.conf
index a5b8a13..9cdbb4f 100644
--- a/php-fpm-www.conf
+++ b/php-fpm-www.conf
@@ -221,5 +221,6 @@ php_admin_flag[log_errors] = on
 ;php_admin_value[memory_limit] = 128M
 
 ; Set session path to a directory owned by process user
-php_admin_value[session.save_path] = /var/lib/php/session
+php_value[session.save_handler] = files
+php_value[session.save_path] = /var/lib/php/session
 
diff --git a/php.spec b/php.spec
index 99b5cc8..6d56f90 100644
--- a/php.spec
+++ b/php.spec
@@ -51,8 +51,8 @@
 
 Summary: PHP scripting language for creating dynamic web sites
 Name: php
-Version: 5.4.7
-Release: 11%{?dist}
+Version: 5.4.8
+Release: 1%{?dist}
 License: PHP
 Group: Development/Languages
 URL: http://www.php.net/
@@ -81,8 +81,8 @@ Patch20: php-5.4.7-imap.patch
 Patch21: php-5.4.7-odbctimer.patch
 # https://bugs.php.net/63149 check sqlite3_column_table_name
 Patch22: php-5.4.7-sqlite.patch
-# https://bugs.php.net/bug.php?id=62886 - php-fpm startup
-Patch23: php-5.4.7-fpm.patch
+# https://bugs.php.net/61557 crash in libxml
+Patch23: php-5.4.8-libxml.patch
 
 # Functional changes
 Patch40: php-5.4.0-dlopen.patch
@@ -92,8 +92,6 @@ Patch42: php-5.3.1-systzdata-v10.patch
 Patch43: php-5.4.0-phpize.patch
 # Use system libzip instead of bundled one
 Patch44: php-5.4.5-system-libzip.patch
-# https://bugs.php.net/63085 systemd integration
-Patch45: php-5.4.7-fpm-systemd.patch
 
 # Fixes for tests
 
@@ -167,6 +165,7 @@ Summary: PHP FastCGI Process Manager
 Requires: php-common%{?_isa} = %{version}-%{release}
 BuildRequires: systemd-units
 Requires: systemd-units
+Requires(pre): /usr/sbin/useradd
 Requires(post): systemd-units
 Requires(preun): systemd-units
 Requires(postun): systemd-units
@@ -241,7 +240,8 @@ package and the php-cli package.
 %package devel
 Group: Development/Libraries
 Summary: Files needed for building PHP extensions
-Requires: php%{?_isa} = %{version}-%{release}, autoconf, automake
+Requires: php-cli%{?_isa} = %{version}-%{release}, autoconf, automake
+Requires: pcre-devel%{?_isa}
 Obsoletes: php-pecl-pdo-devel
 Provides: php-zts-devel = %{version}-%{release}
 Provides: php-zts-devel%{?_isa} = %{version}-%{release}
@@ -592,7 +592,7 @@ support for using the enchant library to PHP.
 %patch20 -p1 -b .imap
 %patch21 -p1 -b .odbctimer
 %patch22 -p1 -b .tablename
-%patch23 -p1 -b .fpmstartup
+%patch23 -p1 -b .libxmlcrash
 
 %patch40 -p1 -b .dlopen
 %patch41 -p1 -b .easter
@@ -601,7 +601,6 @@ support for using the enchant library to PHP.
 %if %{with_libzip}
 %patch44 -p1 -b .systzip
 %endif
-%patch45 -p1 -b .systemd
 
 # Prevent %%doc confusion over LICENSE files
 cp Zend/LICENSE Zend/ZEND_LICENSE
@@ -620,17 +619,9 @@ mkdir build-cgi build-apache build-embedded build-zts build-ztscli \
 rm -f tests/basic/php_egg_logo_guid.phpt
 # affected by systzdata patch
 rm -f ext/date/tests/timezone_location_get.phpt
-# https://bugs.php.net/63147 tests requiring an internet connection 
-rm -f ext/standard/tests/network/gethostbyname_basic002.phpt
-rm -f ext/standard/tests/network/gethostbyname_error004.phpt
-rm -f ext/standard/tests/network/getmxrr.phpt
-# https://bugzilla.redhat.com/859878 - missing feature in SQLite
-# https://bugs.php.net/63149 - build against system SQLite
-rm -f ext/pdo_sqlite/tests/bug_42589.phpt
 # fails sometime
 rm -f ext/sockets/tests/mcast_ipv?_recv.phpt
 
-
 # Safety check for API version change.
 pver=$(sed -n '/#define PHP_VERSION /{s/.* "//;s/".*$//;p}' main/php_version.h)
 if test "x${pver}" != "x%{version}%{?rcver}"; then
@@ -944,7 +935,7 @@ build --with-apxs2=%{_httpd_apxs} \
       --with-mysql=shared,%{_prefix} \
       --with-mysqli=shared,%{mysql_config} \
       --with-pdo-mysql=shared,%{mysql_config} \
-      --with-pdo-sqlite=shared,%{_prefix} \
+      --without-pdo-sqlite \
       ${without_shared}
 popd
 
@@ -956,6 +947,7 @@ popd
 cd build-apache
 # Run tests, using the CLI SAPI
 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
+export SKIP_ONLINE_TESTS=1
 unset TZ LANG LC_ALL
 if ! make test; then
   set +x
@@ -1160,6 +1152,15 @@ rm -f README.{Zeus,QNX,CVS-RULES}
 rm files.* macros.php
 
 %if %{with_fpm}
+%pre fpm
+# Add the "apache" user as we don't require httpd
+getent group  apache >/dev/null || \
+  groupadd -g 48 -r apache
+getent passwd apache >/dev/null || \
+  useradd -r -u 48 -g apache -s /sbin/nologin \
+    -d %{contentdir} -c "Apache" apache
+exit 0
+
 %post fpm
 %if 0%{?systemd_post:1}
 %systemd_post php-fpm.service
@@ -1316,6 +1317,14 @@ fi
 
 
 %changelog
+* Thu Oct 18 2012 Remi Collet <remi at fedoraproject.org> 5.4.8-1
+- update to 5.4.8
+- define both session.save_handler and session.save_path
+- fix possible segfault in libxml (#828526)
+- php-fpm: create apache user if needed
+- use SKIP_ONLINE_TEST during make test
+- php-devel requires pcre-devel and php-cli (instead of php)
+
 * Fri Oct  5 2012 Remi Collet <remi at fedoraproject.org> 5.4.7-11
 - provides php-phar
 - update systzdata patch to v10, timezone are case insensitive
diff --git a/sources b/sources
index 619861b..54445d2 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-9cd421f1cc8fa8e7f215e44a1b06199f  php-5.4.7.tar.bz2
+bb8c816a9299be8995255ef70c63b800  php-5.4.8.tar.bz2


More information about the scm-commits mailing list