mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge branch '10.4' into 10.5
This commit is contained in:
@ -2175,7 +2175,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;
|
||||
}
|
||||
|
||||
|
||||
@ -2189,7 +2194,6 @@ static bool validate_password(THD *thd, const LEX_CSTRING &user,
|
||||
if (plugin_foreach(NULL, do_validate,
|
||||
MariaDB_PASSWORD_VALIDATION_PLUGIN, &data))
|
||||
{
|
||||
my_error(ER_NOT_VALID_PASSWORD, MYF(0));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -10746,24 +10750,21 @@ static int handle_grant_data(THD *thd, Grant_tables& tables, bool drop,
|
||||
}
|
||||
|
||||
/* Handle roles_mapping table. */
|
||||
if (tables.roles_mapping_table().table_exists())
|
||||
if (tables.roles_mapping_table().table_exists() &&
|
||||
(found= handle_grant_table(thd, tables.roles_mapping_table(),
|
||||
ROLES_MAPPING_TABLE, drop, user_from, user_to)) < 0)
|
||||
{
|
||||
if ((found= handle_grant_table(thd, tables.roles_mapping_table(),
|
||||
ROLES_MAPPING_TABLE, drop,
|
||||
user_from, user_to)) < 0)
|
||||
{
|
||||
/* Handle of table failed, don't touch the in-memory array. */
|
||||
result= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Handle acl_roles_mappings array */
|
||||
if ((handle_grant_struct(ROLES_MAPPINGS_HASH, drop, user_from, user_to) || found)
|
||||
&& ! result)
|
||||
result= 1; /* At least one record/element found */
|
||||
if (search_only)
|
||||
goto end;
|
||||
}
|
||||
/* Handle of table failed, don't touch the in-memory array. */
|
||||
result= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Handle acl_roles_mappings array */
|
||||
if ((handle_grant_struct(ROLES_MAPPINGS_HASH, drop, user_from, user_to) || found)
|
||||
&& ! result)
|
||||
result= 1; /* At least one record/element found */
|
||||
if (search_only)
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Handle user table. */
|
||||
|
Reference in New Issue
Block a user