Repository navigation
Cherry pick #117960 to 26.8: Require the DROP privilege for CREATE ... OR REPLACE of an access entity - #118285
Merged
Conversation
`CREATE USER OR REPLACE`, `CREATE ROLE OR REPLACE`, `CREATE QUOTA OR REPLACE`, `CREATE SETTINGS PROFILE OR REPLACE` and `CREATE ROW POLICY OR REPLACE` overwrite an existing entity of the same name, but they only required the corresponding `CREATE` privilege. A user holding just `CREATE USER` could therefore replace any other user - including a privileged one - resetting its authentication methods, its granted roles and its settings, and then log in as that user. `CREATE ... OR REPLACE` is a drop followed by a create, so it now requires the privileges of both, the same way `REPLACE TABLE`, `CREATE OR REPLACE VIEW`, `CREATE OR REPLACE FUNCTION`, `CREATE OR REPLACE WORKLOAD` and `CREATE OR REPLACE RESOURCE` already do. The `DROP` privilege is required whether or not the entity currently exists, mirroring `REPLACE TABLE`, so the check cannot be used to find out which entities exist either. Closes: #90833 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…-replace-access-check
The Fast test build has no SSL library, so `IDENTIFIED WITH sha256_password` fails there with `SUPPORT_IS_DISABLED`. Use `plaintext_password` instead: the test only needs a password that the replaced user can no longer log in with, not a specific hashing scheme. Also renumber the test from 05060 to 05078, because master already has ten other tests with the 05060 prefix. Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117960&sha=8d554168ea280f118ccf995446e7350d591ee79c&name_0=PR&name_1=Fast%20test PR: #117960 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…-replace-access-check
…e-access-check Require the DROP privilege for CREATE ... OR REPLACE of an access entity
Resolve doc-only conflicts in the five `src/Parsers/Access/ParserCreate*Query.cpp` files by taking the release-branch side: 26.8 has no inline `StatementFactory` docs, so the master doc paragraph about `OR REPLACE` requiring `DROP` is not applicable there. The interpreter changes and test 05078 apply unchanged. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #117960
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job