From f20bb479d3ab4129335b133a6d99c7f7150de1a0 Mon Sep 17 00:00:00 2001 From: "eugene.livis" Date: Wed, 3 Aug 2022 10:53:33 -0400 Subject: [PATCH 1/2] bug fix --- .../commandlineingest/CommandLineIngestManager.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java index 39aea28933..37b13845a4 100755 --- a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java @@ -260,10 +260,9 @@ public class CommandLineIngestManager extends CommandLineManager { // run ingest String ingestProfile = inputs.get(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name()); analyze(dataSource, ingestProfile); - } catch (InterruptedException | CaseActionException ex) { - String dataSourcePath = command.getInputs().get(CommandLineCommand.InputType.DATA_SOURCE_PATH.name()); - LOGGER.log(Level.SEVERE, "Error running ingest on data source " + dataSourcePath, ex); - System.out.println("Error running ingest on data source " + dataSourcePath); + } catch (InterruptedException | CaseActionException | AnalysisStartupException ex) { + LOGGER.log(Level.SEVERE, "Error running ingest on data source " + dataSource.getPath(), ex); + System.out.println("Error running ingest on data source " + dataSource.getPath()); // Do not process any other commands errorCode = CL_RUN_FAILURE; return; @@ -520,7 +519,7 @@ public class CommandLineIngestManager extends CommandLineManager { // unable to find the user specified profile LOGGER.log(Level.SEVERE, "Unable to find ingest profile: {0}. Ingest cancelled!", ingestProfileName); System.out.println("Unable to find ingest profile: " + ingestProfileName + ". Ingest cancelled!"); - return; + throw new AnalysisStartupException("Unable to find ingest profile: " + ingestProfileName + ". Ingest cancelled!"); } // get FileSet filter associated with this profile @@ -529,7 +528,7 @@ public class CommandLineIngestManager extends CommandLineManager { // unable to find the user specified profile LOGGER.log(Level.SEVERE, "Unable to find file filter {0} for ingest profile: {1}. Ingest cancelled!", new Object[]{selectedProfile.getFileIngestFilter(), ingestProfileName}); System.out.println("Unable to find file filter " + selectedProfile.getFileIngestFilter() + " for ingest profile: " + ingestProfileName + ". Ingest cancelled!"); - return; + throw new AnalysisStartupException("Unable to find file filter " + selectedProfile.getFileIngestFilter() + " for ingest profile: " + ingestProfileName + ". Ingest cancelled!"); } } From 923c9620f93c2c4474dd78b66ab02dfae1883cb9 Mon Sep 17 00:00:00 2001 From: "eugene.livis" Date: Wed, 3 Aug 2022 13:46:43 -0400 Subject: [PATCH 2/2] Potential bug fix --- .../autopsy/commandlineingest/CommandLineIngestManager.java | 5 +++-- .../commandlineingest/CommandLineOptionProcessor.java | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java index 37b13845a4..37edf58aa4 100755 --- a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java @@ -261,8 +261,9 @@ public class CommandLineIngestManager extends CommandLineManager { String ingestProfile = inputs.get(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name()); analyze(dataSource, ingestProfile); } catch (InterruptedException | CaseActionException | AnalysisStartupException ex) { - LOGGER.log(Level.SEVERE, "Error running ingest on data source " + dataSource.getPath(), ex); - System.out.println("Error running ingest on data source " + dataSource.getPath()); + String dataSourcePath = command.getInputs().get(CommandLineCommand.InputType.DATA_SOURCE_PATH.name()); + LOGGER.log(Level.SEVERE, "Error running ingest on data source " + dataSourcePath, ex); + System.out.println("Error running ingest on data source " + dataSourcePath); // Do not process any other commands errorCode = CL_RUN_FAILURE; return; diff --git a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineOptionProcessor.java b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineOptionProcessor.java index 0bb42295a0..921c2e0a65 100755 --- a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineOptionProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineOptionProcessor.java @@ -271,6 +271,7 @@ public class CommandLineOptionProcessor extends OptionProcessor { newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir); newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_ID.name(), dataSourceId); newCommand.addInputValue(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name(), ingestProfile); + newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_PATH.name(), dataSourcePath); commands.add(newCommand); runFromCommandLine(true); }