Repository navigation
Fix review findings in the TIBX parser - #1
Open
mniedermaier wants to merge 1 commit into
Open
mniedermaier wants to merge 1 commit into
mniedermaier wants to merge 1 commit into
Conversation
- recovery_points() reads the slices tree from its ctrees as well as its mem-tree, merged keep-first, so backups whose records were moved to disk are no longer missing - The layout of extents sharing a segment counts an extent once even when an incremental records it again under a later slice, and is built from every extent, so a volume opened before use_recovery_point() still reads from the right place - use_recovery_point() keeps the segment index and segment cache, which do not depend on the selected point; unlock() resets the cache's byte count - A missing zstd module raises UnsupportedFormatError, so volumes() works without the full extra - TibxVolume repr shows the span, which needs no read and so no password - An encrypted segment that decodes short raises CorruptArchiveError, as a plaintext one does - find_split_parts() handles stems with glob characters and upper-case extensions, and orders parts by number Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes for issues found while reviewing fox-it#30 (fox-it/dissect.archive). Each fix comes with a regression test that fails on the current
feature/tibx-parserand passes with this change.Changes
Correctness
recovery_points()missed backups stored in ctrees. It read the slices tree (TLV[5]) only from its mem-tree, whilehas_recordsalso counts ctree records. It now walksiter_tree_cellswith keep-first merging and honours tombstones.t1_chain_inc.tibx, so far only for whole-segment extents). For a multi-extent segment, the duplicate(segment_id, extent_index)shifted every later extent. Each index now counts once.use_recovery_point()read wrong data. The layout was rebuilt from the filtered extents, so a stale volume's extents fell back to base 0 through.get(..., 0). The layout is now built from the unfiltered table. A segment is written by one backup, so the layout does not depend on the selected point.TibxVolume.read. It now raisesCorruptArchiveError, like the plaintext path.find_split_parts(): stems with glob characters (Backup [PC1]) found no parts, and.TIBXwas not matched on case-sensitive filesystems. Directory entries are now matched withSPLIT_PART_RE, and parts are ordered by number.Robustness
fullextra below 3.14, or a Python 3.14 built without zstd) now raisesUnsupportedFormatErrorinstead ofModuleNotFoundError, sovolumes()keeps working, as thecodec.pydocstring intends.test_open_without_zstdis updated accordingly.TibxVolume.__repr__showsspaninstead ofsize, so it no longer reads the boot sector and needs no password on a locked archive.Performance
use_recovery_point()only resets the view caches (extents, streams, volumes). The segment index, the segment cache and the layout are kept.unlock()resets_segment_cache_bytestogether with the cache. Before, the stale count shrank the effective budget.Not changed (for discussion)
_is_volume/_bitmap_spanscan in principle hide an unrecognised-FS partition (e.g. BitLocker) whose span equals a bitmap span of another stream: a 1 GiB partition next to a 4 TiB one at 512-byte clusters. This is tuned on your corpus, so I left it alone.find_split_parts()still stitchesServer-2024.tibxwith an unrelatedServer.tibx. Requiring contiguous numbering would fix that, unless Acronis leaves gaps after version cleanup.Testing
All TIBX tests pass (253), including
test_tibx_acronis.pyagainst the LFS samples.ruff check,ruff format --checkandverminare clean.🤖 Generated with Claude Code