feat(sigsafe): resolve current directory - #613
Merged
Merged
Conversation
fspy benchmarklinuxmacoswindows |
wan9chi
force-pushed
the
agent/sigsafe-getcwd
branch
5 times, most recently
from
August 9, 2026 12:18
5ea57b6 to
a42f21e
Compare
wan9chi
changed the base branch from
agent/extract-sigsafe-alloc
to
agent/sigsafe-cstr-fd
August 9, 2026 12:19
wan9chi
force-pushed
the
agent/sigsafe-getcwd
branch
13 times, most recently
from
August 9, 2026 15:46
18e37f5 to
f4f0a82
Compare
Co-authored-by: GPT-5 Codex <codex@openai.com>
wan9chi
force-pushed
the
agent/sigsafe-getcwd
branch
from
August 9, 2026 16:26
f4f0a82 to
689129f
Compare
wan9chi
marked this pull request as ready for review
August 9, 2026 16:40
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.
Motivation
Preload path resolution still obtains the current directory through
nix, which may allocate through libc in interception contexts. Add caller-buffersigsafe::fs::getcwdand its explicit-allocator adapter, then immediately use it inside the existingto_absolute_pathcallback contract.The macOS
openatandfcntl_getpathwrappers remain private because they are implementation details of the allocation-free libSystem fast path in this slice.That fast path stops short of libSystem's verification step. libSystem
stats the pathF_GETPATHreturned and compares it against the descriptor, falling back to walking up through..when they disagree. This wrapper has no slow path to fall back to, so the comparison could only turn a slightly stale answer into a hard error — and its caller records paths a process accessed rather than resolving them, where a stale name is a cosmetic inaccuracy but an error is a lost access. Skipping it also keeps the most common resolution to two syscalls.