summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-11-04 13:37:39 +0100
committerSergei Golubchik <sergii@pisem.net>2013-11-04 13:37:39 +0100
commit79d2e6c82f5dfa2b5fd9f74d2129815b22ca819c (patch)
tree4070152e70f2270745448edaf36532c5ba5f882a /sql/sql_acl.cc
parent00ba619106ca11aef27b8203fc03da2ec6c96409 (diff)
downloadmariadb-git-79d2e6c82f5dfa2b5fd9f74d2129815b22ca819c.tar.gz
MDEV-5232 SET ROLE checks privileges differently from check_access()
use the same inconsistent priv_user@host pair for SET ROLE privilege checks, just as check_access() does
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index adc073f7117..879316f1da3 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1871,7 +1871,9 @@ int acl_check_setrole(THD *thd, char *rolename, ulonglong *access)
continue;
acl_user= (ACL_USER *)acl_user_base;
- if (acl_user->wild_eq(thd->security_ctx->user, thd->security_ctx->host))
+ /* 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))
{
is_granted= TRUE;
break;