Skip to content

Commit

Permalink
Add volume name field
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper committed Dec 12, 2023
1 parent f3f101a commit 4b9b116
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions dissect/extfs/extfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def __init__(self, fh: BinaryIO):
self.groups_count = ((self.last_block - sb.s_first_data_block) // sb.s_blocks_per_group) + 1

self.uuid = UUID(bytes=sb.s_uuid)
self.volume_name = sb.s_volume_name.split(b"\x00")[0].decode(errors="surrogateescape")
self.last_mount = sb.s_last_mounted.split(b"\x00")[0].decode(errors="surrogateescape")

self.root = self.get_inode(c_ext.EXT2_ROOT_INO, "/")
Expand Down
1 change: 1 addition & 0 deletions tests/test_ext4.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_ext4(ext4_bin: BinaryIO):
assert extfs.groups_offset == 2048
assert extfs._group_desc_size == 64
assert str(extfs.uuid) == "ab98e08e-e2da-4bc9-bfc6-1ac5eafb1001"
assert extfs.volume_name == ""
assert extfs.last_mount == "/tmp/mnt"

root = extfs.root
Expand Down

0 comments on commit 4b9b116

Please sign in to comment.