Skip to content

Commit

Permalink
Log exception and skip searching a directory for Profiles if we don't
Browse files Browse the repository at this point in the history
have access to it.
  • Loading branch information
obsidianforensics committed Jun 20, 2019
1 parent b3bcf51 commit 31ff047
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pyhindsight/analysis.py
Expand Up @@ -353,7 +353,14 @@ def is_profile(base_path, existing_files, warn=False):
def search_subdirs(self, base_path):
"""Recursively search a path for browser profiles"""
found_profile_paths = []
base_dir_listing = os.listdir(base_path)

try:
base_dir_listing = os.listdir(base_path)
except Exception, e:
log.warning('Exception reading directory {0:s}; possible permissions issue? Exception: {1:s}'
.format(base_path, e))
return found_profile_paths

if self.is_profile(base_path, base_dir_listing):
found_profile_paths.append(base_path)
for item in base_dir_listing:
Expand Down

0 comments on commit 31ff047

Please sign in to comment.