dissect.target 3.19.dev47__py3-none-any.whl → 3.19.dev48__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -753,7 +753,7 @@ class FilesystemEntry:
753
753
  """
754
754
  log.debug("%r::readlink_ext()", self)
755
755
  # Default behavior, resolve link own filesystem.
756
- return fsutil.resolve_link(fs=self.fs, entry=self)
756
+ return fsutil.resolve_link(self.fs, self.readlink(), self.path, alt_separator=self.fs.alt_separator)
757
757
 
758
758
  def stat(self, follow_symlinks: bool = True) -> fsutil.stat_result:
759
759
  """Determine the stat information of this entry.
@@ -1467,10 +1467,15 @@ class LayerFilesystem(Filesystem):
1467
1467
  """Get a :class:`FilesystemEntry` relative to a specific entry."""
1468
1468
  parts = path.split("/")
1469
1469
 
1470
- for part in parts:
1470
+ for i, part in enumerate(parts):
1471
1471
  if entry.is_symlink():
1472
1472
  # Resolve using the RootFilesystem instead of the entry's Filesystem
1473
- entry = fsutil.resolve_link(fs=self, entry=entry)
1473
+ entry = fsutil.resolve_link(
1474
+ self,
1475
+ entry.readlink(),
1476
+ "/".join(parts[:i]),
1477
+ alt_separator=entry.fs.alt_separator,
1478
+ )
1474
1479
  entry = entry.get(part)
1475
1480
 
1476
1481
  return entry
@@ -94,7 +94,7 @@ class ITunesFilesystemEntry(VirtualFile):
94
94
  def readlink_ext(self) -> FilesystemEntry:
95
95
  """Read the link if this entry is a symlink. Returns a filesystem entry."""
96
96
  # Can't use the one in VirtualFile as it overrides the FilesystemEntry
97
- return fsutil.resolve_link(fs=self.fs, entry=self)
97
+ return fsutil.resolve_link(self.fs, self.readlink(), self.path, alt_separator=self.fs.alt_separator)
98
98
 
99
99
  def stat(self, follow_symlinks: bool = True) -> fsutil.stat_result:
100
100
  """Return the stat information of this entry."""
@@ -121,7 +121,7 @@ class TarFilesystemEntry(VirtualFile):
121
121
  def readlink_ext(self) -> FilesystemEntry:
122
122
  """Read the link if this entry is a symlink. Returns a filesystem entry."""
123
123
  # Can't use the one in VirtualFile as it overrides the FilesystemEntry
124
- return fsutil.resolve_link(fs=self.fs, entry=self)
124
+ return fsutil.resolve_link(self.fs, self.readlink(), self.path, alt_separator=self.fs.alt_separator)
125
125
 
126
126
  def stat(self, follow_symlinks: bool = True) -> fsutil.stat_result:
127
127
  """Return the stat information of this entry."""
@@ -440,15 +440,20 @@ def has_glob_magic(s) -> bool:
440
440
 
441
441
 
442
442
  def resolve_link(
443
- fs: filesystem.Filesystem, entry: filesystem.FilesystemEntry, previous_links: set[str] = None
443
+ fs: filesystem.Filesystem,
444
+ link: str,
445
+ path: str,
446
+ *,
447
+ alt_separator: str = "",
448
+ previous_links: set[str] | None = None,
444
449
  ) -> filesystem.FilesystemEntry:
445
450
  """Resolves a symlink to its actual path.
446
451
 
447
452
  It stops resolving once it detects an infinite recursion loop.
448
453
  """
449
454
 
450
- link = normalize(entry.readlink(), alt_separator=entry.fs.alt_separator)
451
- path = normalize(entry.path, alt_separator=entry.fs.alt_separator)
455
+ link = normalize(link, alt_separator=alt_separator)
456
+ path = normalize(path, alt_separator=alt_separator)
452
457
 
453
458
  # Create hash for entry based on path and link
454
459
  link_id = f"{path}{link}"
@@ -471,7 +476,13 @@ def resolve_link(
471
476
  entry = fs.get(link)
472
477
 
473
478
  if entry.is_symlink():
474
- entry = resolve_link(fs, entry, previous_links)
479
+ entry = resolve_link(
480
+ fs,
481
+ entry.readlink(),
482
+ link,
483
+ alt_separator=entry.fs.alt_separator,
484
+ previous_links=previous_links,
485
+ )
475
486
 
476
487
  return entry
477
488
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.19.dev47
3
+ Version: 3.19.dev48
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
@@ -1,7 +1,7 @@
1
1
  dissect/target/__init__.py,sha256=Oc7ounTgq2hE4nR6YcNabetc7SQA40ldSa35VEdZcQU,63
2
2
  dissect/target/container.py,sha256=0YcwcGmfJjhPXUB6DEcjWEoSuAtTDxMDpoTviMrLsxM,9353
3
3
  dissect/target/exceptions.py,sha256=ULi7NXlqju_d8KENEL3aimmfKTFfbNssfeWhAnOB654,2972
4
- dissect/target/filesystem.py,sha256=WpcT7UKzJxr85-Y4x8QeQci4UX0z39VlraRcnmkDFkg,60519
4
+ dissect/target/filesystem.py,sha256=__p2p72B6mKgIiAOj85EC3ESdZ8gjgkm2pt1KKym3h0,60743
5
5
  dissect/target/loader.py,sha256=I8WNzDA0SMy42F7zfyBcSKj_VKNv64213WUvtGZ77qE,7374
6
6
  dissect/target/plugin.py,sha256=k9xWNnIGQG0DQsq6DKYJ6_DAX1aIA0SjzniWmOwX8O4,50317
7
7
  dissect/target/report.py,sha256=06uiP4MbNI8cWMVrC1SasNS-Yg6ptjVjckwj8Yhe0Js,7958
@@ -32,13 +32,13 @@ dissect/target/filesystems/exfat.py,sha256=PRkZPUVN5NlgB1VetFtywdNgF6Yj5OBtF5a25
32
32
  dissect/target/filesystems/extfs.py,sha256=pFv1dyqqTnImpMuy-slAqnnLVfteV9tS03AsG-svN9E,4776
33
33
  dissect/target/filesystems/fat.py,sha256=ZSw-wS57vo5eIXJndfI1rZkGu_qh-vyioMzCZFZ_UTE,4611
34
34
  dissect/target/filesystems/ffs.py,sha256=Wu8sS1jjmD0QXXcAaD2h_zzfvinjco8qvj0hErufZ-4,4555
35
- dissect/target/filesystems/itunes.py,sha256=6LPUHSf2qpHacMgA4bdlEKUIV_BaLxmIxyLESXqNexI,6345
35
+ dissect/target/filesystems/itunes.py,sha256=w2lcWv6jlBPm84tsGZehxKBMXXyuW3KlmwVTF4ssQec,6395
36
36
  dissect/target/filesystems/jffs.py,sha256=Ceqa5Em2pepnXMH_XZFmSNjQyWPo1uWTthBFSMWfKRo,3926
37
37
  dissect/target/filesystems/ntfs.py,sha256=fGgCKjdO5GrPC21DDr0SwIxmwR7KruNIqGUzysboirA,7068
38
38
  dissect/target/filesystems/overlay.py,sha256=-dqWuMWLcq3usKbJYh0MW-qyp4dfLlOAh2z6FjNPu9I,4314
39
39
  dissect/target/filesystems/smb.py,sha256=uxfcOWwEoDCw8Qpsa94T5Pn-SKd4WXs4OOrzVVI55d8,6406
40
40
  dissect/target/filesystems/squashfs.py,sha256=ehzlThXB7n96XUvQnsK5tWLsA9HIxYN-Zxl7aO9D7ts,3921
41
- dissect/target/filesystems/tar.py,sha256=kQNhcEDPX005svse039OeR2AGSDigGuGz2AKoVrgg84,5692
41
+ dissect/target/filesystems/tar.py,sha256=EJyvRCU6H7eu0exC0tQggyAZKZ3JFFaihYyx9SIQNqk,5742
42
42
  dissect/target/filesystems/vmfs.py,sha256=sRtYBUAKTKcHrjCXqpFJ8GIVU-ERjqxhB2zXBndtcXU,4955
43
43
  dissect/target/filesystems/vmtar.py,sha256=LlKWkTIuLemQmG9yGqL7980uC_AOL77_GWhbJc_grSk,804
44
44
  dissect/target/filesystems/xfs.py,sha256=kIyFGKYlyFYC7H3jaEv-lNKtBW4ZkD92H0WpfGcr1ww,4498
@@ -50,7 +50,7 @@ dissect/target/helpers/configutil.py,sha256=AEnkMQ0e6PncvCqGa-ACzBQWQBhMGBCzO5qz
50
50
  dissect/target/helpers/cyber.py,sha256=WnJlk-HqAETmDAgLq92JPxyDLxvzSoFV_WrO-odVKBI,16805
51
51
  dissect/target/helpers/descriptor_extensions.py,sha256=uT8GwznfDAiIgMM7JKKOY0PXKMv2c0GCqJTCkWFgops,2605
52
52
  dissect/target/helpers/docs.py,sha256=J5U65Y3yOTqxDEZRCdrEmO63XQCeDzOJea1PwPM6Cyc,5146
53
- dissect/target/helpers/fsutil.py,sha256=X1JrgVd9VZh-ttynar3uW9Y9vdqvB5uMvq-4DKFgm9k,20356
53
+ dissect/target/helpers/fsutil.py,sha256=y-k8ni04pHMODkgN7clTqdx-3tnFbUr0ubjJEaWOOqY,20504
54
54
  dissect/target/helpers/hashutil.py,sha256=bYAGEjyYyxuCTziO4kCx6srzY1Cm-PXmayRRcxt5ca4,1061
55
55
  dissect/target/helpers/keychain.py,sha256=wYH0sf7eaxP0bZTo80RF_BQMWulCWmIQ8Tzt9K5TSNQ,3611
56
56
  dissect/target/helpers/lazy.py,sha256=823VtmdWsbJyVZvNWopDhQdqq2i1xtj6b8IKfveboKw,1771
@@ -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.dev47.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
360
- dissect.target-3.19.dev47.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
361
- dissect.target-3.19.dev47.dist-info/METADATA,sha256=NCGFEq1LFs3I0EP59BzAba793TZy6rhKYUi4bT9rBxs,12897
362
- dissect.target-3.19.dev47.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
363
- dissect.target-3.19.dev47.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
364
- dissect.target-3.19.dev47.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
365
- dissect.target-3.19.dev47.dist-info/RECORD,,
359
+ dissect.target-3.19.dev48.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
360
+ dissect.target-3.19.dev48.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
361
+ dissect.target-3.19.dev48.dist-info/METADATA,sha256=rm0EHsiugMzObZ-OiOxBChll3DHKnBCw6oJm3dU2e4s,12897
362
+ dissect.target-3.19.dev48.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
363
+ dissect.target-3.19.dev48.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
364
+ dissect.target-3.19.dev48.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
365
+ dissect.target-3.19.dev48.dist-info/RECORD,,