[packages/php] - rel 2; obey default context options in mysqlnd

arekm arekm at pld-linux.org
Mon Aug 10 13:41:12 CEST 2015


commit 18d0d716aa3b3e5fddf157162d5d67c1e85a2dfb
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Aug 10 13:41:05 2015 +0200

    - rel 2; obey default context options in mysqlnd

 php-mysql-ssl-context.patch | 36 ++++++++++++++++++++++++++++++++++++
 php.spec                    |  5 ++++-
 2 files changed, 40 insertions(+), 1 deletion(-)
---
diff --git a/php.spec b/php.spec
index 9e8bfd2..685672f 100644
--- a/php.spec
+++ b/php.spec
@@ -153,7 +153,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine	with_filter
 %endif
 
-%define		rel	1
+%define		rel	2
 %define		orgname	php
 %define		ver_suffix 56
 %define		php_suffix %{!?with_default_php:%{ver_suffix}}
@@ -230,6 +230,8 @@ Patch62:	mcrypt-libs.patch
 Patch65:	system-libzip.patch
 Patch66:	php-db.patch
 Patch67:	mysql-lib-ver-mismatch.patch
+# https://bugs.php.net/bug.php?id=68344
+Patch68:	php-mysql-ssl-context.patch
 Patch69:	fpm-conf-split.patch
 Patch70:	mysqlnd-ssl.patch
 URL:		http://www.php.net/
@@ -2081,6 +2083,7 @@ exit 1
 %{?with_system_libzip:%patch65 -p1}
 %patch66 -p1
 %patch67 -p1
+%patch68 -p1
 %patch70 -p1
 
 sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
diff --git a/php-mysql-ssl-context.patch b/php-mysql-ssl-context.patch
new file mode 100644
index 0000000..c8ff48d
--- /dev/null
+++ b/php-mysql-ssl-context.patch
@@ -0,0 +1,36 @@
+; obey default context options
+; https://bugs.php.net/bug.php?id=68344
+diff -urbB php-5.6.12/ext/mysqlnd/mysqlnd_net.c php-5.6.12/ext/mysqlnd/mysqlnd_net.c
+--- php-5.6.12/ext/mysqlnd/mysqlnd_net.c	2015-08-06 09:55:57.000000000 +0200
++++ php-5.6.12/ext/mysqlnd/mysqlnd_net.c	2015-08-10 13:25:30.187912101 +0200
+@@ -29,6 +29,7 @@
+ #include "mysqlnd_ext_plugin.h"
+ #include "php_network.h"
+ #include "zend_ini.h"
++#include "ext/standard/file.h"
+ #ifdef MYSQLND_COMPRESSION_ENABLED
+ #include <zlib.h>
+ #endif
+@@ -868,6 +868,21 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(
+ 		DBG_RETURN(FAIL);
+ 	}
+ 
++	if (FG(default_context)) {
++		zval **tmpzval = NULL;
++		int i = 0;
++		/* copy values from default stream settings */
++		char *opts[] = { "allow_self_signed", "cafile", "capath", "ciphers", "CN_match",
++			"disable_compression", "local_cert", "local_pk", "no_ticket", "passphrase",
++			"peer_fingerprint", "peer_name", "SNI_enabled", "SNI_server_certs", "SNI_server_name",
++			"verify_depth", "verify_peer", "verify_peer_name", NULL };
++		while (opts[i]) {
++			if (php_stream_context_get_option(FG(default_context), "ssl", opts[i], &tmpzval) == SUCCESS)
++				php_stream_context_set_option(context, "ssl", opts[i], *tmpzval);
++			i++;
++		}
++	}
++
+ 	if (net->data->options.ssl_key) {
+ 		zval key_zval;
+ 		ZVAL_STRING(&key_zval, net->data->options.ssl_key, 0);
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/18d0d716aa3b3e5fddf157162d5d67c1e85a2dfb



More information about the pld-cvs-commit mailing list