Skip to content
Permalink
Browse files

Merge pull request #52 from tknerr/whitelist-keeplog-property

Whitelist the isKeepLog and setKeepLog properties (JENKINS-49014)
  • Loading branch information
abayer committed Feb 20, 2018
2 parents d1e2e2b + aa19411 commit 385508e128fcc1ae2d10d99b7b089510012ec639
Showing with 16 additions and 1 deletion.
  1. +16 −1 src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.java
@@ -107,6 +107,16 @@ public void setDisplayName(String n) throws IOException {
build().setDisplayName(n);
}
}

@Whitelisted
public void setKeepLog(boolean b) throws IOException {
if (!currentBuild) {
throw new SecurityException("can only set the keepLog property on the current build");
}
try (ACLContext ctx = ACL.as(ACL.SYSTEM)) {
build().keepLog(b);
}
}

@Whitelisted
public int getNumber() throws AbortException {
@@ -179,7 +189,12 @@ public String getDisplayName() throws AbortException {
public String getFullDisplayName() throws AbortException {
return build().getFullDisplayName();
}


@Whitelisted
public boolean isKeepLog() throws AbortException {
return build().isKeepLog();
}

@Whitelisted
public String getProjectName() throws AbortException {
return build().getParent().getName();

0 comments on commit 385508e

Please sign in to comment.
You can’t perform that action at this time.