From: Andrey Hristov Date: Fri, 2 Oct 2015 12:08:59 +0000 (+0200) Subject: MNDR : X-Git-Tag: php-7.1.0alpha1~811 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f38d479e16f41ce401094dc4658030832f23937;p=php MNDR : - Rename MYSQLND_OPTIONS to MYSQLND_SESSION_OPTIONS - Rename MYSQLND_NET_OPTIONS to MYSQLND_IO_OPTIONS --- diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 6d4232dbd5..e2596d385e 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -439,7 +439,7 @@ static enum_func_status mysqlnd_switch_to_ssl_if_needed( MYSQLND_CONN_DATA * conn, const MYSQLND_PACKET_GREET * const greet_packet, - const MYSQLND_OPTIONS * const options, + const MYSQLND_SESSION_OPTIONS * const session_options, zend_ulong mysql_flags) { enum_func_status ret = FAIL; @@ -481,7 +481,7 @@ mysqlnd_switch_to_ssl_if_needed( auth_packet->client_flags = mysql_flags; auth_packet->max_packet_size = MYSQLND_ASSEMBLED_PACKET_MAX_SIZE; - if (options->charset_name && (charset = mysqlnd_find_charset_name(options->charset_name))) { + if (session_options->charset_name && (charset = mysqlnd_find_charset_name(session_options->charset_name))) { auth_packet->charset_no = charset->nr; } else { auth_packet->charset_no = greet_packet->charset_no; @@ -562,7 +562,7 @@ mysqlnd_run_authentication( const size_t auth_plugin_data_len, const char * const auth_protocol, unsigned int charset_no, - const MYSQLND_OPTIONS * const options, + const MYSQLND_SESSION_OPTIONS * const session_options, zend_ulong mysql_flags, zend_bool silent, zend_bool is_change_user @@ -627,12 +627,13 @@ mysqlnd_run_authentication( /* 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); + plugin_data, plugin_data_len, session_options, + &conn->net->data->options, mysql_flags); if (conn->error_info->error_no) { goto end; } if (FALSE == is_change_user) { - ret = mysqlnd_auth_handshake(conn, user, passwd, passwd_len, db, db_len, options, mysql_flags, + ret = mysqlnd_auth_handshake(conn, user, passwd, passwd_len, db, db_len, session_options, mysql_flags, charset_no, first_call, requested_protocol, @@ -694,18 +695,18 @@ mysqlnd_connect_run_authentication( size_t db_len, size_t passwd_len, const MYSQLND_PACKET_GREET * const greet_packet, - const MYSQLND_OPTIONS * const options, + const MYSQLND_SESSION_OPTIONS * const session_options, zend_ulong mysql_flags ) { enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_connect_run_authentication"); - ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags); + ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, session_options, mysql_flags); if (PASS == ret) { ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, db_len, greet_packet->auth_plugin_data, greet_packet->auth_plugin_data_len, greet_packet->auth_protocol, - greet_packet->charset_no, options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/); + greet_packet->charset_no, session_options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/); } DBG_RETURN(ret); } diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index e4632496f9..ac15bf66df 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -36,7 +36,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn, const size_t passwd_len, const char * const db, const size_t db_len, - const MYSQLND_OPTIONS * const options, + const MYSQLND_SESSION_OPTIONS * const session_options, zend_ulong mysql_flags, unsigned int server_charset_no, zend_bool use_full_blown_auth_packet, @@ -83,8 +83,8 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn, auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE); auth_packet->client_flags = mysql_flags; - auth_packet->max_packet_size = options->max_allowed_packet; - if (options->charset_name && (charset = mysqlnd_find_charset_name(options->charset_name))) { + auth_packet->max_packet_size = session_options->max_allowed_packet; + if (session_options->charset_name && (charset = mysqlnd_find_charset_name(session_options->charset_name))) { auth_packet->charset_no = charset->nr; } else { auth_packet->charset_no = server_charset_no; @@ -359,8 +359,8 @@ mysqlnd_native_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self size_t * auth_data_len, MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len, - const MYSQLND_OPTIONS * const options, - const MYSQLND_NET_OPTIONS * const net_options, + const MYSQLND_SESSION_OPTIONS * const session_options, + const MYSQLND_IO_OPTIONS * const io_options, zend_ulong mysql_flags ) { @@ -419,8 +419,8 @@ mysqlnd_pam_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self, size_t * auth_data_len, MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len, - const MYSQLND_OPTIONS * const options, - const MYSQLND_NET_OPTIONS * const net_options, + const MYSQLND_SESSION_OPTIONS * const session_options, + const MYSQLND_IO_OPTIONS * const io_options, zend_ulong mysql_flags ) { @@ -480,18 +480,18 @@ mysqlnd_xor_string(char * dst, const size_t dst_len, const char * xor_str, const /* {{{ mysqlnd_sha256_get_rsa_key */ static RSA * mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn, - const MYSQLND_OPTIONS * const options, - const MYSQLND_NET_OPTIONS * const net_options + const MYSQLND_SESSION_OPTIONS * const session_options, + const MYSQLND_IO_OPTIONS * const io_options ) { RSA * ret = NULL; - const char * fname = (net_options->sha256_server_public_key && net_options->sha256_server_public_key[0] != '\0')? - net_options->sha256_server_public_key: + const char * fname = (io_options->sha256_server_public_key && io_options->sha256_server_public_key[0] != '\0')? + io_options->sha256_server_public_key: MYSQLND_G(sha256_server_public_key); php_stream * stream; DBG_ENTER("mysqlnd_sha256_get_rsa_key"); DBG_INF_FMT("options_s256_pk=[%s] MYSQLND_G(sha256_server_public_key)=[%s]", - net_options->sha256_server_public_key? net_options->sha256_server_public_key:"n/a", + io_options->sha256_server_public_key? io_options->sha256_server_public_key:"n/a", MYSQLND_G(sha256_server_public_key)? MYSQLND_G(sha256_server_public_key):"n/a"); if (!fname || fname[0] == '\0') { MYSQLND_PACKET_SHA256_PK_REQUEST * pk_req_packet = NULL; @@ -569,8 +569,8 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self size_t * auth_data_len, MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len, - const MYSQLND_OPTIONS * const options, - const MYSQLND_NET_OPTIONS * const net_options, + const MYSQLND_SESSION_OPTIONS * const session_options, + const MYSQLND_IO_OPTIONS * const io_options, zend_ulong mysql_flags ) { @@ -588,7 +588,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self memcpy(ret, passwd, passwd_len); } else { *auth_data_len = 0; - server_public_key = mysqlnd_sha256_get_rsa_key(conn, options, net_options); + server_public_key = mysqlnd_sha256_get_rsa_key(conn, session_options, io_options); if (server_public_key) { int server_public_key_len; diff --git a/ext/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h index 683670f307..2a78dd48b6 100644 --- a/ext/mysqlnd/mysqlnd_priv.h +++ b/ext/mysqlnd/mysqlnd_priv.h @@ -208,7 +208,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn, const size_t passwd_len, const char * const db, const size_t db_len, - const MYSQLND_OPTIONS * const options, + const MYSQLND_SESSION_OPTIONS * const session_options, zend_ulong mysql_flags, unsigned int server_charset_no, zend_bool use_full_blown_auth_packet, diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index c01f5f9034..ef7ce41c23 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -156,7 +156,7 @@ typedef struct st_mysqlnd_infile void (*local_infile_end)(void *ptr); } MYSQLND_INFILE; -typedef struct st_mysqlnd_options +typedef struct st_mysqlnd_session_options { ulong flags; @@ -175,9 +175,9 @@ typedef struct st_mysqlnd_options in the memory which can crash external code. Feel free to reuse these. */ HashTable * connect_attr; + char * unused1; + char * unused2; char * unused3; - char * unused4; - char * unused5; enum_mysqlnd_protocol_type protocol; @@ -188,9 +188,9 @@ typedef struct st_mysqlnd_options #ifdef MYSQLND_STRING_TO_INT_CONVERSION zend_bool int_and_float_native; #endif -} MYSQLND_OPTIONS; +} MYSQLND_SESSION_OPTIONS; -typedef struct st_mysqlnd_net_options +typedef struct st_mysqlnd_io_options { /* timeouts */ unsigned int timeout_connect; @@ -216,12 +216,7 @@ typedef struct st_mysqlnd_net_options uint64_t flags; char * sha256_server_public_key; - - char * unused1; - char * unused2; - char * unused3; - char * unused4; -} MYSQLND_NET_OPTIONS; +} MYSQLND_IO_OPTIONS; @@ -866,7 +861,7 @@ struct st_mysqlnd_net_data #else zend_uchar unused_pad1; #endif - MYSQLND_NET_OPTIONS options; + MYSQLND_IO_OPTIONS options; unsigned int refcount; @@ -969,8 +964,8 @@ struct st_mysqlnd_connection_data unsigned int field_count; /* options */ - MYSQLND_OPTIONS * options; - MYSQLND_OPTIONS options_impl; + MYSQLND_SESSION_OPTIONS * options; + MYSQLND_SESSION_OPTIONS options_impl; /* stats */ MYSQLND_STATS * stats; @@ -1225,8 +1220,8 @@ typedef zend_uchar * (*func_auth_plugin__get_auth_data)(struct st_mysqlnd_authen size_t * auth_data_len, MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len, - const MYSQLND_OPTIONS * const options, - const MYSQLND_NET_OPTIONS * const net_options, zend_ulong mysql_flags + const MYSQLND_SESSION_OPTIONS * const session_options, + const MYSQLND_IO_OPTIONS * const io_options, zend_ulong mysql_flags ); struct st_mysqlnd_authentication_plugin