Repository navigation
fix(audit): treat NTFS junctions in .github and docs like directory symlinks - #111
Merged
Merged
Conversation
…ymlinks repo_audit.py checked only Path.is_symlink(), which is False for an NTFS junction. A junction named docs or .github was therefore listed and its documents were read from wherever it pointed, contrary to the documented "directory symlinks are not traversed" guarantee. Both the inventory and the document reader now use lstat and the junction reparse tag, so a junction is reported as path.symlink and never read through. The link-checker half of #108 landed with #110. Closes #108 Co-Authored-By: Claude Opus 5.5 <[email protected]>
drevendev
force-pushed
the
beautifulrepo/audit-junctions-20261023
branch
from
October 23, 2026 07:36
a183c14 to
7029649
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.
Reader problem and change
guides/repository-audit.mdpromises that directory symlinks in.githubordocsare not traversed. On Windows, an NTFS junction got past that guard.Path.is_symlink()isFalsefor a junction, sorepo_audit.pylisted adocsjunction and read the README it pointed to, wherever that was._is_redirectuseslstatand the junction reparse tag. The inventory treats a junction like a directory symlink:path.symlinkwarning, not followed. The document reader rejects it as non-regular.The link-checker half of #108 (junction loops and junction targets) landed with #110.
Closes #108
Evidence
The new Windows-only test
test_directory_junction_is_not_followedpoints adocsjunction at a directory containingPRIVATE:'path.symlink' not found in []);PRIVATEstays out of the report, anddocs/README.mdstays out ofread_files.Verification
Limitations
🤖 Generated with Claude Code