Skip to content

Cherry pick #117960 to 26.3: Require the DROP privilege for CREATE ... OR REPLACE of an access entity - #118282

Merged
robot-ch-test-poll3 merged 6 commits into
backport/26.3/117960from
cherrypick/26.3/117960
Sep 5, 2026
Merged

robot-ch-test-poll3 merged 6 commits into
backport/26.3/117960from
cherrypick/26.3/117960

Conversation

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

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-pick locally.
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:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

alexey-milovidov and others added 5 commits September 3, 2026 21:01
`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]>
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]>
…e-access-check

Require the DROP privilege for CREATE ... OR REPLACE of an access entity
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-critical-bugfix labels Sep 5, 2026
Cherry-pick of #117960 to 26.3. The parser files conflicted only on the in-source
statement documentation (`registerStatement*`), which does not exist in 26.3, so the
doc hunks were dropped and the parsers kept identical to 26.3. The interpreter
changes and the test apply unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants