-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ExFAT parsing with clusters larger than one sector
The existing `exfat.bin` testcase is configured with a sector size equal to the cluster size. When that is not the case, parsing the root directory and subdirectory entries fails with an EOFError. Since directory entries are sector-aligned, reduce the block size to match. Fix some mistakes and clarify the documentation while at it. Fixes a crash reproduced with with exfatprogs version 1.2.6: truncate -s 4M exfat4m.bin; mkfs.exfat exfat4m.bin python3 -c 'from dissect.fat import ExFAT; fs = ExFAT(open("exfat4m.bin", "rb")); print(fs.files["/"][1].keys())' This check for a file and subdirectory also passes now: # mount exfat4m.bin /mnt # mkdir /mnt/subdir # touch /mnt/file.txt /mnt/subdir/sub.txt # umount /mnt $ python3 -c 'from dissect.fat import ExFAT; fs = ExFAT(open("exfat4m.bin", "rb")); print(fs.files["/"][1]["subdir"][1].keys())' odict_keys(['sub.txt']) $ python3 -c 'from dissect.fat import ExFAT; fs = ExFAT(open("exfat4m.bin", "rb")); print(fs.files["/"][1].keys())' odict_keys(['subdir', 'file.txt']) This test file has been included in the test suite.
- Loading branch information
1 parent
fe9d7dc
commit 37d89e7
Showing
5 changed files
with
60 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Git LFS file not shown
This file contains 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