Repository navigation
Backport #111483 to 26.3: Restrict local object access only for user files path - #114443
Merged
Merged
Conversation
Contributor
|
Workflow [BackportPR], commit [58d32ad] Summary: ✅ |
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]>
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 #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
26.3.33.55