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

MDEV-6401 SET ROLE returning ERROR 1959 Invalid role specification for valid role

Use user's ip address when verifying privileges for SET ROLE (just like check_access() does)
This commit is contained in:
Sergei Golubchik
2014-06-27 09:32:55 +02:00
parent 86362129a2
commit b9ddeeff24
3 changed files with 28 additions and 2 deletions

View File

@ -300,7 +300,7 @@ public:
bool eq(const char *user2, const char *host2) { return !cmp(user2, host2); }
bool wild_eq(const char *user2, const char *host2, const char *ip2 = 0)
bool wild_eq(const char *user2, const char *host2, const char *ip2)
{
if (strcmp(safe_str(user.str), safe_str(user2)))
return false;
@ -1883,7 +1883,7 @@ int acl_check_setrole(THD *thd, char *rolename, ulonglong *access)
acl_user= (ACL_USER *)acl_user_base;
/* Yes! priv_user@host. Don't ask why - that's what check_access() does. */
if (acl_user->wild_eq(thd->security_ctx->priv_user,
thd->security_ctx->host))
thd->security_ctx->host, thd->security_ctx->ip))
{
is_granted= TRUE;
break;