Refresh users on failed reauthentication

If the reauthentication of a client that is performing a COM_CHANGE_USER
fails, the users need to be reloaded. Without the reloading, the
reauthentication will fail if new users were added after the last loading
of users.
This commit is contained in:
Markus Mäkelä
2018-05-11 13:03:42 +03:00
parent ee2c3e21c7
commit 521cce7c17

View File

@ -645,6 +645,11 @@ int mysql_auth_reauthenticate(DCB *dcb, const char *user,
MYSQL_AUTH *instance = (MYSQL_AUTH*)dcb->listener->auth_instance;
int rc = validate_mysql_user(instance, dcb, &temp, scramble, scramble_len);
if (rc != MXS_AUTH_SUCCEEDED && service_refresh_users(dcb->service) == 0)
{
rc = validate_mysql_user(instance, dcb, &temp, scramble, scramble_len);
}
if (rc == MXS_AUTH_SUCCEEDED)
{
memcpy(output_token, temp.client_sha1, output_token_len);