Skip to content

Backport #111483 to 26.3: Restrict local object access only for user files path - #114443

Merged
PedroTadim merged 5 commits into
26.3from
backport/26.3/111483
Sep 11, 2026
Merged

PedroTadim merged 5 commits into
26.3from
backport/26.3/111483

Conversation

@robot-clickhouse-ci-1

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #111483
Cherry-pick pull-request #112254

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.33.55

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Aug 12, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [58d32ad]

Summary: ✅

PedroTadim and others added 3 commits September 10, 2026 10:52
Every build fails with:

    src/Disks/DiskObjectStorage/MetadataStorages/Plain/MetadataStorageFromPlainObjectStorage.cpp:220:37:
        error: no member named 'CANNOT_RMDIR' in namespace 'DB::ErrorCodes'

The cherry-pick replaced this branch's `removeDirectory` / `removeRecursive`
with master's versions, but the matching `extern const int CANNOT_RMDIR;` sits
in the file's `namespace ErrorCodes` block, outside any hunk it touched, so it
was left behind.

Adding that one declaration would make it compile, but it would be the wrong
fix. Master's `removeDirectory` throws on a non-empty directory and deletes
nothing; `26.3`'s deletes the directory's contents and records them in
`objects_to_remove`. That difference is master-only code that predates #111483
(it is already present at 17f9afe^1, the master commit just before #111483
merged) and `26.3` never had it. Keeping it would quietly change disk-cleanup
behaviour on a release branch.

#111483's own delta to this file is only the `CANNOT_RMDIR` message wording and
the `removeRecursive` rewrite, and both presuppose master's semantics: the
wording change applies to a line `26.3` does not have, and the recursive
`removeRecursive` is only correct once `removeDirectory` has stopped deleting.
They are a pair, and neither belongs here on its own.

So revert the file to `26.3`'s version. The actual fix - restricting local
object access to the user files path - is untouched: it lives in
`LocalObjectStorage.{h,cpp}`, `Storages/ObjectStorage/Local/Configuration.{h,cpp}`
and `DataLakeConfiguration.h`, none of which reference either function.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The auto-backport left two definitions of LocalObjectStorage::readObject:
the 26.3 three-argument one (unchanged, still reading the raw path) and
master's five-argument one, which needs ReadSettings::remote_fs_settings
and ReadBufferFromFileWithLogging - neither exists on 26.3. Drop the
master copy and apply the path resolution from #111483 to the 26.3 one.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@PedroTadim
PedroTadim merged commit 2702de4 into 26.3 Sep 11, 2026
34 checks passed
@PedroTadim
PedroTadim deleted the backport/26.3/111483 branch September 11, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants