1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Added error message for invalid role

This commit is contained in:
Vicențiu Ciorbaru
2013-10-17 15:14:11 -07:00
committed by Sergei Golubchik
parent 0254c9a4bd
commit 7d4bfba91a
2 changed files with 11 additions and 0 deletions

View File

@ -1689,7 +1689,10 @@ bool acl_setrole(THD *thd, char *rolename)
acl_user= find_acl_user(thd->security_ctx->host, thd->security_ctx->user,
FALSE);
if (acl_user == NULL)
{
my_error(ER_INVALID_CURRENT_USER, MYF(0), rolename);
result= -1;
}
else
thd->security_ctx->master_access= acl_user->access;
@ -1697,6 +1700,7 @@ bool acl_setrole(THD *thd, char *rolename)
}
if (role == NULL) {
my_error(ER_INVALID_ROLE, MYF(0), rolename);
result= -1;
goto end;
}
@ -1719,6 +1723,7 @@ bool acl_setrole(THD *thd, char *rolename)
if (!is_granted)
{
my_error(ER_INVALID_ROLE, MYF(0), rolename);
result= 1;
goto end;
}