dissect.vmfs 3.12.dev1__tar.gz → 3.12.dev2__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.
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/PKG-INFO +1 -1
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/descriptor.py +20 -8
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect.vmfs.egg-info/PKG-INFO +1 -1
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/test_vmfs.py +20 -2
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/.git-blame-ignore-revs +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/.gitattributes +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/COPYRIGHT +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/LICENSE +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/MANIFEST.in +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/README.md +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/__init__.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/address.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/c_lvm.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/c_lvm.pyi +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/c_vmfs.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/c_vmfs.pyi +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/exception.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/lvm.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/resource.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/util.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect/vmfs/vmfs.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect.vmfs.egg-info/SOURCES.txt +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect.vmfs.egg-info/dependency_links.txt +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect.vmfs.egg-info/requires.txt +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect.vmfs.egg-info/top_level.txt +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/pyproject.toml +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/setup.cfg +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/__init__.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/huge/lvm5.csv.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/huge/lvm6.csv.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/lvm3.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/lvm4.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/lvm5.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/lvm6.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/span/lvm3-span-0.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/span/lvm3-span-1.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/span/lvm4-span-0.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/span/lvm4-span-1.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/span/lvm5-span-0.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/span/lvm5-span-1.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/span/lvm6-span-0.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/lvm/span/lvm6-span-1.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/span/vmfs5-span-0.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/span/vmfs5-span-1.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/span/vmfs6-span-0.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/span/vmfs6-span-1.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs5-no-dense-sbpc.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs5-resource-optimized.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs5.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs5d.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs5l.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs5ld.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs6-resource-optimized.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs6.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs6d.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs6l.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs6ld.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs.bin.gz +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_docs/Makefile +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_docs/conf.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_docs/index.rst +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/conftest.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/test_exception.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/test_lvm.py +0 -0
- {dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dissect.vmfs
|
|
3
|
-
Version: 3.12.
|
|
3
|
+
Version: 3.12.dev2
|
|
4
4
|
Summary: A Dissect module implementing a parser for the VMFS file system, used by VMware virtualization software
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -19,7 +19,13 @@ from dissect.vmfs.address import (
|
|
|
19
19
|
address_type,
|
|
20
20
|
)
|
|
21
21
|
from dissect.vmfs.c_vmfs import FS3_AddrType, FS3_DescriptorType, FS3_ZeroLevelAddrType, FS6_DirBlockType, c_vmfs
|
|
22
|
-
from dissect.vmfs.exception import
|
|
22
|
+
from dissect.vmfs.exception import (
|
|
23
|
+
FileNotFoundError,
|
|
24
|
+
NotADirectoryError,
|
|
25
|
+
NotAnRDMFileError,
|
|
26
|
+
NotASymlinkError,
|
|
27
|
+
VolumeNotAvailableError,
|
|
28
|
+
)
|
|
23
29
|
from dissect.vmfs.util import vmfs_uuid
|
|
24
30
|
|
|
25
31
|
if TYPE_CHECKING:
|
|
@@ -137,8 +143,8 @@ class FileDescriptor:
|
|
|
137
143
|
Lock [type {li.type:x} offset {li.addr.offset} v {li.token}, hb offset {li.hbAddr.offset}
|
|
138
144
|
gen {li.hbGen.gen}, mode {li.mode}, owner {vmfs_uuid(li.owner)} mtime {li.mtime}
|
|
139
145
|
num {li.numHolders} gblnum {li.gblNumHolders} gblgen {li.gblGen} gblbrk {li.gblBrk}]
|
|
140
|
-
Addr <{address_type(self.address)}, {cluster}, {resource}>, gen {fd.generation}, links {fd.
|
|
141
|
-
len {fd.
|
|
146
|
+
Addr <{address_type(self.address)}, {cluster}, {resource}>, gen {fd.generation}, links {fd.linkCount}, type {type_str}, flags {fd.flags:#x}, uid {fd.uid}, gid {fd.gid}, mode {fd.mode:o}
|
|
147
|
+
len {fd.fileLength}, nb {fd.numBlocks} tbz {fd.numTBZBlocksLo | fd.numTBZBlocksHi << 32}, cow {fd.numCOWBlocksLo | fd.numCOWBlocksHi << 32}, newSinceEpoch {fd.newSinceEpochLo | fd.newSinceEpochHi << 32}, zla {fd.zeroLevelAddrType}, bs {fd.blockSize}
|
|
142
148
|
affinityFD <{address_type(fd.affinityFD)},{affinity_cluster},{affinity_resource}>, parentFD <{address_type(fd.parentFD)},{parent_cluster},{parent_resource}>, tbzGranularityShift {fd.tbzGranularityShift}, numLFB {fd.numLFB}
|
|
143
149
|
lastSFBClusterNum {fd.lastSFBClusterNum}, numPreAllocBlocks {fd.numPreAllocBlocks}, numPointerBlocks {fd.numPointerBlocks}
|
|
144
150
|
""").strip() # noqa: E501
|
|
@@ -232,13 +238,19 @@ class FileDescriptor:
|
|
|
232
238
|
|
|
233
239
|
Access the mode through the :attr:`metadata` attribute to get the raw mode value.
|
|
234
240
|
"""
|
|
235
|
-
if stat.S_IFMT(self.metadata.mode)
|
|
241
|
+
if stat.S_IFMT(self.metadata.mode):
|
|
242
|
+
# If the mode already has a type bit set, return it as is
|
|
236
243
|
return self.metadata.mode
|
|
237
244
|
|
|
238
|
-
if self.
|
|
245
|
+
if self.is_dir():
|
|
246
|
+
return self.metadata.mode | stat.S_IFDIR
|
|
247
|
+
|
|
248
|
+
if self.is_symlink():
|
|
239
249
|
return self.metadata.mode | stat.S_IFLNK
|
|
240
|
-
|
|
250
|
+
|
|
251
|
+
if self.is_rdm():
|
|
241
252
|
return self.metadata.mode | stat.S_IFBLK
|
|
253
|
+
|
|
242
254
|
return self.metadata.mode | stat.S_IFREG
|
|
243
255
|
|
|
244
256
|
@property
|
|
@@ -272,11 +284,11 @@ class FileDescriptor:
|
|
|
272
284
|
|
|
273
285
|
def is_dir(self) -> bool:
|
|
274
286
|
"""Return whether this file descriptor is a directory."""
|
|
275
|
-
return self.type == FS3_DescriptorType.DIRECTORY
|
|
287
|
+
return self.type == FS3_DescriptorType.DIRECTORY or (self.is_system() and stat.S_ISDIR(self.metadata.mode))
|
|
276
288
|
|
|
277
289
|
def is_file(self) -> bool:
|
|
278
290
|
"""Return whether this file descriptor is a regular file."""
|
|
279
|
-
return self.type == FS3_DescriptorType.REGFILE
|
|
291
|
+
return self.type == FS3_DescriptorType.REGFILE or (self.is_system() and not stat.S_ISDIR(self.metadata.mode))
|
|
280
292
|
|
|
281
293
|
def is_symlink(self) -> bool:
|
|
282
294
|
"""Return whether this file descriptor is a symlink."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dissect.vmfs
|
|
3
|
-
Version: 3.12.
|
|
3
|
+
Version: 3.12.dev2
|
|
4
4
|
Summary: A Dissect module implementing a parser for the VMFS file system, used by VMware virtualization software
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import contextlib
|
|
4
4
|
import gzip
|
|
5
|
+
import stat
|
|
5
6
|
|
|
6
7
|
import pytest
|
|
7
8
|
|
|
@@ -73,11 +74,20 @@ def test_vmfs_basic(path: str | list[str], type: str, request: pytest.FixtureReq
|
|
|
73
74
|
assert FS3_Config.DENSE_SBPC in fs.descriptor.config
|
|
74
75
|
|
|
75
76
|
root_dir = fs.get("/").listdir()
|
|
76
|
-
for name in (".vh.sf", ".pb2.sf", ".pbc.sf", ".fbb.sf", ".fdc.sf", ".sbc.sf") + (
|
|
77
|
+
for name in (".vh.sf", ".pb2.sf", ".pbc.sf", ".fbb.sf", ".fdc.sf", ".sbc.sf", ".sdd.sf") + (
|
|
77
78
|
(".jbc.sf",) if fs.is_vmfs6 else ()
|
|
78
79
|
):
|
|
79
80
|
assert name in root_dir, f"Expected {name} in root directory"
|
|
80
|
-
|
|
81
|
+
|
|
82
|
+
fd = root_dir[name].fd
|
|
83
|
+
assert fd.is_system(), f"{name} should be a system file"
|
|
84
|
+
|
|
85
|
+
if name == ".sdd.sf":
|
|
86
|
+
assert fd.is_dir(), f"{name} should be a directory"
|
|
87
|
+
assert stat.S_ISDIR(fd.mode), f"{name} should be a directory"
|
|
88
|
+
else:
|
|
89
|
+
assert fd.is_file(), f"{name} should be a regular file"
|
|
90
|
+
assert stat.S_ISREG(fd.mode), f"{name} should be a regular file"
|
|
81
91
|
|
|
82
92
|
|
|
83
93
|
@pytest.mark.parametrize(
|
|
@@ -93,6 +103,11 @@ def test_vmfs_content(path: str) -> None:
|
|
|
93
103
|
vs = lvm.LVM(fh)
|
|
94
104
|
fs = vmfs.VMFS(vs.volumes[0].open())
|
|
95
105
|
|
|
106
|
+
# Test root
|
|
107
|
+
fd = fs.get("/")
|
|
108
|
+
assert fd.is_dir()
|
|
109
|
+
assert stat.S_ISDIR(fd.mode)
|
|
110
|
+
|
|
96
111
|
# Test a small file
|
|
97
112
|
fd = fs.get("small")
|
|
98
113
|
_assert_is_file(fd, 5, FS3_ZeroLevelAddrType.FILE_DESCRIPTOR_RESIDENT)
|
|
@@ -111,11 +126,13 @@ def test_vmfs_content(path: str) -> None:
|
|
|
111
126
|
# Test a symlink
|
|
112
127
|
fd = fs.get("symlink")
|
|
113
128
|
assert fd.is_symlink()
|
|
129
|
+
assert stat.S_ISLNK(fd.mode)
|
|
114
130
|
assert fd.link == f"/vmfs/volumes/{fs.label}/small"
|
|
115
131
|
|
|
116
132
|
# Test a directory
|
|
117
133
|
fd = fs.get("directory")
|
|
118
134
|
assert fd.is_dir()
|
|
135
|
+
assert stat.S_ISDIR(fd.mode)
|
|
119
136
|
contents = fd.listdir()
|
|
120
137
|
|
|
121
138
|
assert set(contents.keys()) == {f"file{i}" for i in range(1, 101)} | {".", ".."}, (
|
|
@@ -213,5 +230,6 @@ def _assert_is_file(fd: vmfs.FileDescriptor, size: int, zla: FS3_ZeroLevelAddrTy
|
|
|
213
230
|
assert not fd.is_symlink()
|
|
214
231
|
assert not fd.is_rdm()
|
|
215
232
|
assert not fd.is_system()
|
|
233
|
+
assert stat.S_ISREG(fd.mode)
|
|
216
234
|
assert fd.size == size
|
|
217
235
|
assert fd.zla == zla
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/dissect.vmfs.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs5-no-dense-sbpc.bin.gz
RENAMED
|
File without changes
|
{dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs5-resource-optimized.bin.gz
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dissect_vmfs-3.12.dev1 → dissect_vmfs-3.12.dev2}/tests/_data/vmfs/vmfs6-resource-optimized.bin.gz
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|