Skip to content

Commit 67ca3d5

Browse files
authored
Merge pull request #538 from jglick/convertDeprecatedApprovedClasspathEntriesThread
`convertDeprecatedApprovedClasspathEntriesThread` should be `transient`
2 parents 7ce679c + 85f1153 commit 67ca3d5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ String hashClasspathEntry(URL entry) throws IOException {
254254

255255
static final Hasher DEFAULT_HASHER = Hasher.SHA512;
256256

257-
private Thread convertDeprecatedApprovedClasspathEntriesThread = null;
257+
private transient Thread convertDeprecatedApprovedClasspathEntriesThread = null;
258258

259259
/** All scripts which are already approved, via {@link Hasher#hash(String, String)}. */
260260
private final TreeSet<String> approvedScriptHashes = new TreeSet<>();
@@ -1073,6 +1073,9 @@ public String getSpinnerIconClassName() {
10731073
}
10741074
}
10751075
LOG.info("Conversion done.");
1076+
synchronized (ScriptApproval.this) {
1077+
convertDeprecatedApprovedClasspathEntriesThread = null;
1078+
}
10761079
}, "Approved Classpaths rehasher");
10771080
convertDeprecatedApprovedClasspathEntriesThread.setDaemon(true);
10781081
convertDeprecatedApprovedClasspathEntriesThread.start();

0 commit comments

Comments
 (0)