1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-6625 SHOW GRANTS for current_user_name@wrong_host_name

This commit is contained in:
Sergei Golubchik
2014-08-21 21:25:22 +02:00
parent b5ebc21169
commit 57a43b8435
3 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,2 @@
SHOW GRANTS FOR root@invalid_host;
ERROR 42000: There is no such grant defined for user 'root' on host 'invalid_host'

7
mysql-test/t/grant5.test Normal file
View File

@ -0,0 +1,7 @@
-- source include/not_embedded.inc
#
# MDEV-6625 SHOW GRANTS for current_user_name@wrong_host_name
#
--error ER_NONEXISTING_GRANT
SHOW GRANTS FOR root@invalid_host;

View File

@ -4335,8 +4335,9 @@ end_with_restore_list:
if (!grant_user) if (!grant_user)
goto error; goto error;
if (grant_user->user.str && if (grant_user->user.str && grant_user->host.str &&
!strcmp(thd->security_ctx->priv_user, grant_user->user.str)) !strcmp(thd->security_ctx->priv_user, grant_user->user.str) &&
!strcmp(thd->security_ctx->priv_host, grant_user->host.str))
grant_user->user= current_user; grant_user->user= current_user;
if (grant_user->user.str == current_user.str || if (grant_user->user.str == current_user.str ||