Skip to content

fix(artifacts): align native DMG mount and detach lifecycle - #679

Closed
rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-dmg-native-lifecycle-20261006
Closed

rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-dmg-native-lifecycle-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown

Summary

Make real native DMG attach/read/detach work with the metadata returned by hdiutil:

  • Canonicalize the owned temporary mount root before requesting attachment. On macOS, /var/... and /private/var/... can name the same directory; hdiutil returns its canonical spelling. The old lexical prefix check rejects a legitimate owned mount.
  • Detach an observed whole disk once, rather than subsequently trying each of its now-unavailable partitions. Parent authority is taken only from devices actually returned by hdiutil; child-only metadata is preserved.

Both failures occurred in one public NativeDmgArtifactReader run against an owned hdiutil-created UDZO image. The baseline rejected the legitimate mount and then reported cleanup failures. Afterward the same image attaches, enumerates and closes successfully; hdiutil info -plist reports no attached images left.

Verification

  • Native host commands: hdiutil create, hdiutil convert -format UDZO, then public reader create → entries → close, using the actual system host. Before fails; after passes with a single observed whole-disk detach.
  • npm run test:focused -- tests/boundary/providers/native/nativeDmgArtifactReader.test.ts — 3 tests passed, including canonical-root and multiple whole disks/partitions.
  • npm run check — all five tasks passed.
  • Existing nonzero/child-only failure paths remain tested. This does not claim arbitrary APFS snapshot/nested partition support or unrelated image cleanup.
  • No Hopper or Ghidra verification was performed; no such provider is changed. No public contract/generated metadata changes.

AI assistance was used for implementation and verification. The source and actual native proof were independently reviewed before publication. No user-owned image was used.

@morluto morluto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve: realpath-canonicalized mount root fixes /private/var vs /var containment, and whole-disk dedup detaches each observed disk once in LIFO order. Test covers 2 disks + partitions + exact detach calls; existing failure paths retained. Checks green.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Superseded by #705, which cherry-picks this change (plus 13 sibling fixes) onto current main with conflict resolution and regenerated catalogs. Closing to keep one reviewable merge unit.

@morluto morluto closed this Oct 6, 2026
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(artifacts): align native DMG mount and detach lifecycle.” I appreciate your contribution to REA.

@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the area: evidence Evidence, artifacts, and reconstruction label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants