Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
JENKINS-44245 / SECURITY-366 make sure script is allowed to be run in…
… a builder
  • Loading branch information
imod committed May 12, 2017
1 parent 5308c27 commit d1986c8
Showing 1 changed file with 5 additions and 7 deletions.
@@ -1,16 +1,11 @@
/**
*
*
*/
package org.jenkinsci.plugins.scriptler.builder;

import hudson.Extension;
import hudson.Launcher;
import hudson.model.BuildListener;
import hudson.model.ParameterValue;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.ParametersAction;
import hudson.model.Project;
import hudson.model.*;
import hudson.security.Permission;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;
Expand Down Expand Up @@ -88,6 +83,9 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
final Script script = ScriptHelper.getScript(scriptId, true);

if (script != null) {
if (!script.nonAdministerUsing) {
throw new Failure(script.getName() + " [" + script.getId() + "] is not allowed to be executed in a build, check its configuration!");
}
try {

// expand the parameters before passing these to the execution, this is to allow any token macro to resolve parameter values
Expand Down

0 comments on commit d1986c8

Please sign in to comment.