Skip to content

Commit c5bad0a

Browse files
committed
GP-4358: No longer using XDG_RUNTIME_DIR for temp directory. Ubuntu
defaults it to a too small tmpfs. (Closes NationalSecurityAgency#6233)
1 parent 2ce8463 commit c5bad0a

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

Ghidra/Framework/Utility/src/main/java/utility/application/AppCleaner.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ private Set<File> findTempDirs(String appName, ApplicationLayout layout) {
246246
getDirFromProperty(PROPERTY_TEMP_DIR, appName).ifPresent(discoveredDirs::add);
247247
getDirFromProperty(PROPERTY_TEMP_DIR, userNameAndAppName).ifPresent(discoveredDirs::add);
248248

249-
// XDG environment variable override
249+
// XDG environment variable override.
250+
// This was used briefly in the master branch and then removed, so some users might have
251+
// this artifact. We can eventually stop looking here.
250252
getDirFromEnv(XDG_RUNTIME_DIR, appName).ifPresent(discoveredDirs::add);
251253
getDirFromEnv(XDG_RUNTIME_DIR, userNameAndAppName).ifPresent(discoveredDirs::add);
252254

Ghidra/Framework/Utility/src/main/java/utility/application/ApplicationUtilities.java

-7
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,6 @@ public static File getDefaultUserTempDir(String applicationName)
176176
new File(tempOverrideDir, getUserSpecificDirName(tempOverrideDir, appName)));
177177
}
178178

179-
// Look for XDG environment variable
180-
File xdgRuntimeDir = getEnvFile(XdgUtils.XDG_RUNTIME_DIR, false);
181-
if (xdgRuntimeDir != null) {
182-
return createDir(
183-
new File(xdgRuntimeDir, getUserSpecificDirName(xdgRuntimeDir, appName)));
184-
}
185-
186179
File javaTmpDir = getJavaTmpDir();
187180
return createDir(new File(getJavaTmpDir(), getUserSpecificDirName(javaTmpDir, appName)));
188181
}

Ghidra/RuntimeScripts/Common/support/launch.properties

+1-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ VMARGS=-Xshare:off
116116
# directory lives outside of the user's home directory. The temporary directory will be selected
117117
# based on the following rules, in order of precedence:
118118
# 1. System.getProperty("application.tempdir")/[user-]<application>
119-
# 2. System.getenv("XDG_RUNTIME_DIR")/[user-]<application>
120-
# 3. System.getProperty("java.io.tmpdir")/[user-]<application>
119+
# 2. System.getProperty("java.io.tmpdir")/[user-]<application>
121120
# Unless overridden below, the "java.io.tmpdir" system property typically defaults to the following
122121
# platform specific locations:
123122
# - Windows: %TEMP%

0 commit comments

Comments
 (0)