Skip to content

Conversation

@object1337
Copy link

@object1337 object1337 commented Feb 6, 2026

Fixed VMDK thin opening when parentFileNameHint was set to full path

When attempting to mount a VMDK file that was created using thin
provisioning, it would fail with a file not found error on the parent VMDK
file, due to it attempting to find it in the same directory. However, the
parentFileNameHint was set to the full path of the parent VMDK file, but
ignored by dissect. This pull requests attempts to load the VMDK parent
file using the parentFileNameHint first, before continuing with the
existing loading method.

Fixes #77

Copy link
Member

@Schamper Schamper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe nice to swap it around, since I think for our purposes we generally have the first case scenario.

filename_hint = filename_hint.replace("\\", "/")
hint_path, _, filename = filename_hint.rpartition("/")
filepath = path.joinpath(filename)
filepath = path.joinpath(filename_hint)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
filepath = path.joinpath(filename_hint)
filepath = path.joinpath(filename)

if not filepath.exists():
_, _, hint_path_name = hint_path.rpartition("/")
filepath = path.parent.joinpath(hint_path_name).joinpath(filename)
filepath = path.joinpath(filename)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
filepath = path.joinpath(filename)
filepath = path.joinpath(filename_hint)

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.04%. Comparing base (6f2d5ab) to head (db87e70).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
+ Coverage   78.64%   79.04%   +0.40%     
==========================================
  Files          26       26              
  Lines        2332     2334       +2     
==========================================
+ Hits         1834     1845      +11     
+ Misses        498      489       -9     
Flag Coverage Δ
unittests 79.04% <100.00%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VMDK opening fails when parentFileNameHint is set to full path

2 participants