From adf23ab2e40d325aaa3ffefcfea0076dd8530bae Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Thu, 27 Jan 2022 08:56:22 -0800 Subject: [PATCH] EOL support for JRuby (#6209) --- core/src/main/java/hudson/util/XStream2.java | 7 ------ .../jenkins/security/whitelisted-classes.txt | 24 ------------------- 2 files changed, 31 deletions(-) diff --git a/core/src/main/java/hudson/util/XStream2.java b/core/src/main/java/hudson/util/XStream2.java index 2ac02f6062..204fd0e39d 100644 --- a/core/src/main/java/hudson/util/XStream2.java +++ b/core/src/main/java/hudson/util/XStream2.java @@ -81,7 +81,6 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.regex.Pattern; import jenkins.model.Jenkins; import jenkins.util.xstream.SafeURLConverter; @@ -570,18 +569,12 @@ public class XStream2 extends XStream { throw new ConversionException("Refusing to unmarshal " + reader.getNodeName() + " for security reasons; see https://www.jenkins.io/redirect/class-filter/"); } - /** TODO see comment in {@code whitelisted-classes.txt} */ - private static final Pattern JRUBY_PROXY = Pattern.compile("org[.]jruby[.]proxy[.].+[$]Proxy\\d+"); - @Override public boolean canConvert(Class type) { if (type == null) { return false; } String name = type.getName(); - if (JRUBY_PROXY.matcher(name).matches()) { - return false; - } // claim we can convert all the scary stuff so we can throw exceptions when attempting to do so return ClassFilter.DEFAULT.isBlacklisted(name) || ClassFilter.DEFAULT.isBlacklisted(type); } diff --git a/core/src/main/resources/jenkins/security/whitelisted-classes.txt b/core/src/main/resources/jenkins/security/whitelisted-classes.txt index b7d4049406..fbcdc1a9de 100644 --- a/core/src/main/resources/jenkins/security/whitelisted-classes.txt +++ b/core/src/main/resources/jenkins/security/whitelisted-classes.txt @@ -135,34 +135,10 @@ org.apache.commons.fileupload.disk.DiskFileItem org.apache.commons.fileupload.util.FileItemHeadersImpl org.apache.tools.ant.Location -# TODO see main ruby-runtime section below -org.jenkinsci.jruby.JRubyMapper$DynamicProxy - # TODO remove when https://github.com/jenkinsci/xtrigger-lib/pull/9 is widely adopted in fstrigger-plugin, urltrigger-plugin, etc. org.jenkinsci.lib.xtrigger.XTriggerCause org.jenkinsci.lib.xtrigger.XTriggerCauseAction -# TODO remove (also XStream2.BlacklistedTypesConverter.JRUBY_PROXY) when Ruby Runtime is fixed -# Related PRs: -# - https://github.com/jenkinsci/ruby-runtime-plugin/pull/5, -# - https://github.com/jenkinsci/ruby-runtime-plugin/pull/6 -# -# oleg-nenashev in PR#6 we are trying to get help from last maintainers due to the plugin codebase splitbrain. -# It is required to fix JENKINS-50616 in a proper way for 2.107.x -org.jruby.RubyArray -org.jruby.RubyBignum -org.jruby.RubyBoolean -org.jruby.RubyBoolean$False -org.jruby.RubyBoolean$True -org.jruby.RubyFixnum -org.jruby.RubyHash -org.jruby.RubyNil -org.jruby.RubyObject -org.jruby.RubyString -org.jruby.RubySymbol -org.jruby.java.proxies.ConcreteJavaProxy -org.jruby.runtime.builtin.IRubyObject - org.jvnet.hudson.MemoryUsage org.jvnet.localizer.Localizable org.jvnet.localizer.ResourceBundleHolder