Optimize TRX reparse point confinement checks - #10648
Optimize TRX reparse point confinement checks#10648Amaury Levé (Evangelink) wants to merge 3 commits into
Conversation
Use a single fail-closed attribute probe for each confinement component and cover missing, inaccessible, regular-file, and dangling-link behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Optimizes TRX attachment confinement checks while preserving fail-closed security behavior.
Changes:
- Reduces filesystem metadata probes to one per path component.
- Handles missing and inaccessible entries distinctly.
- Adds focused tests for status and dangling-link behavior.
Show a summary per file
| File | Description |
|---|---|
TrxReportEngine.Merge.PathHelpers.cs |
Adds single-probe reparse-point detection. |
TrxReportEngine.Merge.Attachments.cs |
Safely handles inaccessible merged roots. |
InternalAPI.Unshipped.txt |
Records the new internal helper. |
TrxReportEngineMergeTests.cs |
Tests detection and exception semantics. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Use the repository's reflection test pattern instead of expanding the tracked internal API solely for unit tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Inject attribute failures through private overloads and verify unreadable ancestors and merged roots are rejected without deleting or writing through them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🧵 Parallel-safety audit — PR #10648Parallelization — assembly audited:
Findings: A (global-state) This PR only touches production code in Reviewed every added test method for the category A–D taxonomy:
Nothing in this PR is parallel-unsafe. No action needed. Advisory only — heuristic, non-blocking. Re-run with
|
🧪 Expert test review — PR #10648
All eight new tests target the This advisory comment was generated automatically. Grades are heuristic
|
Summary
Directory.ExistsplusFile.GetAttributespair with one attribute read per componentSecurity and efficiency
Existing path components now require one filesystem metadata probe instead of two. Missing components still require one probe. This narrows, but does not eliminate, the existing TOCTOU window; the merge path continues to revalidate destination ancestors and copy without overwrite.
Only
FileNotFoundExceptionandDirectoryNotFoundExceptionmean an entry is absent.IOException,UnauthorizedAccessException, andSecurityExceptionfail closed. An unreadable mergedInroot is never deleted.Validation
merge-trxacceptance tests: 3 passedCloses #10643