Repository navigation
Support dirfd relative path lookups - #1928
Draft
Weiteng Chen (CvvT) wants to merge 6 commits into
Draft
Weiteng Chen (CvvT) wants to merge 6 commits into
Weiteng Chen (CvvT) wants to merge 6 commits into
Conversation
Keep relative lookups attached to the original directory across renames and replacements. Preserve the cwd handle across process startup and recover its current name for getcwd. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Name directories that a backend cannot name (9P) by the name they were opened by, so getcwd, relative mount(2) and AF_UNIX names keep working. Report unlinked directories through a new HandlePath flag so /proc/self/fd links read "<path> (deleted)" as on Linux. Route anchored walks through a directory's current location so mounts added after it was opened are crossed correctly, name files opened relative to a directory under its current name, and update directory timestamps through the open handle. Pin a single cwd handle in the shim so relative /proc/self/fd paths and AT_EMPTY_PATH behave the same before and after chdir. Map removed-directory listings to ENOENT in LocalFs and 9P, map the new path error to ENOENT in the macOS shim, and make macOS directory naming fail closed, dropping its rustix dependency. Remove the now-unused ResolvePath chain and non-anchored wrappers, make Backend::check_search required, cache the 9P root qid, skip a redundant search check on a leading ".", and share the Windows reparse-point open check. Add Rust and C tests for the fixed behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Give each file operation a single entry point that takes an optional directory, removing the parallel `*_at` variants from LiteBox, BrokerControl, BrokerLocal, and the broker-core service. Remove the working directory from litebox::fs::Context, which now only carries the acting user. A relative path requires a directory handle; the Linux shim always passes its cwd handle, opening it at startup and handing it to children, and the macOS shim roots its paths explicitly. Lexical normalization moves to ResolvedPath::new. Drop the unlinked-directory flag from HandlePath responses, leaving /proc/self/fd links of removed directories as a documented gap. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Take the namespace guard in LocalFs::dir_path like its siblings. - Share the search-permission probe via Location::check_search. - Skip procfs readlinks when validating the LocalFs root itself. - Avoid cloning the recorded route in Composer::current_route callers. - Let do_path_stat/do_readlink take a dir, removing duplicated tails. - Fix docs on relative-path/dir contracts, File::path, FsState::cwd; document OverlayDir; tighten visibility; clarify helper names. - Cover search-permission rules for held directories in dirfd_rename.c. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🤖 SemverChecks 🤖 Click for details |
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.
Linux *at() calls and relative paths should keep resolving from the same directory after it or one of its ancestors is renamed. This PR replaces path-based lookup with open directory handles, so lookups follow the directory rather than its old name.
getcwd()reports the new path after a rename and returnsENOENTafter the working directory is removed.