mirror of
https://github.com/MariaDB/server.git
synced 2026-04-27 02:35:29 +02:00
MDEV-22312: Bad error message for SET DEFAULT ROLE when user account is not granted the role
- `SET DEFAULT ROLE xxx [FOR yyy]` should say:
"User yyy has not been granted a role xxx" if:
- The current user (not the user `yyy` in the FOR clause) can see the
role xxx. It can see the role if:
* role exists in `mysql.roles_mappings` (traverse the graph),
* If the current user has read access on `mysql.user` table - in
that case, it can see all roles, granted or not.
- Otherwise it should be "Invalid role specification".
In other words, it should not be possible to use `SET DEFAULT ROLE` to discover whether a specific role exist or not.
This commit is contained in:
parent
dbe447a789
commit
957cb7b7ba
8 changed files with 294 additions and 45 deletions
|
|
@ -402,7 +402,7 @@ bool acl_check_proxy_grant_access (THD *thd, const char *host, const char *user,
|
|||
bool with_grant);
|
||||
int acl_setrole(THD *thd, char *rolename, ulonglong access);
|
||||
int acl_check_setrole(THD *thd, char *rolename, ulonglong *access);
|
||||
int acl_check_set_default_role(THD *thd, const char *host, const char *user);
|
||||
int acl_check_set_default_role(THD *thd, const char *host, const char *user, const char *role);
|
||||
int acl_set_default_role(THD *thd, const char *host, const char *user,
|
||||
const char *rolename);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue