dissect.target 3.19.dev44__py3-none-any.whl → 3.19.dev46__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ from typing import Callable, Iterable, Iterator
4
4
  from flow.record import GroupedRecord, Record, RecordDescriptor, fieldtypes
5
5
 
6
6
  from dissect.target import Target
7
- from dissect.target.exceptions import FilesystemError
7
+ from dissect.target.exceptions import FileNotFoundError, FilesystemError
8
8
  from dissect.target.helpers.fsutil import TargetPath
9
9
  from dissect.target.helpers.hashutil import common
10
10
  from dissect.target.helpers.utils import StrEnum
@@ -44,7 +44,20 @@ def _resolve_path_records(field_name: str, resolved_path: TargetPath) -> Record:
44
44
 
45
45
 
46
46
  def _hash_path_records(field_name: str, resolved_path: TargetPath) -> Record:
47
- """Hash files from path fields inside the record."""
47
+ """Hash files from path fields inside the record.
48
+
49
+ Args:
50
+ field_name: Name of the field.
51
+ resolved_path: Path to the file we should hash.
52
+
53
+ Raises:
54
+ FileNotFoundError: Raised if the provided ``resolved_path`` does not exist or is not a file on the target.
55
+
56
+ Returns: Modified record with digests of path field types.
57
+ """
58
+
59
+ if not resolved_path.exists() or not resolved_path.is_file():
60
+ raise FileNotFoundError(f"Path not found or is not a file: '{resolved_path}'")
48
61
 
49
62
  with resolved_path.open() as fh:
50
63
  path_hash = common(fh)
@@ -81,8 +94,14 @@ def modify_record(target: Target, record: Record, modifier_function: ModifierFun
81
94
  for field_name, resolved_path in _resolve_path_types(target, record):
82
95
  try:
83
96
  _record = modifier_function(field_name, resolved_path)
84
- except FilesystemError:
85
- pass
97
+ except FilesystemError as e:
98
+ target.log.warning(
99
+ "Unable to modify record '%s' with function '%s': %s",
100
+ record._desc.name,
101
+ modifier_function.__name__,
102
+ e,
103
+ )
104
+ target.log.debug("", exc_info=e)
86
105
  else:
87
106
  additional_records.append(_record)
88
107
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.19.dev44
3
+ Version: 3.19.dev46
4
4
  Summary: This module ties all other Dissect modules together, it provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets)
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License: Affero General Public License v3
@@ -62,7 +62,7 @@ dissect/target/helpers/network_managers.py,sha256=ByBSe2K3c8hgQC6dokcf-hHdmPcD8P
62
62
  dissect/target/helpers/polypath.py,sha256=h8p7m_OCNiQljGwoZh5Aflr9H2ot6CZr6WKq1OSw58o,2175
63
63
  dissect/target/helpers/protobuf.py,sha256=b4DsnqrRLrefcDjx7rQno-_LBcwtJXxuKf5RdOegzfE,1537
64
64
  dissect/target/helpers/record.py,sha256=zwqEnFSgxgX6JdhhF4zycMMZK09crCTWWEFzRxZSuC8,5658
65
- dissect/target/helpers/record_modifier.py,sha256=3I_rC5jqvl0TsW3V8OQ6Dltz_D8J4PU1uhhzbJGKm9c,3245
65
+ dissect/target/helpers/record_modifier.py,sha256=O_Jj7zOi891HIyAYjxxe6LFPYETHdMa5lNjo4NA_T_w,3969
66
66
  dissect/target/helpers/regutil.py,sha256=kX-sSZbW8Qkg29Dn_9zYbaQrwLumrr4Y8zJ1EhHXIAM,27337
67
67
  dissect/target/helpers/shell_application_ids.py,sha256=hYxrP-YtHK7ZM0ectJFHfoMB8QUXLbYNKmKXMWLZRlA,38132
68
68
  dissect/target/helpers/shell_folder_ids.py,sha256=Behhb8oh0kMxrEk6YYKYigCDZe8Hw5QS6iK_d2hTs2Y,24978
@@ -356,10 +356,10 @@ dissect/target/volumes/luks.py,sha256=OmCMsw6rCUXG1_plnLVLTpsvE1n_6WtoRUGQbpmu1z
356
356
  dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
357
357
  dissect/target/volumes/md.py,sha256=7ShPtusuLGaIv27SvEETtgsuoQyAa4iAAeOR1NEaajI,1689
358
358
  dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
359
- dissect.target-3.19.dev44.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
360
- dissect.target-3.19.dev44.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
361
- dissect.target-3.19.dev44.dist-info/METADATA,sha256=RQ83iir9MCf9n5ziYqadexuZ6dtDlkMWba1z0t_HI8I,12897
362
- dissect.target-3.19.dev44.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
363
- dissect.target-3.19.dev44.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
364
- dissect.target-3.19.dev44.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
365
- dissect.target-3.19.dev44.dist-info/RECORD,,
359
+ dissect.target-3.19.dev46.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
360
+ dissect.target-3.19.dev46.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
361
+ dissect.target-3.19.dev46.dist-info/METADATA,sha256=KqAZhon-mJ3zlkhXprWA1AQGJ5atgKACGFMvgTKsayo,12897
362
+ dissect.target-3.19.dev46.dist-info/WHEEL,sha256=nCVcAvsfA9TDtwGwhYaRrlPhTLV9m-Ga6mdyDtuwK18,91
363
+ dissect.target-3.19.dev46.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
364
+ dissect.target-3.19.dev46.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
365
+ dissect.target-3.19.dev46.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (73.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5