From 6c1f99ed935b908959bcf1b2abc7f6489036fa17 Mon Sep 17 00:00:00 2001 From: Mark McKinnon Date: Tue, 20 Jul 2021 11:33:07 -0400 Subject: [PATCH] Update ExtractJumpLists.java Added datasource id instead of name per reviewer comments. Noticed if multiple users on the system then will have naming conflicts so added file id to name of files so conflicts will not happen --- .../autopsy/recentactivity/ExtractJumpLists.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractJumpLists.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractJumpLists.java index 23f5d08a3d..5e209090a6 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractJumpLists.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractJumpLists.java @@ -94,13 +94,13 @@ final class ExtractJumpLists extends Extract { List derivedFiles = new ArrayList<>(); String derivedPath = null; - String baseRaTempPath = RAImageIngestModule.getRATempPath(Case.getCurrentCase(), dataSource.getName() + "-" + JUMPLIST_DIR_NAME, ingestJobId); + String baseRaTempPath = RAImageIngestModule.getRATempPath(Case.getCurrentCase(), JUMPLIST_DIR_NAME + "_" + dataSource.getId(), ingestJobId); for (AbstractFile jumplistFile : jumpListFiles) { if (!jumplistFile.getName().toLowerCase().contains("-slack") && !jumplistFile.getName().equals("..") && !jumplistFile.getName().equals(".") && jumplistFile.getSize() > 0) { - String jlFile = Paths.get(baseRaTempPath, jumplistFile.getName()).toString(); - String moduleOutPath = Case.getCurrentCase().getModuleDirectory() + File.separator + RA_DIR_NAME + File.separator + JUMPLIST_DIR_NAME + File.separator + jumplistFile.getName(); - derivedPath = RA_DIR_NAME + File.separator + JUMPLIST_DIR_NAME + File.separator + jumplistFile.getName(); + String jlFile = Paths.get(baseRaTempPath, jumplistFile.getName() + "_" + jumplistFile.getId()).toString(); + String moduleOutPath = Case.getCurrentCase().getModuleDirectory() + File.separator + RA_DIR_NAME + File.separator + JUMPLIST_DIR_NAME + "_" + dataSource.getId() + File.separator + jumplistFile.getName() + "_" + jumplistFile.getId(); + derivedPath = RA_DIR_NAME + File.separator + JUMPLIST_DIR_NAME + "_" + dataSource.getId() + File.separator + jumplistFile.getName() + "_" + jumplistFile.getId(); File jlDir = new File(moduleOutPath); if (jlDir.exists() == false) { boolean dirMade = jlDir.mkdirs(); @@ -149,8 +149,8 @@ final class ExtractJumpLists extends Extract { if (!jumpListFile.getName().toLowerCase().contains("-slack") && !jumpListFile.getName().equals("..") && !jumpListFile.getName().equals(".") && jumpListFile.getSize() > 0) { - String fileName = jumpListFile.getName(); - String baseRaTempPath = RAImageIngestModule.getRATempPath(Case.getCurrentCase(), dataSource.getName() + "-" + JUMPLIST_DIR_NAME, ingestJobId); + String fileName = jumpListFile.getName() + "_" + jumpListFile.getId(); + String baseRaTempPath = RAImageIngestModule.getRATempPath(Case.getCurrentCase(), JUMPLIST_DIR_NAME+ "_" + dataSource.getId(), ingestJobId); String jlFile = Paths.get(baseRaTempPath, fileName).toString(); try { ContentUtils.writeToFile(jumpListFile, new File(jlFile)); @@ -212,7 +212,7 @@ final class ExtractJumpLists extends Extract { derivedFiles.add(derivedFile); } catch (IOException | JLnkParserException e) { - logger.log(Level.WARNING, String.format("No such document, or the Entry represented by documentName is not a DocumentEntry link file is %s", lnkFileName), e); //NON-NLS + logger.log(Level.WARNING, String.format("No such document, or the Entry represented by documentName is not a DocumentEntry link file is %s", jumpListFile), e); //NON-NLS } } } else {