Repository navigation
feat(fs): open a host file by path, following links, decided on the handle - #110
Merged
Merged
Conversation
christianparpart
force-pushed
the
feature/open-host-file
branch
from
November 30, 2026 05:51
a64d4c9 to
eaad7ae
Compare
Member
Author
|
Local gates on eaad7ae: clang-debug 95/95, gcc-release 95/95, clang-tidy preset clean (two findings in the new code, fixed), clang-format --all --check clean, mkdocs --strict clean. |
christianparpart
force-pushed
the
feature/open-host-file
branch
from
November 30, 2026 06:43
eaad7ae to
674d0c3
Compare
…andle IDescriptorFileSystem::openHostFile(path, open) opens a file a tool's user named, the way any tool does: the system resolves the path and follows every link on it, absolute targets included, and needs only search access on the way, so a file under a 0711 home opens. The open never waits: POSIX opens O_NONBLOCK and clears the flag for a regular file only (a leased file is opened again through the path handle, which now follows a final link unless the open says O_NOFOLLOW); Windows opens with CreateFileW sharing read, write and delete. Nothing else is decided: a directory or a FIFO opens too, and the caller refuses it on the handle. Only None and Directory are accepted (checkHostOpenFlags). The in-memory model resolves the path from its root. Closes #109. Signed-off-by: Christian Parpart <christian@parpart.family>
christianparpart
force-pushed
the
feature/open-host-file
branch
from
November 30, 2026 06:44
674d0c3 to
85309dc
Compare
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.
Closes #109.
IDescriptorFileSystem::openHostFile(std::filesystem::path, OpenFlags)opens a file a tool's user named on the command line, the way any tool does. It is the one entry point that takes an ambient path; the capability-scoped API stays as it is.alternativeslinks open.O_NONBLOCKand clears it for a regular file only. A leased file is opened again throughopenAfterWouldBlock, whose path handle now follows a final link unless the flags sayO_NOFOLLOW; openAt always says it, so openAt is unchanged. Windows opens withCreateFileWand READ|WRITE|DELETE sharing, a path open now shared withopenPreopen.openisNoneorDirectory; every other flag isInvalid, checked by the newcheckHostOpenFlags()...at the root stays there.HostFile_test.cppruns on both fixture kinds. POSIX adds a FIFO through a link and a file under a search-only parent; the lease test adds the followed link.Consumer impact
Breaking: a new pure virtual on
IDescriptorFileSystem. Anything implementing the interface must override it, and a decorator forwards it.I grepped Contour, endo and fastcached for implementers of
IDescriptorFileSystem, in the local checkouts and withgh search codeon each repository. None implements it outside the vendored copy. Isoline's test decorator is the only one, and Isoline overrides it when it re-vendors.Gates (local)
clang-debugbuild: clean; ctest 95/95 (the hygiene check needed a provenance row for the new test file).gcc-releaseandclang-tidy: see the comment below.scripts/clang-format.py --all --check: clean.mkdocs build --strict: clean.cl /W4 /Zsunder wine onWindowsDescriptor.cppis clean; CI runs the rest.