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
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

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);