Skip to content
Snippets Groups Projects
Commit 8919795c authored by Ryan Eisma's avatar Ryan Eisma
Browse files

CT-7152

PR #2844 tweaks to align with comments.
parent 68b18cae
No related branches found
No related tags found
No related merge requests found
...@@ -292,9 +292,8 @@ def _dump_output_db_bb(db_file, bb_dump_file, isMultiUser, pgSettings, id_obj_pa ...@@ -292,9 +292,8 @@ def _dump_output_db_bb(db_file, bb_dump_file, isMultiUser, pgSettings, id_obj_pa
if attr["display_name"] == "Associated Artifact": if attr["display_name"] == "Associated Artifact":
attr_value_as_string = TskDbDiff._get_associated_artifact_type(attribute_cursor, attr_value_as_string, isMultiUser) attr_value_as_string = TskDbDiff._get_associated_artifact_type(attribute_cursor, attr_value_as_string, isMultiUser)
patrn = re.compile("[\n\0\a\b\r\f]") patrn = re.compile("[\n\0\a\b\r\f]")
if attr_value_as_string == None: if attr_value_as_string is None:
print(f'{attr["value_type"]}') print(f'Could not determine attribute value for value type: {attr["value_type"]}, display name: {attr["display_name"]}')
print(f'{attr["display_name"]}')
attr_value_as_string = re.sub(patrn, ' ', attr_value_as_string) attr_value_as_string = re.sub(patrn, ' ', attr_value_as_string)
if attr["source"] == "Keyword Search" and attr["display_name"] == "Keyword Preview": if attr["source"] == "Keyword Search" and attr["display_name"] == "Keyword Preview":
...@@ -659,7 +658,7 @@ def index_of(lst, search_item) -> int: ...@@ -659,7 +658,7 @@ def index_of(lst, search_item) -> int:
Returns: The index in the list of the item or -1. Returns: The index in the list of the item or -1.
""" """
if lst == None: if lst is None:
return -1 return -1
for idx, item in enumerate(lst): for idx, item in enumerate(lst):
...@@ -1009,6 +1008,25 @@ def normalize_tsk_objects_path(guid_util: TskGuidUtils, objid: int, ...@@ -1009,6 +1008,25 @@ def normalize_tsk_objects_path(guid_util: TskGuidUtils, objid: int,
path_parts = path_parts[:-1] path_parts = path_parts[:-1]
if path_parts and len(path_parts) >= 2: if path_parts and len(path_parts) >= 2:
is_leapp = False
for leapp_module in ['aleapp', 'ileapp']:
if len(path_parts) > 0 and path_parts[1].lower() == leapp_module and \
path_parts[-1].lower() == 'index.html':
path_parts = ['ModuleOutput', leapp_module, 'index.html']
is_leapp = True
break
if not is_leapp:
for idx in range(0, len(path_parts) - 1):
if path_parts[idx].lower() == "reports" and \
path_parts[idx + 1].lower().startswith("autopsytestcase html report"):
path_parts = ["Reports", "AutopsyTestCase HTML Report"]
break
if path_parts[idx].lower() == "reports" and \
"html report" in path_parts[idx + 1].lower() and \
len(path_parts) > idx + 2 and \
path_parts[idx + 2].lower().endswith("report.html"):
path_parts = ["Reports", "html-report.html"]
break
for idx in range(0, len(path_parts) - 1): for idx in range(0, len(path_parts) - 1):
if path_parts[idx].lower() == "reports" and \ if path_parts[idx].lower() == "reports" and \
path_parts[idx + 1].lower().startswith("autopsytestcase html report"): path_parts[idx + 1].lower().startswith("autopsytestcase html report"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment