Skip to content

Commit

Permalink
[JENKINS-19081] Be a bit paranoid and ensure the admin has CONFIGURE_…
Browse files Browse the repository at this point in the history
…UPDATECENTER before turning off signature checks.

(cherry picked from commit 1262d88)
  • Loading branch information
jglick authored and olivergondza committed Apr 13, 2014
1 parent d842aa4 commit 09af03a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/main/java/jenkins/security/DownloadSettings.java
Expand Up @@ -25,6 +25,7 @@
package jenkins.security;

import hudson.Extension;
import hudson.PluginManager;
import hudson.model.AsyncPeriodicWork;
import hudson.model.DownloadService;
import hudson.model.TaskListener;
Expand Down Expand Up @@ -84,6 +85,11 @@ public boolean isCheckSignature() {
}

public void setCheckSignature(boolean checkSignature) {
if (!checkSignature) {
// Just to be on the safe side. Normally this is implied by ADMINISTER, needed to configure the security screen anyway,
// but in case ADMINISTER but not CONFIGURE_UPDATECENTER is somehow granted, make sure signature checking cannot be disabled.
Jenkins.getInstance().checkPermission(PluginManager.CONFIGURE_UPDATECENTER);
}
this.checkSignature = checkSignature;
save();
}
Expand Down

0 comments on commit 09af03a

Please sign in to comment.