diff --git a/main.py b/main.py index cfadea2..5cea733 100755 --- a/main.py +++ b/main.py @@ -37,7 +37,7 @@ __author__ = "Andrea Lazzarotto" __copyright__ = "(c) 2014-2017, Andrea Lazzarotto" __license__ = "GPLv3" -__version__ = "1.1" +__version__ = "1.1.1" __maintainer__ = "Andrea Lazzarotto" __email__ = "andrea.lazzarotto@gmail.com" diff --git a/recuperabit/fs/ntfs.py b/recuperabit/fs/ntfs.py index 5fab104..c6b912b 100644 --- a/recuperabit/fs/ntfs.py +++ b/recuperabit/fs/ntfs.py @@ -283,12 +283,15 @@ def __init__(self, parsed, offset, is_ghost=False, ads=''): size = attr['content_size'] break - name = best_name([ - (f['content']['namespace'], f['content']['name'] + ads_suffix) - for f in filenames if f.has_key('content') and + filtered = [ + f for f in filenames if f.has_key('content') and f['content'] is not None and f['content']['name_length'] > 0 and f['content']['name'] is not None + ] + name = best_name([ + (f['content']['namespace'], f['content']['name'] + ads_suffix) + for f in filtered ]) hasname = name is not None @@ -300,10 +303,10 @@ def __init__(self, parsed, offset, is_ghost=False, ads=''): File.__init__(self, index, name, size, is_dir, is_del, is_ghost) # Additional attributes if hasname: - parent_id = filenames[0]['content']['parent_entry'] + first = filtered[0]['content'] + parent_id = first['parent_entry'] File.set_parent(self, parent_id) File.set_offset(self, offset) - first = filenames[0]['content'] File.set_mac( self, first['modification_time'], first['access_time'], first['creation_time']