]> git.pld-linux.org Git - packages/php.git/blob - mysql-auth.patch
- rel 27 (libvpx 1.14)
[packages/php.git] / mysql-auth.patch
1 --- php-5.6.40/ext/mysqlnd/mysqlnd.c.org        2019-01-09 10:54:13.000000000 +0100
2 +++ php-5.6.40/ext/mysqlnd/mysqlnd.c    2024-03-19 12:48:22.169953022 +0100
3 @@ -599,11 +599,15 @@ mysqlnd_run_authentication(
4                 struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol TSRMLS_CC);
5  
6                 if (!auth_plugin) {
7 -                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
8 -                       SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
9 -                       goto end;
10 +                       if (first_call) {
11 +                               mnd_pefree(requested_protocol, FALSE);
12 +                               requested_protocol = mnd_pestrdup(MYSQLND_DEFAULT_AUTH_PROTOCOL, FALSE);
13 +                       } else {
14 +                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
15 +                               SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
16 +                               goto end;
17 +                       }
18                 }
19 -               DBG_INF("plugin found");
20  
21                 {
22                         zend_uchar * switch_to_auth_protocol_data = NULL;
23 @@ -628,9 +632,12 @@ mysqlnd_run_authentication(
24  
25                         DBG_INF_FMT("salt(%d)=[%.*s]", plugin_data_len, plugin_data_len, plugin_data);
26                         /* The data should be allocated with malloc() */
27 -                       scrambled_data =
28 -                               auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
29 -                                                                                                  plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags TSRMLS_CC);
30 +                       if (auth_plugin) {
31 +                               scrambled_data =
32 +                                       auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
33 +                                                                                                          plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags TSRMLS_CC);
34 +                       }
35 +
36                         if (conn->error_info->error_no) {
37                                 goto end;       
38                         }
This page took 0.036785 seconds and 3 git commands to generate.