Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-0 corrected missing userSettingsDir for GhidraServerApplicationLayout

ghidra1f96ae4bb3750
diff --git a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java
index 2a92791fa7..0938aec291 100644
--- a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java
+++ b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java
@@ -408,7 +408,7 @@ public class GhidraServer extends UnicastRemoteObject implements GhidraServerHan
/**
* Display an optional message followed by usage syntax.
*
- * @param msg
+ * @param msg optional message (may be null)
*/
private static void displayUsage(String msg) {
if (msg != null) {
@@ -498,7 +498,7 @@ public class GhidraServer extends UnicastRemoteObject implements GhidraServerHan
ResourceFile serverRoot = new ResourceFile(Application.getInstallationDirectory(),
SystemUtilities.isInDevelopmentMode() ? "ghidra/Ghidra/RuntimeScripts/Common/server"
: "server");
- if (serverRoot == null || serverRoot.getFile(false) == null) {
+ if (serverRoot.getFile(false) == null) {
System.err.println(
"Failed to resolve installation root directory!: " + serverRoot.getAbsolutePath());
System.exit(-1);
diff --git a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServerApplicationLayout.java b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServerApplicationLayout.java
index 8f0f1a3ebd..45f4594fc4 100644
--- a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServerApplicationLayout.java
+++ b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServerApplicationLayout.java
@@ -57,6 +57,8 @@ public class GhidraServerApplicationLayout extends ApplicationLayout {
// User directories (don't let anything use the user home directory...there may not be one)
userTempDir = ApplicationUtilities.getDefaultUserTempDir(applicationProperties);
+ userSettingsDir = ApplicationUtilities.getDefaultUserSettingsDir(applicationProperties,
+ applicationInstallationDir);
// Modules - required to find module data files
modules = ModuleUtilities.findModules(applicationRootDirs,