diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-10-12 15:07:15 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-10-12 15:07:15 +0300 |
commit | e8313e13aa765deb8b948731c6c5b23914c11722 (patch) | |
tree | acbdc8415cbba55527d849790c836f70d5df21dc /sql/sql_acl.cc | |
parent | 41b2a8a9f344dbd032884f753ad4159850bf05c8 (diff) | |
parent | b7a4918fe8e1ace2c3ef21a4a4b2ad737d3ccf69 (diff) | |
download | mariadb-git-e8313e13aa765deb8b948731c6c5b23914c11722.tar.gz |
merge mysql-5.5->mysql-5.5-security
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index aaf8ed26966..3438e60683f 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -8885,24 +8885,18 @@ skip_to_ssl: /** - Make sure that when sending plugin supplued data to the client they + Make sure that when sending plugin supplied data to the client they are not considered a special out-of-band command, like e.g. - \255 (error) or \254 (change user request packet). - To avoid this we send plugin data packets starting with one of these - 2 bytes "wrapped" in a command \1. - For the above reason we have to wrap plugin data packets starting with - \1 as well. + \255 (error) or \254 (change user request packet) or \0 (OK). + To avoid this the server will send all plugin data packets "wrapped" + in a command \1. + Note that the client will continue sending its replies unrwapped. */ -#define IS_OUT_OF_BAND_PACKET(packet,packet_len) \ - ((packet_len) > 0 && \ - (*(packet) == 1 || *(packet) == 255 || *(packet) == 254)) - static inline int wrap_plguin_data_into_proper_command(NET *net, const uchar *packet, int packet_len) { - DBUG_ASSERT(IS_OUT_OF_BAND_PACKET(packet, packet_len)); return net_write_command(net, 1, (uchar *) "", 0, packet, packet_len); } @@ -8939,13 +8933,8 @@ static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param, res= send_server_handshake_packet(mpvio, (char*) packet, packet_len); else if (mpvio->status == MPVIO_EXT::RESTART) res= send_plugin_request_packet(mpvio, packet, packet_len); - else if (IS_OUT_OF_BAND_PACKET(packet, packet_len)) - res= wrap_plguin_data_into_proper_command(mpvio->net, packet, packet_len); else - { - res= my_net_write(mpvio->net, packet, packet_len) || - net_flush(mpvio->net); - } + res= wrap_plguin_data_into_proper_command(mpvio->net, packet, packet_len); mpvio->packets_written++; DBUG_RETURN(res); } @@ -9716,7 +9705,8 @@ mysql_declare_plugin(mysql_password) 0x0100, /* Version (1.0) */ NULL, /* status variables */ NULL, /* system variables */ - NULL /* config options */ + NULL, /* config options */ + 0, /* flags */ }, { MYSQL_AUTHENTICATION_PLUGIN, /* type constant */ @@ -9730,7 +9720,8 @@ mysql_declare_plugin(mysql_password) 0x0100, /* Version (1.0) */ NULL, /* status variables */ NULL, /* system variables */ - NULL /* config options */ + NULL, /* config options */ + 0, /* flags */ } mysql_declare_plugin_end; |