Skip to content

Commit

Permalink
Revert "[JENKINS-46754] Revert "Upgrade Remoting to 3.11 (#2988)""
Browse files Browse the repository at this point in the history
This reverts commit f6ef882.
  • Loading branch information
jglick committed Sep 13, 2017
1 parent 6195e58 commit f9ad963
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
6 changes: 6 additions & 0 deletions core/src/main/java/hudson/slaves/SlaveComputer.java
Expand Up @@ -454,6 +454,9 @@ static class LoadingCount extends MasterToSlaveCallable<Integer,RuntimeException
}
@Override public Integer call() {
Channel c = Channel.current();
if (c == null) {
return -1;
}
return resource ? c.resourceLoadingCount.get() : c.classLoadingCount.get();
}
}
Expand All @@ -471,6 +474,9 @@ static class LoadingTime extends MasterToSlaveCallable<Long,RuntimeException> {
}
@Override public Long call() {
Channel c = Channel.current();
if (c == null) {
return Long.valueOf(-1);
}
return resource ? c.resourceLoadingTime.get() : c.classLoadingTime.get();
}
}
Expand Down
25 changes: 4 additions & 21 deletions core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -251,7 +251,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Field;
import java.net.BindException;
import java.net.HttpURLConnection;
import java.net.URL;
Expand Down Expand Up @@ -903,26 +902,10 @@ protected Jenkins(File root, ServletContext context, PluginManager pluginManager

adjuncts = new AdjunctManager(servletContext, pluginManager.uberClassLoader,"adjuncts/"+SESSION_HASH, TimeUnit2.DAYS.toMillis(365));

// TODO pending move to standard blacklist, or API to append filter
if (System.getProperty(ClassFilter.FILE_OVERRIDE_LOCATION_PROPERTY) == null) { // not using SystemProperties since ClassFilter does not either
try {
Field blacklistPatternsF = ClassFilter.DEFAULT.getClass().getDeclaredField("blacklistPatterns");
blacklistPatternsF.setAccessible(true);
Object[] blacklistPatternsA = (Object[]) blacklistPatternsF.get(ClassFilter.DEFAULT);
boolean found = false;
for (int i = 0; i < blacklistPatternsA.length; i++) {
if (blacklistPatternsA[i] instanceof Pattern) {
blacklistPatternsA[i] = Pattern.compile("(" + blacklistPatternsA[i] + ")|(java[.]security[.]SignedObject)");
found = true;
break;
}
}
if (!found) {
throw new Error("no Pattern found among " + Arrays.toString(blacklistPatternsA));
}
} catch (NoSuchFieldException | IllegalAccessException x) {
throw new Error("Unexpected ClassFilter implementation in bundled remoting.jar: " + x, x);
}
try {
ClassFilter.appendDefaultFilter(Pattern.compile("java[.]security[.]SignedObject")); // TODO move to standard blacklist
} catch (ClassFilter.ClassFilterException ex) {
throw new IOException("Remoting library rejected the java[.]security[.]SignedObject blacklist pattern", ex);
}

// initialization consists of ...
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -167,7 +167,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>remoting</artifactId>
<version>3.10</version>
<version>3.11</version>
</dependency>

<dependency>
Expand Down

0 comments on commit f9ad963

Please sign in to comment.