Skip to content

Commit

Permalink
[JENKINS-25348]
Browse files Browse the repository at this point in the history
Use the new wrapper classloader to ensure groovy-sandbox resolves
correctly.

Originally-Committed-As: ed56f117ca80b1b79cef01de80360d99f613990e
  • Loading branch information
kohsuke committed Nov 15, 2014
1 parent c4f2aa3 commit eb41988
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -11,6 +11,7 @@
import org.codehaus.groovy.control.CompilationFailedException;
import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.control.customizers.ImportCustomizer;
import org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox;

import javax.annotation.Nullable;
import java.io.IOException;
Expand Down Expand Up @@ -39,7 +40,8 @@ class CpsGroovyShell extends GroovyShell {

private static ClassLoader makeClassLoader() {
Jenkins j = Jenkins.getInstance();
return j!=null ? j.getPluginManager().uberClassLoader : CpsGroovyShell.class.getClassLoader();
ClassLoader cl = j != null ? j.getPluginManager().uberClassLoader : CpsGroovyShell.class.getClassLoader();
return GroovySandbox.createSecureClassLoader(cl);
}

private static CompilerConfiguration makeConfig(CpsFlowExecution execution) {
Expand Down

0 comments on commit eb41988

Please sign in to comment.