f5-backup 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: f5-backup
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Automatic backups to S3-compatible storage
5
5
  License: MIT
6
6
  Author: Will Hinson
@@ -6,6 +6,22 @@ import pytsk3
6
6
  from ..devices import Partition
7
7
  from .filekey import FileKey
8
8
 
9
+ _VIRTUAL_TYPES = (pytsk3.TSK_FS_META_TYPE_VIRT, pytsk3.TSK_FS_META_TYPE_VIRT_DIR)
10
+
11
+
12
+ def _is_real_entry(entry, name: str, at_root: bool) -> bool:
13
+ if entry.info.name.flags == pytsk3.TSK_FS_NAME_FLAG_UNALLOC:
14
+ return False # deleted file
15
+ meta = entry.info.meta
16
+ if meta is None or meta.type in _VIRTUAL_TYPES:
17
+ return False # $MBR, $FAT1, $FAT2, $OrphanFiles, ...
18
+ if name.endswith("(Volume Label Entry)"):
19
+ return False
20
+ if at_root and name.startswith("$"):
21
+ return False # exFAT $ALLOC_BITMAP, $UPCASE_TABLE
22
+
23
+ return True
24
+
9
25
 
10
26
  class TskFilesystem:
11
27
  _partition: Partition
@@ -35,8 +51,8 @@ class TskFilesystem:
35
51
  if entry_name in [".", ".."]:
36
52
  continue
37
53
 
38
- # ignore deleted/unallocated entries with no metadata
39
- if entry.info.meta is None:
54
+ # ignore deleted/unallocated entries with no metadata and TSK virtual files
55
+ if not _is_real_entry(entry, entry_name, at_root=path == Path("/")):
40
56
  continue
41
57
 
42
58
  entry_path: Path = path / entry_name
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "f5-backup"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  description = "Automatic backups to S3-compatible storage"
5
5
  authors = [
6
6
  {name = "Will Hinson",email = "will@hinson.sh"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes