-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
privilege: fix user with %
hostname can not show grants.
#15825
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15825 +/- ##
===========================================
Coverage 80.5380% 80.5380%
===========================================
Files 504 504
Lines 135238 135238
===========================================
Hits 108918 108918
Misses 17820 17820
Partials 8500 8500 |
executor/show_test.go
Outdated
c.Assert(err, IsNil) | ||
c.Assert(se2.Auth(&auth.UserIdentity{Username: "show_grants", Hostname: "127.0.0.1", AuthUsername: "show_grants", AuthHostname: "%"}, nil, nil), IsTrue) | ||
tk2.Se = se2 | ||
err = tk2.QueryToErr("show grants") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use MustQuery
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
LGTM |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
/run-all-tests |
@imtbkcat merge failed. |
/merge |
/run-all-tests |
@imtbkcat merge failed. |
/merge |
Your auto merge job has been accepted, waiting for 15837 |
/run-all-tests |
@imtbkcat merge failed. |
/run-unit-test |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
Signed-off-by: sre-bot <sre-bot@pingcap.com>
It seems that, not for sure, we failed to cherry-pick this commit to release-3.0 release-3.1. Please comment '/run-cherry-picker' to try to trigger the cherry-picker if we did fail to cherry-pick this commit before. @imtbkcat PTAL. |
/run-cherry-picker |
cherry pick to release-3.0 failed |
What problem does this PR solve?
#15524 didn't fix this case:
Authhostname of u1 is
%
, hostname ofu1
is127.0.0.1
.ShowGrants
checks hostname in executor which cause show grants fail.What is changed and how it works?
if user in
ShowGrants
isnil
, copy session variable user to executor.Related changes
Check List
Tests
Side effects
Release note