fix: handle empty catalogs where data directory does not exist#70
Merged
fix: handle empty catalogs where data directory does not exist#70
Conversation
Replace canonicalize() with std::path::absolute() in parse_local_path() so that the data directory is not required to exist at catalog creation time. This supports new DuckLake catalogs that have schemas/tables defined but no data files written yet. Closes #57 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2e487c1 to
45a0e9a
Compare
Add a standalone '..' path component check in parse_local_path() to prevent directory traversal attacks. std::path::absolute() does not normalize '..' components, so without this check a malicious data_path like "/data/../../../etc/" would pass through unchanged. Closes #57
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.
Summary
canonicalize()withstd::path::absolute()inparse_local_path()so the data directory does not need to exist at catalog creation timeDetails
canonicalize()requires the path to exist on disk and resolves symlinks. For empty catalogs, the.files/data directory hasn't been created yet, causing catalog initialization to fail.std::path::absolute()(stable since Rust 1.79) converts relative paths to absolute without requiring existence.Test plan
cargo buildsucceeds🤖 Generated with Claude Code