Skip to content

Commit

Permalink
Changes to expose extended attribute extents log2timeline#597
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Aug 31, 2022
1 parent 2ed0a8c commit 047f7a6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/dpkg/control
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Homepage: https://github.com/log2timeline/dfvfs

Package: python3-dfvfs
Architecture: all
Depends: libbde-python3 (>= 20220121), libewf-python3 (>= 20131210), libfsapfs-python3 (>= 20220709), libfsext-python3 (>= 20220829), libfsfat-python3 (>= 20220816), libfshfs-python3 (>= 20220709), libfsntfs-python3 (>= 20211229), libfsxfs-python3 (>= 20220829), libfvde-python3 (>= 20220121), libfwnt-python3 (>= 20210717), libluksde-python3 (>= 20220121), libmodi-python3 (>= 20210405), libphdi-python3 (>= 20220228), libqcow-python3 (>= 20201213), libsigscan-python3 (>= 20191221), libsmdev-python3 (>= 20140529), libsmraw-python3 (>= 20140612), libvhdi-python3 (>= 20201014), libvmdk-python3 (>= 20140421), libvsgpt-python3 (>= 20211115), libvshadow-python3 (>= 20160109), libvslvm-python3 (>= 20160109), python3-cffi-backend (>= 1.9.1), python3-cryptography (>= 2.0.2), python3-dfdatetime (>= 20220816), python3-dtfabric (>= 20220219), python3-idna (>= 2.5), python3-pytsk3 (>= 20210419), python3-pyxattr (>= 0.7.2), python3-yaml (>= 3.10), ${misc:Depends}
Depends: libbde-python3 (>= 20220121), libewf-python3 (>= 20131210), libfsapfs-python3 (>= 20220709), libfsext-python3 (>= 20220829), libfsfat-python3 (>= 20220816), libfshfs-python3 (>= 20220831), libfsntfs-python3 (>= 20211229), libfsxfs-python3 (>= 20220829), libfvde-python3 (>= 20220121), libfwnt-python3 (>= 20210717), libluksde-python3 (>= 20220121), libmodi-python3 (>= 20210405), libphdi-python3 (>= 20220228), libqcow-python3 (>= 20201213), libsigscan-python3 (>= 20191221), libsmdev-python3 (>= 20140529), libsmraw-python3 (>= 20140612), libvhdi-python3 (>= 20201014), libvmdk-python3 (>= 20140421), libvsgpt-python3 (>= 20211115), libvshadow-python3 (>= 20160109), libvslvm-python3 (>= 20160109), python3-cffi-backend (>= 1.9.1), python3-cryptography (>= 2.0.2), python3-dfdatetime (>= 20220816), python3-dtfabric (>= 20220219), python3-idna (>= 2.5), python3-pytsk3 (>= 20210419), python3-pyxattr (>= 0.7.2), python3-yaml (>= 3.10), ${misc:Depends}
Description: Python 3 module of dfVFS
dfVFS, or Digital Forensics Virtual File System, provides read-only access to
file-system objects from various storage media types and file formats. The goal
Expand Down
2 changes: 1 addition & 1 deletion dependencies.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ version_property: get_version()
[pyfshfs]
dpkg_name: libfshfs-python3
l2tbinaries_name: libfshfs
minimum_version: 20220709
minimum_version: 20220831
pypi_name: libfshfs-python
rpm_name: libfshfs-python3
version_property: get_version()
Expand Down
25 changes: 25 additions & 0 deletions dfvfs/vfs/hfs_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

import os

from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.vfs import attribute
from dfvfs.vfs import extent


class HFSExtendedAttribute(attribute.Attribute):
Expand All @@ -31,6 +33,29 @@ def name(self):
"""str: name."""
return self._fshfs_extended_attribute.name

def GetExtents(self):
"""Retrieves the extents.
Returns:
list[Extent]: the extents of the attribute data.
"""
extents = []
for extent_index in range(
self._fshfs_extended_attribute.number_of_extents):
extent_offset, extent_size, extent_flags = (
self._fshfs_extended_attribute.get_extent(extent_index))

if extent_flags & 0x1:
extent_type = definitions.EXTENT_TYPE_SPARSE
else:
extent_type = definitions.EXTENT_TYPE_DATA

data_stream_extent = extent.Extent(
extent_type=extent_type, offset=extent_offset, size=extent_size)
extents.append(data_stream_extent)

return extents

# Note: that the following functions do not follow the style guide
# because they are part of the file-like object interface.
# pylint: disable=invalid-name
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ libewf-python >= 20131210
libfsapfs-python >= 20220709
libfsext-python >= 20220829
libfsfat-python >= 20220816
libfshfs-python >= 20220709
libfshfs-python >= 20220831
libfsntfs-python >= 20211229
libfsxfs-python >= 20220829
libfvde-python >= 20220121
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ requires = libbde-python3 >= 20220121
libfsapfs-python3 >= 20220709
libfsext-python3 >= 20220829
libfsfat-python3 >= 20220816
libfshfs-python3 >= 20220709
libfshfs-python3 >= 20220831
libfsntfs-python3 >= 20211229
libfsxfs-python3 >= 20220829
libfvde-python3 >= 20220121
Expand Down

0 comments on commit 047f7a6

Please sign in to comment.