diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-04-21 14:51:37 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-04-24 18:15:20 +0200 |
commit | d821dd106ad5086299e3e469f02dfd32eddf04ae (patch) | |
tree | 01a0a24d0e7d596dfd8321c182ac26b578c72061 /sql/sql_parse.cc | |
parent | 23b1b69b101f8f22319a8e661ebe8b4587c435d4 (diff) | |
download | mariadb-git-d821dd106ad5086299e3e469f02dfd32eddf04ae.tar.gz |
MDEV-9580 SHOW GRANTS FOR <current_user> fails
use get_current_user() to distinguish user name without
a hostname and a role name.
move privilege checks inside mysql_show_grants() to remove
duplicate get_current_user() calls
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d2fed787ba9..b91455888b8 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4374,21 +4374,10 @@ end_with_restore_list: case SQLCOM_SHOW_GRANTS: { LEX_USER *grant_user= lex->grant_user; - Security_context *sctx= thd->security_ctx; if (!grant_user) goto error; - if (grant_user->user.str && !strcmp(sctx->priv_user, grant_user->user.str) && - grant_user->host.str && !strcmp(sctx->priv_host, grant_user->host.str)) - grant_user->user= current_user; - - if (grant_user->user.str == current_user.str || - grant_user->user.str == current_role.str || - grant_user->user.str == current_user_and_current_role.str || - !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 0)) - { - res = mysql_show_grants(thd, grant_user); - } + res = mysql_show_grants(thd, grant_user); break; } #endif |