]> git.pld-linux.org Git - packages/php.git/commitdiff
Rel 26; allow mysqlnd to work with mysql 8 and be able to connect to accounts using... auto/th/php56-5.6.40-26
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 19 Mar 2024 12:07:08 +0000 (13:07 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 19 Mar 2024 12:07:08 +0000 (13:07 +0100)
mysql-auth.patch [new file with mode: 0644]
php.spec

diff --git a/mysql-auth.patch b/mysql-auth.patch
new file mode 100644 (file)
index 0000000..bc610cc
--- /dev/null
@@ -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;       
+                       }
index c786cb735bb1f54985ca6d335d0eb4ca82dabf33..63d5ea5654c0fb1cd4dac752221daeedd94887dc 100644 (file)
--- 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
This page took 0.092762 seconds and 4 git commands to generate.