|
69 | 69 | import jenkins.util.xml.RestrictiveEntityResolver; |
70 | 70 | import net.sf.json.JSONArray; |
71 | 71 | import net.sf.json.JSONObject; |
72 | | -import org.acegisecurity.Authentication; |
73 | 72 | import org.apache.commons.fileupload.FileItem; |
74 | 73 | import org.apache.commons.fileupload.FileUploadException; |
75 | 74 | import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
|
156 | 155 |
|
157 | 156 | import static hudson.init.InitMilestone.*; |
158 | 157 | import static java.util.logging.Level.*; |
| 158 | +import org.springframework.security.core.Authentication; |
159 | 159 |
|
160 | 160 | /** |
161 | 161 | * Manages {@link PluginWrapper}s. |
@@ -884,7 +884,7 @@ public void dynamicLoad(File arc) throws IOException, InterruptedException, Rest |
884 | 884 | */ |
885 | 885 | @Restricted(NoExternalUse.class) |
886 | 886 | public void dynamicLoad(File arc, boolean removeExisting, @CheckForNull List<PluginWrapper> batch) throws IOException, InterruptedException, RestartRequiredException { |
887 | | - try (ACLContext context = ACL.as(ACL.SYSTEM)) { |
| 887 | + try (ACLContext context = ACL.as2(ACL.SYSTEM2)) { |
888 | 888 | LOGGER.log(FINE, "Attempting to dynamic load {0}", arc); |
889 | 889 | PluginWrapper p = null; |
890 | 890 | String sn; |
@@ -951,7 +951,7 @@ public void dynamicLoad(File arc, boolean removeExisting, @CheckForNull List<Plu |
951 | 951 |
|
952 | 952 | @Restricted(NoExternalUse.class) |
953 | 953 | public void start(List<PluginWrapper> plugins) throws Exception { |
954 | | - try (ACLContext context = ACL.as(ACL.SYSTEM)) { |
| 954 | + try (ACLContext context = ACL.as2(ACL.SYSTEM2)) { |
955 | 955 | Map<String, PluginWrapper> pluginsByName = plugins.stream().collect(Collectors.toMap(p -> p.getShortName(), p -> p)); |
956 | 956 |
|
957 | 957 | // recalculate dependencies of plugins optionally depending the newly deployed ones. |
@@ -1548,7 +1548,7 @@ private List<Future<UpdateCenter.UpdateCenterJob>> install(@NonNull Collection<S |
1548 | 1548 | installJobs.add(updateCenter.addJob(updateCenter.new CompleteBatchJob(batch, start, correlationId))); |
1549 | 1549 | } |
1550 | 1550 |
|
1551 | | - final Authentication currentAuth = Jenkins.getAuthentication(); |
| 1551 | + final Authentication currentAuth = Jenkins.getAuthentication2(); |
1552 | 1552 |
|
1553 | 1553 | if (!jenkins.getInstallState().isSetupComplete()) { |
1554 | 1554 | jenkins.setInstallState(InstallState.INITIAL_PLUGINS_INSTALLING); |
@@ -1578,7 +1578,7 @@ public void run() { |
1578 | 1578 | } |
1579 | 1579 | updateCenter.persistInstallStatus(); |
1580 | 1580 | if(!failures) { |
1581 | | - try (ACLContext acl = ACL.as(currentAuth)) { |
| 1581 | + try (ACLContext acl = ACL.as2(currentAuth)) { |
1582 | 1582 | InstallUtil.proceedToNextStateFrom(InstallState.INITIAL_PLUGINS_INSTALLING); |
1583 | 1583 | } |
1584 | 1584 | } |
|
0 commit comments