From 5f338723b6754a1273203d50c9ad62d116960a16 Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Fri, 3 Jan 2025 13:19:43 -0500 Subject: [PATCH] GP-5161 Corrected Ghidra Server CME, document updates, and launch script improvements to control Java home determination. --- .../server/remote/RepositoryHandleImpl.java | 21 +- .../Common/server/svrREADME.html | 69 ++++-- Ghidra/RuntimeScripts/Linux/server/ghidraSvr | 213 ++++++++++-------- Ghidra/RuntimeScripts/Linux/support/launch.sh | 92 ++++---- .../Windows/server/ghidraSvr.bat | 96 +++++--- .../RuntimeScripts/Windows/support/launch.bat | 62 +++-- .../src/main/java/LaunchSupport.java | 91 ++++++-- .../java/ghidra/launch/LaunchProperties.java | 15 +- GhidraDocs/InstallationGuide.md | 34 +-- 9 files changed, 444 insertions(+), 249 deletions(-) diff --git a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/RepositoryHandleImpl.java b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/RepositoryHandleImpl.java index 0bbbae1f1a..8a81debdab 100644 --- a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/RepositoryHandleImpl.java +++ b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/RepositoryHandleImpl.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,8 +21,7 @@ import java.rmi.NoSuchObjectException; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import java.rmi.server.Unreferenced; -import java.util.HashMap; -import java.util.LinkedList; +import java.util.*; import db.buffers.*; import ghidra.framework.remote.*; @@ -118,7 +117,9 @@ public class RepositoryHandleImpl extends UnicastRemoteObject try { repository.log(null, "Clearning " + transientCheckouts.size() + " transiet checkouts", currentUser); - for (String pathname : transientCheckouts.keySet()) { + + ArrayList pathnames = new ArrayList<>(transientCheckouts.keySet()); + for (String pathname : pathnames) { int index = pathname.lastIndexOf(FileSystem.SEPARATOR_CHAR); String parentPath = FileSystem.SEPARATOR; if (index != 0) { @@ -127,10 +128,12 @@ public class RepositoryHandleImpl extends UnicastRemoteObject String itemName = pathname.substring(index + 1); ItemCheckoutStatus transientCheckout = transientCheckouts.get(pathname); - - // Since dropped transient checkouts could occur in large volume due to headless - // processing, don't bother sending notification - terminateCheckout(parentPath, itemName, transientCheckout.getCheckoutId(), false); + if (transientCheckout != null) { + // Since dropped transient checkouts could occur in large volume due to headless + // processing, don't bother sending notification + terminateCheckout(parentPath, itemName, transientCheckout.getCheckoutId(), + false); + } } } catch (IOException e) { diff --git a/Ghidra/RuntimeScripts/Common/server/svrREADME.html b/Ghidra/RuntimeScripts/Common/server/svrREADME.html index d7c6dd8487..e8a2e0e19b 100644 --- a/Ghidra/RuntimeScripts/Common/server/svrREADME.html +++ b/Ghidra/RuntimeScripts/Common/server/svrREADME.html @@ -60,6 +60,7 @@ typewriter {