Repository navigation
fix(windows): preserve Unicode permission checks and encoded appends - #303
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 12:20 AM ET / 04:20 UTC. ClawSweeper reviewWhat this changesThe PR replaces Windows fallback ACL display-text parsing with structured security facts and makes Root append recognize complete encoded newlines. Merge readiness✅ Ready for maintainer review Keep open: both fixes remain necessary on pinned main. The introduced changes are coherent, supported by reported Windows before/after verification, and have no identified blocking defect. Priority: P2 Review scores
Verification
How this fits togetherfs-safe checks filesystem ownership and permissions before returning sensitive file contents to Node.js callers. Its Root API also performs guarded file mutations, including appending text with an optional newline separator. flowchart TD
A[Windows path] --> B[Structured owner and ACL query]
B --> C[Ownership and permission checks]
C --> D[Return contents or reject read]
E[Text and encoding] --> F[Guarded append and newline check]
F --> G[Updated file]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Use structured Windows security facts for fallback inspection and compare encoded newline bytes within the existing guarded append path. Do we have a high-confidence way to reproduce the issue? Yes: pinned main's one-byte check explains both UTF-16LE failures, and the supplied Windows before/after account identifies the Unicode fallback failure through real public APIs; no reproduction was executed during this review. Is this the best way to solve the issue? Yes: extending the existing owner query removes the lossy display-text boundary, and the append change narrowly corrects encoding handling while preserving mutation guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against da0b2c43fd19. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes an issue where consumers inspecting permissions or securely reading ordinary Unicode Windows paths would receive an unverified-permissions error when the native binding was disabled.
icaclscan replace pathname and account-name characters before Node receives its output.Also fixes Root append inserting a duplicate newline into UTF-16LE text that already ends in a newline, or missing a separator after a different character whose final byte happens to be
0a.Why This Change Was Made
The existing Windows .NET owner query now returns SID and numeric DACL facts in the same response. Coarse inspection and the advanced ACL inspector share those facts, eliminating display-name translation and extra subprocesses. The captured-output parser and remediation builders remain public; explicit advanced classification and translation-failure options retain their behavior. Malformed or unsupported descriptors remain unverified, and error diagnostics retain their original cause and process deadline.
Root append compares the complete encoded newline before writing. Buffer append behavior and the existing mutation/disposal checks remain unchanged.
User Impact
Unicode filenames and directory names work in Windows fallback permission inspection and secure reads. UTF-16LE newline insertion works on Windows and other platforms. No package version, dependency, default, or public signature changes.
Evidence
finally. ASCII and Unicode public inspection both pass in native and fallback modes.pnpm check: lint, build, and documentation checks passed; tests reported 7,638 passed, 68 failed, 1,232 skipped, and one unhandled symlink EPERM. Every failure also exists in the baseline: 62 direct symlink EPERM failures, two secondary failures from the same host restriction, three test-harness mock failures, and one unchanged intermediate-directory expectation. No new failure names, skips, or weakened assertions. Hosted CI provides the clean Windows runner gate.pnpm pack:check(tarball contents, imports, declarations, and public API checks).Root.create, and the existing CI writer entry point. All 1,280 attempts produced exactly one intact winner and 31 expected collisions per round. The preexisting main-branch CI failure did not reproduce locally or in this PR's native CI lane.Captured candidate ReFS/native stdout:
{"name":"atomic","status":"passed","ms":44,"writes":24,"reads":48} {"name":"append","status":"passed","ms":55,"records":96} {"name":"store","status":"passed","ms":551,"updates":24,"streamWrites":48} {"name":"locks","status":"passed","ms":369,"holders":24} {"name":"walk","status":"passed","ms":84,"entries":100} {"name":"archive","status":"passed","ms":254,"extracts":4} {"name":"temp","status":"passed","ms":97,"workspaces":24} {"mode":"require","smoke":false,"passed":7,"failed":0}CHANGELOG.mdupdated when release-relevant