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

MDEV-22966 Server crashes or hangs with SET ROLE when started with skip-grant-tables

This commit is contained in:
Sergei Golubchik
2021-01-09 17:00:04 +01:00
parent 69f1adaa55
commit fc0d9a470c
3 changed files with 25 additions and 0 deletions

View File

@ -2770,6 +2770,12 @@ end:
int acl_check_setrole(THD *thd, char *rolename, ulonglong *access)
{
if (!initialized)
{
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
return 1;
}
return check_user_can_set_role(thd, thd->security_ctx->priv_user,
thd->security_ctx->host, thd->security_ctx->ip, rolename, access);
}