Skip to content

Commit

Permalink
Refuse to load the Jenkins test harness in production (#8714)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Nov 23, 2023
1 parent d490e43 commit f4fe571
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/hudson/ClassicPluginStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent, At

List<URL> urls = new ArrayList<>();
for (File path : paths) {
if (path.getName().startsWith("jenkins-test-harness")) {

Check warning on line 293 in core/src/main/java/hudson/ClassicPluginStrategy.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 293 is only partially covered, one branch is missing
throw new IllegalStateException("Refusing to load the Jenkins test harness in production (via "
+ atts.getValue("Short-Name") + ")");

Check warning on line 295 in core/src/main/java/hudson/ClassicPluginStrategy.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 294-295 are not covered by tests
}
urls.add(path.toURI().toURL());
}
URLClassLoader2 classLoader;
Expand Down

0 comments on commit f4fe571

Please sign in to comment.