-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix AttributeError in syscache plugin #913
base: main
Are you sure you want to change the base?
Conversation
Dear @JazzCore , Thank you very much for your contribution to Dissect. |
@@ -75,7 +75,9 @@ def syscache(self): | |||
full_path = None | |||
if mft: | |||
try: | |||
full_path = self.target.fs.path("\\".join(["sysvol", mft.mft(file_segment).fullpath()])) | |||
path = mft.ntfs.mft(file_segment).full_path() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mft
already refers to a Mft
instance, so I don't think we need the round trip and can shorten to
path = mft(file_segment).full_path()
.
We can make it even more concise:
path = mft.ntfs.mft(file_segment).full_path() | |
if path := mft(file_segment).full_path(): | |
full_path = self.target.fs.path("\\".join(["sysvol", path])) |
Incidentally, when did you start experiencing this issue? I don't see any recent commits to dissect.ntfs
which might cause this. Perhaps it never worked.
@@ -75,7 +75,9 @@ def syscache(self): | |||
full_path = None | |||
if mft: | |||
try: | |||
full_path = self.target.fs.path("\\".join(["sysvol", mft.mft(file_segment).fullpath()])) | |||
path = mft.ntfs.mft(file_segment).full_path() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a unit test to tests/plugins/os/windows/test_syscache.py
?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #913 +/- ##
==========================================
- Coverage 76.65% 76.64% -0.01%
==========================================
Files 316 316
Lines 27101 27103 +2
==========================================
Hits 20774 20774
- Misses 6327 6329 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dissect.ntfs
changes probably caused regression in syscache plugin that now raises followingAttributeError
for me:Also when MFT record is missing plugin raises following
TypeError
, PR also fixes this: