Skip to content

# ambiguous ReFS writable namespace paths are refused - #421

Merged
Hawkynt merged 2 commits into
mainfrom
fix/refs-ambiguous-namespace-lookup
Sep 30, 2026
Merged

Hawkynt merged 2 commits into
mainfrom
fix/refs-ambiguous-namespace-lookup

Conversation

@Hawkynt

@Hawkynt Hawkynt commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • Refuse a case-insensitive writable path when multiple directory rows match, including intermediate parent components.
  • Apply the unique lookup to offline replacement, removal and whole-file block clone so they cannot pick the first case-folded file silently.
  • Add a synthetic case-collision regression that checks the source image stays byte-identical after refused mutations.

Validation

  • git diff --check passed.
  • Local .NET SDK is unavailable in this environment; Windows and Ubuntu CI are the build and test gates.

This is an offline mutation safety fix. It does not enable native mounted ReFS writes or claim support for case-sensitive write semantics.

Review update

  • Rebased onto main.
  • The offline-mutation test asserted only NotSupportedException. Add also throws that for a path it will not create, so the test passed even with the ambiguity check removed. It now asserts the ambiguity message. It also covers an ambiguous clone destination, and a unique case-folded path that must still resolve.
  • Local: Compression.Tests.Refs 59 passed, 1 skipped.
  • Overlap: + offline same-directory ReFS file rename #420 (rename) touches RefsOfflineModifier.cs too, but in a different region. Either merge order works. The second PR to merge should be rebased and its CI rerun.

@Hawkynt
Hawkynt force-pushed the fix/refs-ambiguous-namespace-lookup branch from 7079c54 to 0b576de Compare September 30, 2026 11:53
@Hawkynt Hawkynt changed the title Reject ambiguous ReFS writable namespace paths # ambiguous ReFS writable namespace paths are refused Sep 30, 2026
@Hawkynt
Hawkynt force-pushed the fix/refs-ambiguous-namespace-lookup branch 2 times, most recently from f135048 to 62ef4a9 Compare September 30, 2026 16:09
Case-insensitive writable lookups selected the first matching row even when a directory contained names distinguished only by case. This could direct replacement, deletion or block clone at an unintended file. Require unique resolution both in the namespace walker and at the mutation entry points, and verify ambiguous synthetic images remain unchanged. The evidence is the existing ReFS row model and synthetic case-collision fixture; no external on-disk grammar is inferred.
Symptom: the offline-mutation test asserted only NotSupportedException, which
Add also throws for a path it will not create, so the test passed even with
the ambiguity check removed.

Fix: assert the ambiguity message for every refused mutation, cover an
ambiguous clone destination as well as an ambiguous source, and add the
equivalence class of a unique case-folded path that must still resolve.
@Hawkynt
Hawkynt force-pushed the fix/refs-ambiguous-namespace-lookup branch from aeec038 to 22169a0 Compare September 30, 2026 18:06
@Hawkynt
Hawkynt merged commit 809448a into main Sep 30, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant