Repository navigation
Keep case-variant evidence files when the report volume folds case - #2027
Conversation
Seeker dest-guard only (volume probe + ~caseN). Not an artifact. Closes abrignoni#1948. Signed-off-by: Forest Savage <[email protected]>
|
Thank you for the time on this review. This only keeps case-variant evidence files when the report volume folds case. |
…embers Replaces the counter suffix with name~case-<tag>.ext, where the tag is the sha256 of the evidence-relative source path (case preserved, separators normalized). The same source now maps to the same destination on every search, every run and every machine, so repeated or forced searches cannot mint additional copies. Directory members take no dest-guard: case-variant directories fold into one and their files disambiguate individually, which also stops a spurious tagged twin when an archive stores a directory entry after its contents. The seekers hash the evidence-relative spelling (dir seeker: path relative to the input root; iTunes seeker: the manifest-relative path) rather than the mounted absolute path. Adds a regression suite covering both volume behaviours, name determinism across instances and forced re-searches, directory members, and a simulated Windows normcase. Co-Authored-By: Claude Fable 5 <[email protected]>
The seeker now preserves case-variant copies under distinct destination names, so the per-spelling re-search pass is no longer needed and would miss tagged copies, since a tagged destination basename is not an archive member name. Reads each found file once, labels rows with the source spelling recorded by the seeker, and points each row's path at the copy holding the bytes it reports. Row counts re-verified against the corpora recorded in sample_data, including all six images carrying both spellings. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Thanks for this one. The direction was right, so rather than a recut round trip I pushed two commits on top of your branch. What testing it turned up:
The fixes: the alternate name is now derived from a hash of the evidence-relative source path (name~case-.ext), so the same source maps to the same destination on every search, every run and every machine, with no counter state to get wrong. Directory members skip the guard. messageRetention reads every preserved copy directly and labels each row with the source spelling the seeker recorded, which is simpler than the read-before-the-next-copy dance it needed before. Validation: messageRetention run through the real ileapp.py on all six registered iOS images that carry both spellings (zip and tar inputs) plus a single-spelling control, main vs fixed, report folder on a case-insensitive volume. Row counts and values identical to main everywhere, both files preserved with distinct hashes on every pair image, and the control run byte-identical. The new suite in admin/test/scripts fails against the old seeker and covers both volume behaviours, name determinism across instances and forced re-searches, directory members, and a simulated Windows normcase. A full-suite before/after run comparison is going now ahead of the merge. The same fixes are needed on the ALEAPP, VLEAPP and RLEAPP PRs; I will level them there. |
Keep case-variant evidence files when the report volume folds case
Same dest-guard as the sibling LEAPP seekers. Seeker only. Not an artifact. Please land this with the other three so the seekers stay level.
Closes #1948.
Summary
self.copiedis keyed by the source path. The report destination is built from that path. On a case-insensitive report volume,com.apple.MobileSMS.plistandcom.apple.mobileSMS.plistare two sources and one destination. The second write silently destroys the first.This PR does only the seeker dest-guard named on the issue:
Aa/aA; do not trustos.path.normcase).name~caseN.extinstead of overwriting.file_infosand the artifact's source path stay truthful.Validation
Earlier local check on a case-sensitive ext4 volume (dest names folded to stand in for Windows / stock macOS): two sources plus one folded dest left one file. The dest-guard kept both; the second dest is
*~case2.plist. The volume probe left no leftover probe names. This is not an artifact change, so the artifact report checkers were not run.Files
scripts/search_files.py(seeker dest-guard only)Touched write sites: FileSeekerDir, FileSeekerItunes, FileSeekerTar, FileSeekerZip, FileSeekerFile.
Out of scope
os.path.normcasematching of search patternsHow to review
On a case-insensitive report volume, search a zip that holds both
com.apple.MobileSMS.plistandcom.apple.mobileSMS.plist.data/should keep two files (the second named*~case2.plist). Case-sensitive volumes should be unchanged: the probe sees two files and never mints~caseN.I am a volunteer. Thank you for the time. I am trying to become more useful on this work, so I welcome a critical look. If this is the wrong cut, or you want me to stand down, say so and I will recut from notes.