diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-09-30 23:15:18 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-01 00:56:17 +0200 |
commit | 3fb51feb1c0a5b62dc55c76d0037564f42366226 (patch) | |
tree | ec50c64ce20b45b2d20c8d84d94950fbc121d2cd /jurt | |
parent | e669d631a746d9f2cb9dc6da707a7ed73bd9401a (diff) |
[API CHANGE] Remove unused CPLD_ACCESS feature from C++/Java component loaders
...introduced in 2000 with 38974aeef6dfaa1c625cf5498ec553489dd08c87 "added
library loading limitation by using env variable CPLD_ACCESSPATH=path1;path2;
etc." and 9be3c618e0b1d2b2635bd7b134693ed5ff3021bc "#80090# restrict jar file
access to java system property com.sun.star.comp.loader.CPLD_ACCESSPATH" but
already in 2004 considered "a hack [that] seems to be unused nowadays" in
1d3164df959b31ba9f50ddc108569f3adec32ff7 "CWS sb20: #i29119# Replaced
sandbox.jar-based class loader with an own one."
Change-Id: I637afd5daeb4ca097edd17f834c81af892dcfc6a
Diffstat (limited to 'jurt')
-rw-r--r-- | jurt/com/sun/star/comp/loader/RegistrationClassFinder.java | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/jurt/com/sun/star/comp/loader/RegistrationClassFinder.java b/jurt/com/sun/star/comp/loader/RegistrationClassFinder.java index aef672457332..835131679cd0 100644 --- a/jurt/com/sun/star/comp/loader/RegistrationClassFinder.java +++ b/jurt/com/sun/star/comp/loader/RegistrationClassFinder.java @@ -20,11 +20,9 @@ package com.sun.star.comp.loader; import com.sun.star.lib.unoloader.UnoClassLoader; import com.sun.star.lib.util.WeakMap; -import java.io.File; import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; -import java.util.StringTokenizer; import java.util.jar.Attributes; final class RegistrationClassFinder { @@ -38,7 +36,6 @@ final class RegistrationClassFinder { } } URL url = new URL(locationUrl); - checkAccess(url); Attributes attr = UnoClassLoader.getJarMainAttributes(url); String name = attr == null ? null : attr.getValue("RegistrationClassName"); @@ -65,60 +62,5 @@ final class RegistrationClassFinder { private RegistrationClassFinder() {} // do not instantiate - private static void checkAccess(URL url) throws ClassNotFoundException { - // The system property com.sun.star.comp.loader.CPLD_ACCESSPATH was - // introduced as a hack to restrict which UNO components can be - // instantiated. It seems to be unused nowadays, and should probably be - // replaced by the native Java security features, anyway. - if (accessPath != null) { - if (!url.getProtocol().equals("file")) { - throw new ClassNotFoundException( - "Access restriction: <" + url + "> is not a file URL"); - } - String p; - try { - p = new File(url.getFile()).getCanonicalPath(); - } catch (IOException e) { - throw new ClassNotFoundException( - "Access restriction: <" + url + "> is bad: " + e); - } - for (int i = 0; i < accessPath.length; ++i) { - String p2 = accessPath[i]; - if (p.startsWith(p2) && p.length() > p2.length() - && (p2.charAt(p2.length() - 1) == File.separatorChar - || p.charAt(p2.length()) == File.separatorChar)) - { - return; - } - } - throw new ClassNotFoundException( - "Access restriction: <" + url + "> is restricted"); - } - } - private static final WeakMap map = new WeakMap(); - - private static final String[] accessPath; - static { - String[] ap = null; - String p = System.getProperty( - "com.sun.star.comp.loader.CPLD_ACCESSPATH"); - if (p != null) { - StringTokenizer t = new StringTokenizer(p, ";"); - ap = new String[t.countTokens()]; - int i = 0; - while (t.hasMoreTokens()) { - try { - ap[i] = new File(t.nextToken()).getCanonicalPath(); - ++i; - } catch (IOException e) {} - } - if (i != ap.length) { - String[] ap2 = new String[i]; - System.arraycopy(ap, 0, ap2, 0, i); - ap = ap2; - } - } - accessPath = ap; - } } |