mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
issue ER_USER_IS_BLOCKED also for non-existent users
following the same masquerading logic
This commit is contained in:
@ -12828,15 +12828,6 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
|
|||||||
|
|
||||||
ACL_USER *user= find_user_or_anon(sctx->host, sctx->user, sctx->ip);
|
ACL_USER *user= find_user_or_anon(sctx->host, sctx->user, sctx->ip);
|
||||||
|
|
||||||
if (user && user->password_errors >= max_password_errors && !ignore_max_password_errors(user))
|
|
||||||
{
|
|
||||||
mysql_mutex_unlock(&acl_cache->lock);
|
|
||||||
my_error(ER_USER_IS_BLOCKED, MYF(0));
|
|
||||||
general_log_print(mpvio->auth_info.thd, COM_CONNECT,
|
|
||||||
ER_THD(mpvio->auth_info.thd, ER_USER_IS_BLOCKED));
|
|
||||||
DBUG_RETURN(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user)
|
if (user)
|
||||||
mpvio->acl_user= user->copy(mpvio->auth_info.thd->mem_root);
|
mpvio->acl_user= user->copy(mpvio->auth_info.thd->mem_root);
|
||||||
|
|
||||||
@ -12873,6 +12864,15 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
|
|||||||
mpvio->make_it_fail= true;
|
mpvio->make_it_fail= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mpvio->acl_user->password_errors >= max_password_errors &&
|
||||||
|
!ignore_max_password_errors(mpvio->acl_user))
|
||||||
|
{
|
||||||
|
my_error(ER_USER_IS_BLOCKED, MYF(0));
|
||||||
|
general_log_print(mpvio->auth_info.thd, COM_CONNECT,
|
||||||
|
ER_THD(mpvio->auth_info.thd, ER_USER_IS_BLOCKED));
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* user account requires non-default plugin and the client is too old */
|
/* user account requires non-default plugin and the client is too old */
|
||||||
if (mpvio->acl_user->auth->plugin.str != native_password_plugin_name.str &&
|
if (mpvio->acl_user->auth->plugin.str != native_password_plugin_name.str &&
|
||||||
mpvio->acl_user->auth->plugin.str != old_password_plugin_name.str &&
|
mpvio->acl_user->auth->plugin.str != old_password_plugin_name.str &&
|
||||||
|
Reference in New Issue
Block a user