8270380: Change the default value of the java.security.manager system property to disallow

Reviewed-by: lancea, mullan, rriggs
This commit is contained in:
Weijun Wang 2021-10-21 14:04:48 +00:00
parent e39bdc9ddb
commit d589b664cc
6 changed files with 22 additions and 25 deletions

View file

@ -361,9 +361,11 @@ public final class System {
* the method simply returns.
*
* @implNote In the JDK implementation, if the Java virtual machine is
* started with the system property {@code java.security.manager} set to
* started with the system property {@code java.security.manager} not set or set to
* the special token "{@code disallow}" then the {@code setSecurityManager}
* method cannot be used to set a security manager.
* method cannot be used to set a security manager. See the following
* <a href="SecurityManager.html#set-security-manager">section of the
* {@code SecurityManager} class specification</a> for more details.
*
* @param sm the security manager or {@code null}
* @throws SecurityException
@ -2237,7 +2239,7 @@ public final class System {
allowSecurityManager = MAYBE;
}
} else {
allowSecurityManager = MAYBE;
allowSecurityManager = NEVER;
}
if (needWarning) {