Commit 7d4bfba9 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru Committed by Sergei Golubchik

Added error message for invalid role

parent 0254c9a4
...@@ -6563,3 +6563,9 @@ ER_NO_SUCH_QUERY ...@@ -6563,3 +6563,9 @@ ER_NO_SUCH_QUERY
eng "Unknown query id: %lld" eng "Unknown query id: %lld"
ger "Unbekannte Abfrage-ID: %lld" ger "Unbekannte Abfrage-ID: %lld"
rus "Неизвестный номер запроса: %lld" rus "Неизвестный номер запроса: %lld"
ER_INVALID_ROLE
eng "The role '%s' has not been granted or is invalid."
rum "Rolul '%s' este invalid sau nu a fost acordat."
ER_INVALID_CURRENT_USER
eng "The current user is invalid."
rum "Utilizatorul curent este invalid."
...@@ -1689,7 +1689,10 @@ bool acl_setrole(THD *thd, char *rolename) ...@@ -1689,7 +1689,10 @@ bool acl_setrole(THD *thd, char *rolename)
acl_user= find_acl_user(thd->security_ctx->host, thd->security_ctx->user, acl_user= find_acl_user(thd->security_ctx->host, thd->security_ctx->user,
FALSE); FALSE);
if (acl_user == NULL) if (acl_user == NULL)
{
my_error(ER_INVALID_CURRENT_USER, MYF(0), rolename);
result= -1; result= -1;
}
else else
thd->security_ctx->master_access= acl_user->access; thd->security_ctx->master_access= acl_user->access;
...@@ -1697,6 +1700,7 @@ bool acl_setrole(THD *thd, char *rolename) ...@@ -1697,6 +1700,7 @@ bool acl_setrole(THD *thd, char *rolename)
} }
if (role == NULL) { if (role == NULL) {
my_error(ER_INVALID_ROLE, MYF(0), rolename);
result= -1; result= -1;
goto end; goto end;
} }
...@@ -1719,6 +1723,7 @@ bool acl_setrole(THD *thd, char *rolename) ...@@ -1719,6 +1723,7 @@ bool acl_setrole(THD *thd, char *rolename)
if (!is_granted) if (!is_granted)
{ {
my_error(ER_INVALID_ROLE, MYF(0), rolename);
result= 1; result= 1;
goto end; goto end;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment