[packages/php/PHP_5_6] Rel 26; allow mysqlnd to work with mysql 8 and be able to connect to accounts using mysql_native_pas

arekm arekm at pld-linux.org
Tue Mar 19 13:59:14 CET 2024


commit 197eb65e8d9f62ede33c82fbab6ef487b0ea5a09
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Mar 19 13:07:08 2024 +0100

    Rel 26; allow mysqlnd to work with mysql 8 and be able to connect to accounts using mysql_native_password even with default caching_sha2_password enabled (fixes 'The server requested authentication method unknown to the client')

 mysql-auth.patch | 38 ++++++++++++++++++++++++++++++++++++++
 php.spec         |  5 +++--
 2 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/php.spec b/php.spec
index c786cb7..63d5ea5 100644
--- a/php.spec
+++ b/php.spec
@@ -155,7 +155,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine	with_filter
 %endif
 
-%define		rel	25
+%define		rel	26
 %define		orgname	php
 %define		ver_suffix 56
 %define		php_suffix %{!?with_default_php:%{ver_suffix}}
@@ -201,6 +201,7 @@ Patch12:	openssl.patch
 Patch13:	crypt.patch
 Patch14:	%{orgname}-no_pear_install.patch
 Patch15:	charset.patch
+Patch16:	mysql-auth.patch
 Patch17:	%{orgname}-readline.patch
 Patch18:	%{orgname}-nohttpd.patch
 Patch21:	%{orgname}-dba-link.patch
@@ -2113,7 +2114,7 @@ cp -p php.ini-production php.ini
 %patch13 -p1
 %patch14 -p1
 %patch15 -p1
-
+%patch16 -p1
 %patch17 -p1
 %patch18 -p1
 %patch21 -p1
diff --git a/mysql-auth.patch b/mysql-auth.patch
new file mode 100644
index 0000000..bc610cc
--- /dev/null
+++ b/mysql-auth.patch
@@ -0,0 +1,38 @@
+--- php-5.6.40/ext/mysqlnd/mysqlnd.c.org	2019-01-09 10:54:13.000000000 +0100
++++ php-5.6.40/ext/mysqlnd/mysqlnd.c	2024-03-19 12:48:22.169953022 +0100
+@@ -599,11 +599,15 @@ mysqlnd_run_authentication(
+ 		struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol TSRMLS_CC);
+ 
+ 		if (!auth_plugin) {
+-			php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
+-			SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
+-			goto end;
++			if (first_call) {
++				mnd_pefree(requested_protocol, FALSE);
++				requested_protocol = mnd_pestrdup(MYSQLND_DEFAULT_AUTH_PROTOCOL, FALSE);
++			} else {
++				php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
++				SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
++				goto end;
++			}
+ 		}
+-		DBG_INF("plugin found");
+ 
+ 		{
+ 			zend_uchar * switch_to_auth_protocol_data = NULL;
+@@ -628,9 +632,12 @@ mysqlnd_run_authentication(
+ 
+ 			DBG_INF_FMT("salt(%d)=[%.*s]", plugin_data_len, plugin_data_len, plugin_data);
+ 			/* The data should be allocated with malloc() */
+-			scrambled_data =
+-				auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
+-												   plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags TSRMLS_CC);
++			if (auth_plugin) {
++				scrambled_data =
++					auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
++													   plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags TSRMLS_CC);
++			}
++
+ 			if (conn->error_info->error_no) {
+ 				goto end;	
+ 			}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/197eb65e8d9f62ede33c82fbab6ef487b0ea5a09



More information about the pld-cvs-commit mailing list