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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user