Skip to content

Commit

Permalink
[SECURITY-1101]
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergondza authored and daniel-beck committed Sep 12, 2018
1 parent de016a5 commit 091ee0d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/hudson/tasks/junit/JUnitResultArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.Descriptor;
import hudson.model.Item;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.Saveable;
Expand Down Expand Up @@ -310,7 +311,7 @@ public String getDisplayName() {
public FormValidation doCheckTestResults(
@AncestorInPath AbstractProject project,
@QueryParameter String value) throws IOException {
if (project == null) {
if (project == null || !project.hasPermission(Item.WORKSPACE)) {
return FormValidation.ok();
}
return FilePath.validateFileMask(project.getSomeWorkspace(), value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ public AggregatedTestResultPublisher newInstance(StaplerRequest req, JSONObject
}

public AutoCompletionCandidates doAutoCompleteJobs(@QueryParameter String value, @AncestorInPath Item self, @AncestorInPath ItemGroup container) {
// Item.READ checked inside
return AutoCompletionCandidates.ofJobNames(Job.class,value,self,container);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/tasks/test/TestObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.kohsuke.stapler.export.ExportedBean;

import com.google.common.collect.MapMaker;
import org.kohsuke.stapler.interceptor.RequirePOST;

import javax.servlet.ServletException;
import java.io.IOException;
Expand Down Expand Up @@ -450,13 +451,14 @@ public Object getDynamic(String token, StaplerRequest req,
return null;
}

@RequirePOST
public synchronized HttpResponse doSubmitDescription(
@QueryParameter String description) throws IOException,
ServletException {
getRun().checkPermission(Run.UPDATE);
if (getRun() == null) {
LOGGER.severe("getRun() is null, can't save description.");
} else {
getRun().checkPermission(Run.UPDATE);
setDescription(description);
getRun().save();
}
Expand Down

0 comments on commit 091ee0d

Please sign in to comment.