Skip to content

Commit

Permalink
Update preprocessor path_spec handling (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarontp authored Jan 13, 2022
1 parent 05ad566 commit dad6c3c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions turbinia/processors/partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def GetPartitionEncryptionType(path_spec):
"""
encryption_type = None

if not path_spec.HasParent():
if not path_spec or not path_spec.HasParent():
return None

if path_spec.parent.type_indicator == dfvfs_definitions.TYPE_INDICATOR_BDE:
Expand All @@ -92,13 +92,12 @@ def GetPathSpecByLocation(path_specs, location):
fs_location = getattr(path_spec, 'location', None)
while path_spec.HasParent():
type_indicator = path_spec.type_indicator
if type_indicator in (dfvfs_definitions.TYPE_INDICATOR_GPT,
dfvfs_definitions.TYPE_INDICATOR_LVM,
dfvfs_definitions.TYPE_INDICATOR_TSK_PARTITION):
if type_indicator in dfvfs_definitions.VOLUME_SYSTEM_TYPE_INDICATORS:
if fs_location in ('\\', '/'):
fs_location = getattr(path_spec, 'location', None)
break
path_spec = path_spec.parent
if fs_location == location:
return child_path_spec
log.warn('Could not find path_spec for location {0:s}'.format(location))
return None

0 comments on commit dad6c3c

Please sign in to comment.