Repository navigation
Make ASC MHL publication fail closed on FAT volumes - #54
Merged
Merged
Conversation
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.
What changed
On exFAT,
renameatx_np(RENAME_EXCL)returnsENOTSUP(errno 45). The old ASC MHL fallback claimed an emptyascmhldirectory, then used a plain directory rename that could replace a different writer's empty directory if the claim changed between the check and rename. A deterministic test reproduced that replacement before this patch.FAT-family volumes now claim
ascmhlonce, write through the pinned directory, and keep a durableBITMATCH_HISTORY_STATUS.txtrecord. Its completion line binds the exact initial manifest and chain bytes. BitMatch Check refuses incomplete, altered, or missing-status FAT histories before considering an adjacent report; a partial history cannot look complete after relaunch. Existing histories are never overwritten or deleted. The exclusive-rename path remains for other filesystems, with a final pinned-stage and byte check before reporting success.The direct FAT manifest uses a distinct filename so removal of the status file cannot make a partial new history look like a legacy one. Exact AppleDouble companions created by macOS on exFAT are accepted only after bounded metadata validation. Malformed status filenames cannot traverse outside the history directory.
Local validation
git diff --checkclean.ascmitc/mhlat0fb61f1e) accepted the completed real-exFAT sample: schema, C4, media verify and diff passed. It also appended a second generation on a disposable copy.Limits
BitMatch Check deliberately rejects a chain later extended by another tool, because this status record binds the original chain bytes. The official ASC CLI can read and extend the history; read-only validation of extended chain lineage remains separate work. FAT32, physical drives, and sudden power loss are not validated here. This fixes a confirmed publication race; it does not establish the cause of issue #10 or justify a release claim on its own.