Skip to content

Commit

Permalink
Code review: 275060043: Fix bug where MFT parser was putting methods …
Browse files Browse the repository at this point in the history
…into events. Fixes log2timeline#402.
  • Loading branch information
Onager authored and joachimmetz committed Dec 31, 2015
1 parent 4d9c775 commit c6a2af6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/dpkg/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python-plaso (1.3.1-1) unstable; urgency=low

* Auto-generated

-- Log2Timeline <[email protected]> Mon, 02 Nov 2015 21:02:29 +0100
-- Log2Timeline <[email protected]> Tue, 03 Nov 2015 22:20:37 +0100
2 changes: 1 addition & 1 deletion plaso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__version__ = '1.3.1'

VERSION_DEV = True
VERSION_DATE = '20151102'
VERSION_DATE = '20151103'


def GetVersion():
Expand Down
8 changes: 4 additions & 4 deletions plaso/parsers/ntfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _ParseMFTAttribute(self, parser_mediator, mft_entry, mft_attribute):
creation_time, eventdata.EventTimestamp.CREATION_TIME,
mft_entry.file_reference, mft_attribute.attribute_type,
file_attribute_flags=file_attribute_flags,
is_allocated=mft_entry.is_allocated, name=name,
is_allocated=mft_entry.is_allocated(), name=name,
parent_file_reference=parent_file_reference)
parser_mediator.ProduceEvent(event_object)

Expand All @@ -90,7 +90,7 @@ def _ParseMFTAttribute(self, parser_mediator, mft_entry, mft_attribute):
modification_time, eventdata.EventTimestamp.MODIFICATION_TIME,
mft_entry.file_reference, mft_attribute.attribute_type,
file_attribute_flags=file_attribute_flags,
is_allocated=mft_entry.is_allocated, name=name,
is_allocated=mft_entry.is_allocated(), name=name,
parent_file_reference=parent_file_reference)
parser_mediator.ProduceEvent(event_object)

Expand All @@ -108,7 +108,7 @@ def _ParseMFTAttribute(self, parser_mediator, mft_entry, mft_attribute):
access_time, eventdata.EventTimestamp.ACCESS_TIME,
mft_entry.file_reference, mft_attribute.attribute_type,
file_attribute_flags=file_attribute_flags,
is_allocated=mft_entry.is_allocated, name=name,
is_allocated=mft_entry.is_allocated(), name=name,
parent_file_reference=parent_file_reference)
parser_mediator.ProduceEvent(event_object)

Expand All @@ -128,7 +128,7 @@ def _ParseMFTAttribute(self, parser_mediator, mft_entry, mft_attribute):
eventdata.EventTimestamp.ENTRY_MODIFICATION_TIME,
mft_entry.file_reference, mft_attribute.attribute_type,
file_attribute_flags=file_attribute_flags,
is_allocated=mft_entry.is_allocated, name=name,
is_allocated=mft_entry.is_allocated(), name=name,
parent_file_reference=parent_file_reference)
parser_mediator.ProduceEvent(event_object)

Expand Down
20 changes: 20 additions & 0 deletions tests/parsers/ntfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def testParseImage(self):
# The creation timestamp.
event_object = event_objects[0]

# Check that the allocation status is set correctly.
self.assertIsInstance(event_object.is_allocated, bool)
self.assertTrue(event_object.is_allocated)

expected_timestamp = timelib.Timestamp.CopyFromString(
u'2013-12-03 06:30:41.807907')
self.assertEqual(
Expand All @@ -85,6 +89,10 @@ def testParseImage(self):
# The last modification timestamp.
event_object = event_objects[1]

# Check that the allocation status is set correctly.
self.assertIsInstance(event_object.is_allocated, bool)
self.assertTrue(event_object.is_allocated)

expected_timestamp = timelib.Timestamp.CopyFromString(
u'2013-12-03 06:30:41.807907')
self.assertEqual(
Expand All @@ -94,6 +102,10 @@ def testParseImage(self):
# The last accessed timestamp.
event_object = event_objects[2]

# Check that the allocation status is set correctly.
self.assertIsInstance(event_object.is_allocated, bool)
self.assertTrue(event_object.is_allocated)

expected_timestamp = timelib.Timestamp.CopyFromString(
u'2013-12-03 06:30:41.807907')
self.assertEqual(
Expand All @@ -103,6 +115,10 @@ def testParseImage(self):
# The entry modification timestamp.
event_object = event_objects[3]

# Check that the allocation status is set correctly.
self.assertIsInstance(event_object.is_allocated, bool)
self.assertTrue(event_object.is_allocated)

expected_timestamp = timelib.Timestamp.CopyFromString(
u'2013-12-03 06:30:41.807907')
self.assertEqual(
Expand All @@ -124,6 +140,10 @@ def testParseImage(self):
# The creation timestamp.
event_object = event_objects[4]

# Check that the allocation status is set correctly.
self.assertIsInstance(event_object.is_allocated, bool)
self.assertTrue(event_object.is_allocated)

expected_timestamp = timelib.Timestamp.CopyFromString(
u'2013-12-03 06:30:41.807907')
self.assertEqual(
Expand Down

0 comments on commit c6a2af6

Please sign in to comment.