Repository navigation
Correct access rights check for RESTORE - #71958
Conversation
|
This is an automated comment for commit 53e9355 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
RESTORE
| instance.query("REVOKE SELECT ON foo.* FROM u2") | ||
|
|
||
| instance.query(f"RESTORE ALL FROM {backup_name}", user="u2") | ||
| instance.query("DROP USER u1") |
There was a problem hiding this comment.
What is the point of dropping user u1 here?
There was a problem hiding this comment.
To run the restore sequence, two lines below
|
|
||
| instance.query(f"RESTORE ALL FROM {backup_name}", user="u2") | ||
| instance.query("DROP USER u1") | ||
| instance.query("REVOKE SELECT ON foo* FROM u2") |
There was a problem hiding this comment.
foo.* was already revoked from u2 before instance.query(f"RESTORE ALL FROM {backup_name}", user="u2"), what's the point of repeating the same command here?
There was a problem hiding this comment.
It's a different permission. I made it more apparent now
| if (access_rights->contains(required_access_rights)) | ||
| return; | ||
|
|
||
| context->checkAccess(required_access); |
There was a problem hiding this comment.
Do we need this context->checkAccess(required_access) here only to generate an error message?
| if (access_rights->contains(required_access_rights)) | ||
| return; | ||
|
|
||
| context->checkAccess(required_access); |
There was a problem hiding this comment.
Maybe we could make contains() a part of checkAccess(), WDYT?
There was a problem hiding this comment.
I tried implementing this, but the code change has grown beyond the current PR. I will continue the refactoring in the separate PR, but this required a complete rewriting of checkAccessImplHelper and some other functions from checking access per flag to check access per access_rights set
…k-restore' into pufit/correct-access-rights-check-restore
Backport #71958 to 24.10: Correct access rights check for `RESTORE`
Backport #71958 to 24.12: Correct access rights check for `RESTORE`
Backport #71958 to 24.11: Correct access rights check for `RESTORE`
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
RESTOREoperations for access entities required more permission than necessary because of unhandled partial revokes. This PR fixes the issue.Closes #71853
CI Settings (Only check the boxes if you know what you are doing):