mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8345502: Remove doIntersectionPrivilege methods
Reviewed-by: weijun
This commit is contained in:
parent
faa109e8d4
commit
de3a218a28
4 changed files with 1 additions and 93 deletions
|
@ -43,7 +43,7 @@ import sun.security.jca.GetInstance;
|
||||||
* supported. Installing a system-wide {@code Policy} object is no longer
|
* supported. Installing a system-wide {@code Policy} object is no longer
|
||||||
* supported. The {@linkplain #setPolicy setPolicy} method has been
|
* supported. The {@linkplain #setPolicy setPolicy} method has been
|
||||||
* changed to always throw {@code UnsupportedOperationException}. The
|
* changed to always throw {@code UnsupportedOperationException}. The
|
||||||
* {@linkplain getPolicy getPolicy} method has been changed to always
|
* {@linkplain #getPolicy getPolicy} method has been changed to always
|
||||||
* return a {@code Policy} object that grants no permissions. There is no
|
* return a {@code Policy} object that grants no permissions. There is no
|
||||||
* replacement for the Security Manager or this class.
|
* replacement for the Security Manager or this class.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
|
|
||||||
package java.security;
|
package java.security;
|
||||||
|
|
||||||
import jdk.internal.access.JavaSecurityAccess;
|
|
||||||
import jdk.internal.access.SharedSecrets;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@code ProtectionDomain} class encapsulates the characteristics of a
|
* The {@code ProtectionDomain} class encapsulates the characteristics of a
|
||||||
* domain, which encloses a set of classes whose instances are granted a set
|
* domain, which encloses a set of classes whose instances are granted a set
|
||||||
|
@ -51,39 +48,6 @@ import jdk.internal.access.SharedSecrets;
|
||||||
|
|
||||||
public class ProtectionDomain {
|
public class ProtectionDomain {
|
||||||
|
|
||||||
private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
|
|
||||||
|
|
||||||
private JavaSecurityAccessImpl() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("removal")
|
|
||||||
@Override
|
|
||||||
public <T> T doIntersectionPrivilege(
|
|
||||||
PrivilegedAction<T> action,
|
|
||||||
final AccessControlContext stack,
|
|
||||||
final AccessControlContext context) {
|
|
||||||
if (action == null) {
|
|
||||||
throw new NullPointerException();
|
|
||||||
}
|
|
||||||
|
|
||||||
return AccessController.doPrivileged(action);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("removal")
|
|
||||||
@Override
|
|
||||||
public <T> T doIntersectionPrivilege(
|
|
||||||
PrivilegedAction<T> action,
|
|
||||||
AccessControlContext context) {
|
|
||||||
return doIntersectionPrivilege(action,
|
|
||||||
AccessController.getContext(), context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static {
|
|
||||||
// Set up JavaSecurityAccess in SharedSecrets
|
|
||||||
SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* CodeSource */
|
/* CodeSource */
|
||||||
private final CodeSource codesource ;
|
private final CodeSource codesource ;
|
||||||
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2010, 2024, 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
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package jdk.internal.access;
|
|
||||||
|
|
||||||
import java.security.AccessControlContext;
|
|
||||||
import java.security.PrivilegedAction;
|
|
||||||
|
|
||||||
public interface JavaSecurityAccess {
|
|
||||||
|
|
||||||
<T> T doIntersectionPrivilege(PrivilegedAction<T> action,
|
|
||||||
@SuppressWarnings("removal") AccessControlContext stack,
|
|
||||||
@SuppressWarnings("removal") AccessControlContext context);
|
|
||||||
|
|
||||||
<T> T doIntersectionPrivilege(PrivilegedAction<T> action,
|
|
||||||
@SuppressWarnings("removal") AccessControlContext context);
|
|
||||||
}
|
|
|
@ -39,10 +39,7 @@ import java.io.Console;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.FilePermission;
|
import java.io.FilePermission;
|
||||||
import java.io.ObjectInputStream;
|
import java.io.ObjectInputStream;
|
||||||
import java.io.PrintStream;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
import java.security.ProtectionDomain;
|
|
||||||
import java.security.Signature;
|
import java.security.Signature;
|
||||||
import javax.security.auth.x500.X500Principal;
|
import javax.security.auth.x500.X500Principal;
|
||||||
|
|
||||||
|
@ -89,7 +86,6 @@ public class SharedSecrets {
|
||||||
private static JavaUtilJarAccess javaUtilJarAccess;
|
private static JavaUtilJarAccess javaUtilJarAccess;
|
||||||
private static JavaUtilZipFileAccess javaUtilZipFileAccess;
|
private static JavaUtilZipFileAccess javaUtilZipFileAccess;
|
||||||
private static JavaUtilResourceBundleAccess javaUtilResourceBundleAccess;
|
private static JavaUtilResourceBundleAccess javaUtilResourceBundleAccess;
|
||||||
private static JavaSecurityAccess javaSecurityAccess;
|
|
||||||
private static JavaSecurityPropertiesAccess javaSecurityPropertiesAccess;
|
private static JavaSecurityPropertiesAccess javaSecurityPropertiesAccess;
|
||||||
private static JavaSecuritySignatureAccess javaSecuritySignatureAccess;
|
private static JavaSecuritySignatureAccess javaSecuritySignatureAccess;
|
||||||
private static JavaSecuritySpecAccess javaSecuritySpecAccess;
|
private static JavaSecuritySpecAccess javaSecuritySpecAccess;
|
||||||
|
@ -313,19 +309,6 @@ public class SharedSecrets {
|
||||||
return access;
|
return access;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setJavaSecurityAccess(JavaSecurityAccess jsa) {
|
|
||||||
javaSecurityAccess = jsa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JavaSecurityAccess getJavaSecurityAccess() {
|
|
||||||
var access = javaSecurityAccess;
|
|
||||||
if (access == null) {
|
|
||||||
ensureClassInitialized(ProtectionDomain.class);
|
|
||||||
access = javaSecurityAccess;
|
|
||||||
}
|
|
||||||
return access;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setJavaSecurityPropertiesAccess(JavaSecurityPropertiesAccess jspa) {
|
public static void setJavaSecurityPropertiesAccess(JavaSecurityPropertiesAccess jspa) {
|
||||||
javaSecurityPropertiesAccess = jspa;
|
javaSecurityPropertiesAccess = jspa;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue