MXS-3069: Fix plugin name comparison

Connectors that wouldn't send the plugin name even when the plugin
authentication capability was enabled would have to do an extra step in
the authentication.
This commit is contained in:
Markus Mäkelä 2020-07-07 08:40:30 +03:00
parent 6c9249131f
commit 32fa7b6800
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -645,8 +645,11 @@ static bool mysql_auth_set_client_data(MYSQL_session* client_data,
else
{
// Check that the plugin is as expected. If not, make a note so the
// authentication function switches the plugin.
bool correct_auth = strcmp(plugin_name, DEFAULT_MYSQL_AUTH_PLUGIN) == 0;
// authentication function switches the plugin. An empty auth plugin
// name should be interpreted as the connector using the same plugin
// we sent in the initial handshake.
bool correct_auth = strcmp(plugin_name, DEFAULT_MYSQL_AUTH_PLUGIN) == 0
|| *plugin_name == '\0';
client_data->correct_authenticator = correct_auth;
if (!correct_auth)
{