Skip to content

Fix GRANT CURRENT GRANTS ... WITH REPLACE OPTION skipping the grant option check - #130873

Merged
pufit merged 1 commit into
ClickHouse:masterfrom
pufit:pufit/fix-current-grants-replace-grant-option
Nov 12, 2026
Merged

pufit merged 1 commit into
ClickHouse:masterfrom
pufit:pufit/fix-current-grants-replace-grant-option

Conversation

@pufit

@pufit pufit commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

GRANT CURRENT GRANTS ... WITH REPLACE OPTION revokes the grantee's existing privileges before granting, but the grant option check was skipped for that revoke.

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

GRANT CURRENT GRANTS ... WITH REPLACE OPTION now checks that the current user has the grant option for the privileges it revokes from the grantee, the same as a regular GRANT ... WITH REPLACE OPTION.


Workflow [PR]
Sync PR [sync-upstream/pr/130873]

Version info

  • Merged into: 26.11.1.2146-master (included in 26.11 and later)

@clickhouse-gh

clickhouse-gh Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4271100]

Summary: ✅


AI Review

Summary

PR #130873, reviewed at 4271100a45f88d4e160759d81ca3042a6c7ad74a, makes GRANT CURRENT GRANTS ... WITH REPLACE OPTION check grant authority for its implicit revocations. No actionable findings. The new stateless regression and existing CURRENT GRANTS stateless test both passed in the PR's Fast test job; tests were not run locally.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! labels Nov 11, 2026
@pufit
pufit marked this pull request as ready for review November 11, 2026 16:27
@clickhouse-gh

clickhouse-gh Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 4271100a4 with master 11522cf73 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Slowest function optimization changes (ThinLTO)

Median per-function time ratio to the master baseline: programs/clickhouse ×0.66, programs/clickhouse-keeper ×0.72 (each binary is linked separately, on a different machine and with different build flags); deltas below are relative to it.

Binary Function Master PR Δ vs median
programs/clickhouse DB::registerFunctionConversion(DB::FunctionFactory&) 5.7 s 14.1 s +10.3 s (+270%)
Compile time of recompiled translation units

7 translation units recompiled, 9 s compile time in total, 7 of them have a recent master baseline.

Job report

@clickhouse-gh clickhouse-gh Bot added the comp-rbac Authorization: roles, grants, quotas, row-level security, access checks. label Nov 11, 2026
@GrigoryPervakov GrigoryPervakov self-assigned this Nov 12, 2026
@pufit
pufit added this pull request to the merge queue Nov 12, 2026
Merged via the queue into ClickHouse:master with commit 7f7d60b Nov 12, 2026
203 checks passed
@pufit
pufit deleted the pufit/fix-current-grants-replace-grant-option branch November 12, 2026 23:29
@robot-ch-test-poll3 robot-ch-test-poll3 added pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-synced-to-cloud The PR is synced to the cloud repo labels Nov 12, 2026
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 12, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 13, 2026
Backport #130873 to 26.9: Fix `GRANT CURRENT GRANTS ... WITH REPLACE OPTION` skipping the grant option check
PedroTadim added a commit that referenced this pull request Nov 13, 2026
Backport #130873 to 26.3: Fix `GRANT CURRENT GRANTS ... WITH REPLACE OPTION` skipping the grant option check
leshikus pushed a commit that referenced this pull request Nov 13, 2026
…OPTION` skipping the grant option check

(cherry picked from commit 5e9f5ef)
leshikus pushed a commit that referenced this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-rbac Authorization: roles, grants, quotas, row-level security, access checks. pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants