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:
2
mysql-test/r/grant5.result
Normal file
2
mysql-test/r/grant5.result
Normal 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
7
mysql-test/t/grant5.test
Normal 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;
|
@ -4335,8 +4335,9 @@ end_with_restore_list:
|
||||
if (!grant_user)
|
||||
goto error;
|
||||
|
||||
if (grant_user->user.str &&
|
||||
!strcmp(thd->security_ctx->priv_user, 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_host, grant_user->host.str))
|
||||
grant_user->user= current_user;
|
||||
|
||||
if (grant_user->user.str == current_user.str ||
|
||||
|
Reference in New Issue
Block a user