Mercurial > hg > release > icedtea7-forest-2.6 > corba
changeset 1391:9bd2bec1df53
Merge jdk7u111-b00
author | andrew |
---|---|
date | Wed, 20 Jul 2016 05:26:13 +0100 |
parents | e890adec9885 (current diff) 36715cc02959 (diff) |
children | e5578d3bc593 |
files | .hgtags |
diffstat | 4 files changed, 58 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Wed Jul 20 04:00:41 2016 +0100 +++ b/.hgtags Wed Jul 20 05:26:13 2016 +0100 @@ -657,3 +657,4 @@ 9c164195bcc97da6c6567e6e6d55ea349f1c583d jdk7u101-b00 ca3e3c4c5a615deab554708211e21db1b9febcf4 icedtea-2.6.6 4e571f4f723b9bebca89b3ca0f1130f63e804b80 icedtea-2.6.7pre01 +c1def4cc27fb92914168a5f65658eba4a1754dfe jdk7u111-b00
--- a/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java Wed Jul 20 04:00:41 2016 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java Wed Jul 20 05:26:13 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,21 +34,13 @@ import java.security.Policy; import java.security.PrivilegedAction; import java.security.ProtectionDomain; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Map; -import java.util.List; -import java.util.ListIterator; -import java.util.Set; -import java.util.Map.Entry; -import java.util.Collection; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; import java.util.Iterator; import java.util.Enumeration; -import java.util.Properties; -import java.util.IdentityHashMap; import java.util.StringTokenizer; import java.util.NoSuchElementException; @@ -165,8 +157,18 @@ * Return default ValueHandler */ public static ValueHandler createValueHandler() { + ValueHandler vh; + try { + vh = AccessController.doPrivileged(new PrivilegedExceptionAction<ValueHandler>() { + public ValueHandler run() throws Exception { return Util.createValueHandler(); } + }); + } catch (PrivilegedActionException e) { + throw new InternalError(e.getMessage()); + } + return vh; + } /** * Returns true if it was accurately determined that the remote ORB is @@ -664,7 +666,16 @@ * ValueHandler. */ public static byte getMaxStreamFormatVersion() { - ValueHandler vh = Util.createValueHandler(); + ValueHandler vh; + try { + vh = AccessController.doPrivileged(new PrivilegedExceptionAction<ValueHandler>() { + public ValueHandler run() throws Exception { + return Util.createValueHandler(); + } + }); + } catch (PrivilegedActionException e) { + throw new InternalError(e.getMessage()); + } if (!(vh instanceof javax.rmi.CORBA.ValueHandlerMultiFormat)) return ORBConstants.STREAM_FORMAT_VERSION_1;
--- a/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties Wed Jul 20 04:00:41 2016 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties Wed Jul 20 05:26:13 2016 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -103,5 +103,5 @@ tnameserv.hs3=\u5C31\u7DD2\u3002 orbd.commfailure=\n\u56E0\u70BA ORBinitialPort \u5728\u4F7F\u7528\u4E2D\uFF0C\u6240\u4EE5\u7121\u6CD5\u555F\u52D5 ORBD\u3002 -orbd.internalexception=\n\u56E0\u70BA\u5167\u90E8\u767C\u751F\u7570\u5E38\uFF0C\u6240\u4EE5\u7121\u6CD5\u555F\u52D5 ORBD\u3002 \n\u53EF\u80FD\u7684\u539F\u56E0: \n1. \u6307\u5B9A\u7684 ORBInitialPort \u6216 ORBActivationPort \u5728\u4F7F\u7528\u4E2D\u3002 \n2. \u6C92\u6709\u5BEB\u5165 orb.db \u7684\u6B0A\u9650\u3002 +orbd.internalexception=\n\u56E0\u70BA\u5167\u90E8\u767C\u751F\u7570\u5E38\uFF0C\u6240\u4EE5\u7121\u6CD5\u555F\u52D5 ORBD\u3002\n\u53EF\u80FD\u7684\u539F\u56E0: \n1. \u6307\u5B9A\u7684 ORBInitialPort \u6216 ORBActivationPort \u5728\u4F7F\u7528\u4E2D\u3002\n2. \u6C92\u6709\u5BEB\u5165 orb.db \u7684\u6B0A\u9650\u3002
--- a/src/share/classes/javax/rmi/CORBA/Util.java Wed Jul 20 04:00:41 2016 +0100 +++ b/src/share/classes/javax/rmi/CORBA/Util.java Wed Jul 20 05:26:13 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,7 @@ import java.rmi.Remote; import java.io.File; import java.io.FileInputStream; +import java.io.SerializablePermission; import java.net.MalformedURLException ; import java.security.AccessController; import java.security.PrivilegedAction; @@ -63,8 +64,22 @@ private static final javax.rmi.CORBA.UtilDelegate utilDelegate; private static final String UtilClassKey = "javax.rmi.CORBA.UtilClass"; + private static final String ALLOW_CREATEVALUEHANDLER_PROP = "jdk.rmi.CORBA.allowCustomValueHandler"; + private static boolean allowCustomValueHandler; + static { utilDelegate = (javax.rmi.CORBA.UtilDelegate)createDelegate(UtilClassKey); + allowCustomValueHandler = readAllowCustomValueHandlerProperty(); + } + + private static boolean readAllowCustomValueHandlerProperty () { + return AccessController + .doPrivileged(new PrivilegedAction<Boolean>() { + @Override + public Boolean run() { + return Boolean.getBoolean(ALLOW_CREATEVALUEHANDLER_PROP); + } + }); } private Util(){} @@ -111,7 +126,7 @@ * Writes a java.lang.Object as a CORBA Object. If <code>obj</code> is * an exported RMI-IIOP server object, the tie is found * and wired to <code>obj</code>, then written to -<code>out.write_Object(org.omg.CORBA.Object)</code>. + * <code>out.write_Object(org.omg.CORBA.Object)</code>. * If <code>obj</code> is a CORBA Object, it is written to * <code>out.write_Object(org.omg.CORBA.Object)</code>. * @param out the stream in which to write the object. @@ -196,6 +211,8 @@ */ public static ValueHandler createValueHandler() { + isCustomSerializationPermitted(); + if (utilDelegate != null) { return utilDelegate.createValueHandler(); } @@ -336,6 +353,7 @@ // security reasons. If you know a better solution how to share this code // then remove it from PortableRemoteObject. Also in Stub.java private static Object createDelegate(String classKey) { + String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -388,4 +406,16 @@ new GetORBPropertiesFileAction()); } + private static void isCustomSerializationPermitted() { + SecurityManager sm = System.getSecurityManager(); + if (!allowCustomValueHandler) { + if ( sm != null) { + // check that a serialization permission has been + // set to allow the loading of the Util delegate + // which provides access to custom ValueHandler + sm.checkPermission(new SerializablePermission( + "enableCustomValueHandler")); + } + } + } }