diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-04-18 20:04:50 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-04-18 20:04:50 +0200 |
commit | ed4ead3a980be1526f4bea58950b0127291cd598 (patch) | |
tree | f67669c3f1a8d2531087e08054492e529f6a393b | |
parent | 806df88cc60bc06e7d63a19edeb8d162cd481a29 (diff) | |
download | mariadb-git-ed4ead3a980be1526f4bea58950b0127291cd598.tar.gz |
lp:982664 there are few broken clients that lie about their capabilities
(for example, one of them sets client capabilities by copying server capabilities)
We cannot fix them - let's tolerate them
-rw-r--r-- | sql/sql_acl.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index f51de84d819..3eb7daab610 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -7654,14 +7654,16 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, return packet_error; } - if (thd->client_capabilities & CLIENT_PLUGIN_AUTH) + if ((thd->client_capabilities & CLIENT_PLUGIN_AUTH) && + (client_plugin < (char *)net->read_pos + pkt_len)) { - if (client_plugin >= (char *)net->read_pos + pkt_len) - return packet_error; client_plugin= fix_plugin_ptr(client_plugin); } else { + /* Some clients lie. Sad, but true */ + thd->client_capabilities &= ~CLIENT_PLUGIN_AUTH; + if (thd->client_capabilities & CLIENT_SECURE_CONNECTION) client_plugin= native_password_plugin_name.str; else |