Skip to content
This repository has been archived by the owner on Oct 5, 2019. It is now read-only.

adds other chrome profile directories to the collection list #154

Merged
merged 8 commits into from
Aug 21, 2017
14 changes: 3 additions & 11 deletions osxcollector/osxcollector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,11 +1491,7 @@ def _collect_chrome(self, homedir):
Logger.log_warning('Directory not found {0}'.format(chrome_path))
return

profile_paths = []
for subdir in os.listdir(chrome_path):
if os.path.isdir(os.path.join(chrome_path, subdir)):
if os.path.isfile("{0}/{1}/History".format(chrome_path, subdir)):
profile_paths.append(pathjoin(chrome_path, subdir))
profile_paths = [pathjoin(chrome_path, subdir) for subdir in os.listdir(chrome_path) if os.path.isdir(os.path.join(chrome_path, subdir)) and os.path.isfile("{0}/{1}/History".format(chrome_path, subdir))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, okay, so now the tricky question is how do you split it into multiple lines so it is readable? ;)


sqlite_dbs = [
('history', 'History'),
Expand All @@ -1506,10 +1502,6 @@ def _collect_chrome(self, homedir):
('web_data', 'Web Data')
]

for profile_path in profile_paths:
self._log_sqlite_dbs_for_subsections(
sqlite_dbs, profile_path, chrome_ignored_sqlite_keys)

directories_of_dbs = [
('databases', 'databases'),
('local_storage', 'Local Storage')
Expand All @@ -1524,8 +1516,8 @@ def ignore_db_path(sqlite_db_path):
self._log_directories_of_dbs(
directories_of_dbs, profile_path, chrome_ignored_sqlite_keys,
ignore_db_path)

for profile_path in profile_paths:
self._log_sqlite_dbs_for_subsections(
sqlite_dbs, profile_path, chrome_ignored_sqlite_keys)
with Logger.Extra('osxcollector_subsection', 'preferences'):
self._log_json_file(profile_path, 'preferences')

Expand Down