]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.2' into PHP-7.3
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 20 Aug 2019 11:32:53 +0000 (13:32 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 20 Aug 2019 11:33:45 +0000 (13:33 +0200)
* PHP-7.2:
  fix the problem for connect_attr, set db condition, and add a new attribute _server_host

1  2 
NEWS
ext/mysqlnd/mysqlnd_auth.c
ext/mysqlnd/mysqlnd_connection.c
ext/mysqlnd/mysqlnd_wireprotocol.c

diff --cc NEWS
index c07743ed1a13169badc16b0f6922bdc50247902b,e747a4f8eb4772062bf54b9d4e52251bdf731d56..90e32a74f4f36132a007168036e0f0280a1222e5
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -4,14 -4,14 +4,18 @@@ PH
  
  - Core:
    . Fixed bug #78220 (Can't access OneDrive folder). (cmb, ab)
 -  . Fixed bug #78412 (Generator incorrectly reports non-releasable $this as GC
 -    child). (Nikita)
 +  . Fixed bug #77922 (Double release of doc comment on inherited shadow
 +    property). (Nikita)
 +
 +- Intl:
 +  . Ensure IDNA2003 rules are used with idn_to_ascii() and idn_to_utf8()
 +    when requested. (Sara)
  
 -29 Aug 2019, PHP 7.2.22
+ - MySQLnd:
+   . Fixed connect_attr issues and added the _server_host connection attribute.
+     (Qianqian Bu)
 +29 Aug 2019, PHP 7.3.9
  
  - Core:
    . Fixed bug #78363 (Buffer overflow in zendparse). (Nikita)
index e56ea2038081418577e0ea99bf1e4cd71a93495a,2b23257b735970ea107e92d54e7ca418b42bd2b5..30ef6639cac4700d2ad40943f323dad550b96662
@@@ -376,60 -385,67 +376,63 @@@ mysqlnd_auth_change_user(MYSQLND_CONN_D
  
        DBG_ENTER("mysqlnd_auth_change_user");
  
 -      chg_user_resp = conn->payload_decoder_factory->m.get_change_user_response_packet(conn->payload_decoder_factory, FALSE);
 -
 -      if (!chg_user_resp) {
 -              SET_OOM_ERROR(conn->error_info);
 -              goto end;
 -      }
 +      conn->payload_decoder_factory->m.init_change_user_response_packet(&chg_user_resp);
  
        if (use_full_blown_auth_packet != TRUE) {
 -              change_auth_resp_packet = conn->payload_decoder_factory->m.get_change_auth_response_packet(conn->payload_decoder_factory, FALSE);
 -              if (!change_auth_resp_packet) {
 -                      SET_OOM_ERROR(conn->error_info);
 -                      goto end;
 -              }
 +              MYSQLND_PACKET_CHANGE_AUTH_RESPONSE change_auth_resp_packet;
 +
 +              conn->payload_decoder_factory->m.init_change_auth_response_packet(&change_auth_resp_packet);
  
 -              change_auth_resp_packet->auth_data = auth_plugin_data;
 -              change_auth_resp_packet->auth_data_len = auth_plugin_data_len;
 +              change_auth_resp_packet.auth_data = auth_plugin_data;
 +              change_auth_resp_packet.auth_data_len = auth_plugin_data_len;
  
 -              if (!PACKET_WRITE(change_auth_resp_packet)) {
 +              if (!PACKET_WRITE(conn, &change_auth_resp_packet)) {
                        SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT);
                        SET_CLIENT_ERROR(conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
 +                      PACKET_FREE(&change_auth_resp_packet);
                        goto end;
                }
 +
 +              PACKET_FREE(&change_auth_resp_packet);
        } else {
 -              auth_packet = conn->payload_decoder_factory->m.get_auth_packet(conn->payload_decoder_factory, FALSE);
 +              MYSQLND_PACKET_AUTH auth_packet;
  
 -              if (!auth_packet) {
 -                      SET_OOM_ERROR(conn->error_info);
 -                      goto end;
 -              }
 +              conn->payload_decoder_factory->m.init_auth_packet(&auth_packet);
  
 -              auth_packet->is_change_user_packet = TRUE;
 -              auth_packet->user               = user;
 -              auth_packet->db                 = db;
 -              auth_packet->db_len             = db_len;
 -              auth_packet->silent             = silent;
 +              auth_packet.is_change_user_packet = TRUE;
 +              auth_packet.user                = user;
 +              auth_packet.db                  = db;
 +              auth_packet.db_len              = db_len;
 +              auth_packet.silent              = silent;
  
 -              auth_packet->auth_data = auth_plugin_data;
 -              auth_packet->auth_data_len = auth_plugin_data_len;
 -              auth_packet->auth_plugin_name = auth_protocol;
 +              auth_packet.auth_data = auth_plugin_data;
 +              auth_packet.auth_data_len = auth_plugin_data_len;
 +              auth_packet.auth_plugin_name = auth_protocol;
  
 -                      auth_packet->connect_attr = conn->options->connect_attr;
+         if (conn->server_capabilities & CLIENT_CONNECT_ATTRS) {
++                      auth_packet.connect_attr = conn->options->connect_attr;
+         }
  
                if (conn->m->get_server_version(conn) >= 50123) {
 -                      auth_packet->charset_no = conn->charset->nr;
 +                      auth_packet.charset_no  = conn->charset->nr;
                }
  
 -              if (!PACKET_WRITE(auth_packet)) {
 +              if (!PACKET_WRITE(conn, &auth_packet)) {
                        SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT);
                        SET_CLIENT_ERROR(conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
 +                      PACKET_FREE(&auth_packet);
                        goto end;
                }
 +
 +              PACKET_FREE(&auth_packet);
        }
  
 -      ret = PACKET_READ(chg_user_resp);
 -      COPY_CLIENT_ERROR(conn->error_info, chg_user_resp->error_info);
 +      ret = PACKET_READ(conn, &chg_user_resp);
 +      COPY_CLIENT_ERROR(conn->error_info, chg_user_resp.error_info);
  
 -      if (0xFE == chg_user_resp->response_code) {
 +      if (0xFE == chg_user_resp.response_code) {
                ret = FAIL;
 -              if (!chg_user_resp->new_auth_protocol) {
 +              if (!chg_user_resp.new_auth_protocol) {
                        DBG_ERR(mysqlnd_old_passwd);
                        SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd);
                } else {
Simple merge
Simple merge