From 81ec9ea113eef9bd007f2cfbcd8c2b4fd0cc6fa4 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dsmyda" Date: Wed, 11 Nov 2020 19:55:31 -0500 Subject: [PATCH] Made the nightly db dump script ignore size and hash for TIFF files extracted from PDFs --- test/script/tskdbdiff.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/script/tskdbdiff.py b/test/script/tskdbdiff.py index f152cd923a..856a46b658 100644 --- a/test/script/tskdbdiff.py +++ b/test/script/tskdbdiff.py @@ -464,6 +464,16 @@ def normalize_db_entry(line, files_table, vs_parts_table, vs_info_table, fs_info # remove object ID if files_index: + + # Ignore TIFF size and hash if extracted from PDFs. + # See JIRA-6951 for more details. + # index: -1 = last element in the list, which is extension + # index: -3 = 3rd from the end, which is the parent path. + if fields_list[-1] == "'tif'" and fields_list[-3].endswith(".pdf/'"): + fields_list[15] = "'SIZE_IGNORED'" + fields_list[23] = "'MD5_IGNORED'" + fields_list[24] = "'SHA256_IGNORED'" + newLine = ('INSERT INTO "tsk_files" VALUES(' + ', '.join(fields_list[1:]) + ');') # Remove object ID from Unalloc file name newLine = re.sub('Unalloc_[0-9]+_', 'Unalloc_', newLine)