1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-26647 (plugin name) Include password validation plugin information in the error message if the SQL statement is not satisfied password policy

Add plugin name to the error message.
This commit is contained in:
Oleksandr Byelkin
2021-10-20 10:21:00 +02:00
parent 0ee1082bd2
commit cc6bba008d
6 changed files with 37 additions and 32 deletions

View File

@ -1450,7 +1450,12 @@ static my_bool do_validate(THD *, plugin_ref plugin, void *arg)
struct validation_data *data= (struct validation_data *)arg;
struct st_mariadb_password_validation *handler=
(st_mariadb_password_validation *)plugin_decl(plugin)->info;
return handler->validate_password(data->user, data->password);
if (handler->validate_password(data->user, data->password))
{
my_error(ER_NOT_VALID_PASSWORD, MYF(0), plugin_ref_to_int(plugin)->name.str);
return true;
}
return false;
}
@ -1464,7 +1469,6 @@ static bool validate_password(LEX_USER *user, THD *thd)
if (plugin_foreach(NULL, do_validate,
MariaDB_PASSWORD_VALIDATION_PLUGIN, &data))
{
my_error(ER_NOT_VALID_PASSWORD, MYF(0));
return true;
}
}