Skip to content

Commit

Permalink
Recognize -Djava.security.manager=allow
Browse files Browse the repository at this point in the history
In the latest JDK versions, the string `allow` is not the name of a security
manager, and instead indicates that the code is allowed to install a security
manager of its own.

PiperOrigin-RevId: 455150087
Change-Id: Iac26ec13ffd006fc3a758678e36c94dcc94beec4
  • Loading branch information
cushon authored and copybara-github committed Jun 15, 2022
1 parent 8b816f5 commit 447de82
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private JUnit4Config(

private static boolean installSecurityManager(Properties systemProperties) {
String securityManager = systemProperties.getProperty("java.security.manager");
if (securityManager != null) {
if (securityManager != null && !securityManager.equals("allow")) {
return false; // Don't install over the specified security manager
}
return Boolean.valueOf(
Expand Down

0 comments on commit 447de82

Please sign in to comment.