From e2a4f07e140ce340bdbff4ca93e51c7c71de2fa3 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Tue, 16 Feb 2021 15:12:41 -0500 Subject: [PATCH 1/3] is port available update --- .../autopsy/keywordsearch/Server.java | 55 +------------------ 1 file changed, 2 insertions(+), 53 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java index 61b6b9e5e0..7c11d326cc 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java @@ -770,61 +770,10 @@ public class Server { /** * Checks to see if a specific port is available. * - * @param port the port to check for availability + * @param port The port to check for availability. + * @return True if the port is available and false if not. */ static boolean isPortAvailable(int port) { - final String osName = PlatformUtil.getOSName().toLowerCase(); - if (osName != null && osName.toLowerCase().startsWith("mac")) { - return isPortAvailableOSX(port); - } else { - return isPortAvailableDefault(port); - } - } - - /** - * Checks to see if a specific port is available. - * - * NOTE: This is used on non-OS X systems as of right now but could be - * replaced with the OS X version. - * - * @param port the port to check for availability - */ - static boolean isPortAvailableDefault(int port) { - ServerSocket ss = null; - try { - - ss = new ServerSocket(port, 0, java.net.Inet4Address.getByName("localhost")); //NON-NLS - if (ss.isBound()) { - ss.setReuseAddress(true); - ss.close(); - return true; - } - - } catch (IOException e) { - } finally { - if (ss != null) { - try { - ss.close(); - } catch (IOException e) { - /* - * should not be thrown - */ - } - } - } - return false; - } - - /** - * Checks to see if a specific port is available. - * - * NOTE: This is only used on OSX for now, but could replace default - * implementation in the future. - * - * @param port The port to check for availability. - * @throws IllegalArgumentException If port is outside range of possible ports. - */ - static boolean isPortAvailableOSX(int port) { // implementation taken from https://stackoverflow.com/a/435579 if (port < 1 || port > 65535) { throw new IllegalArgumentException("Invalid start port: " + port); From 3168c6b3174c38350f747806d96ba2b1e8bf8185 Mon Sep 17 00:00:00 2001 From: Raman Arora Date: Fri, 19 Feb 2021 17:37:46 -0500 Subject: [PATCH 2/3] 4138: - HostManager returns a list instead of a set. --- Core/src/org/sleuthkit/autopsy/datamodel/HostNode.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/HostNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/HostNode.java index bcf7415d65..64c8688a36 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/HostNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/HostNode.java @@ -22,7 +22,6 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.EnumSet; import java.util.List; -import java.util.Set; import java.util.function.Function; import java.util.logging.Level; import org.openide.nodes.ChildFactory; @@ -97,7 +96,7 @@ public class HostNode extends DisplayableItemNode { @Override protected boolean createKeys(List toPopulate) { - Set dataSources = null; + List dataSources = null; try { dataSources = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().getDataSourcesForHost(host); } catch (NoCurrentCaseException | TskCoreException ex) { From 21b8efdc8941fa1bf751afa64370aa19f719d0ba Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Mon, 22 Feb 2021 10:14:56 -0500 Subject: [PATCH 3/3] show multi or single in diff filename --- test/script/regression.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/script/regression.py b/test/script/regression.py index 097e4a099d..e217ef8694 100644 --- a/test/script/regression.py +++ b/test/script/regression.py @@ -344,10 +344,13 @@ class TestRunner(object): """ copied = False + # string for whether or it is single user or multi user for diff + mu_su_str = "multi" if test_data.isMultiUser else "single" + for file in glob.glob(test_data.output_path + "/*-Diff.txt"): # Eg. copies HTML-Report-Diff.txt to -HTML-Report-Diff.txt shutil.copy(file, test_data.main_config.args.diff_files_output_folder + - "/" + test_data.image + "-" + os.path.basename(file)) + "/" + test_data.image + "-" + mus_su_str + "-" + os.path.basename(file)) copied = True if not copied: print_report([], "NO DIFF FILES COPIED FROM " + test_data.output_path, "")