Blame SOURCES/rh1915071-always_initialise_configurator_access.patch

dee830
diff --git openjdk/src/java.base/share/classes/java/security/Security.java openjdk/src/java.base/share/classes/java/security/Security.java
dee830
index f1633afb627..ce32c939253 100644
dee830
--- openjdk/src/java.base/share/classes/java/security/Security.java
dee830
+++ openjdk/src/java.base/share/classes/java/security/Security.java
dee830
@@ -32,6 +32,7 @@ import java.net.URL;
dee830
 
dee830
 import jdk.internal.event.EventHelper;
dee830
 import jdk.internal.event.SecurityPropertyModificationEvent;
dee830
+import jdk.internal.access.JavaSecuritySystemConfiguratorAccess;
dee830
 import jdk.internal.access.SharedSecrets;
dee830
 import jdk.internal.util.StaticProperty;
dee830
 import sun.security.util.Debug;
dee830
@@ -74,6 +75,15 @@ public final class Security {
dee830
     }
dee830
 
dee830
     static {
dee830
+        // Initialise here as used by code with system properties disabled
dee830
+        SharedSecrets.setJavaSecuritySystemConfiguratorAccess(
dee830
+            new JavaSecuritySystemConfiguratorAccess() {
dee830
+                @Override
dee830
+                public boolean isSystemFipsEnabled() {
dee830
+                    return SystemConfigurator.isSystemFipsEnabled();
dee830
+                }
dee830
+            });
dee830
+
dee830
         // doPrivileged here because there are multiple
dee830
         // things in initialize that might require privs.
dee830
         // (the FileInputStream call and the File.exists call,
dee830
@@ -194,9 +204,8 @@ public final class Security {
dee830
         }
dee830
 
dee830
         String disableSystemProps = System.getProperty("java.security.disableSystemPropertiesFile");
dee830
-        if (disableSystemProps == null &&
dee830
-            "true".equalsIgnoreCase(props.getProperty
dee830
-                ("security.useSystemPropertiesFile"))) {
dee830
+        if ((disableSystemProps == null || "false".equalsIgnoreCase(disableSystemProps)) &&
dee830
+            "true".equalsIgnoreCase(props.getProperty("security.useSystemPropertiesFile"))) {
dee830
             if (SystemConfigurator.configure(props)) {
dee830
                 loadedProps = true;
dee830
             }
dee830
diff --git openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
dee830
index 60fa75cab45..10b54aa4ce4 100644
dee830
--- openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
dee830
+++ openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
dee830
@@ -38,8 +38,6 @@ import java.util.Map.Entry;
dee830
 import java.util.Properties;
dee830
 import java.util.regex.Pattern;
dee830
 
dee830
-import jdk.internal.access.JavaSecuritySystemConfiguratorAccess;
dee830
-import jdk.internal.access.SharedSecrets;
dee830
 import sun.security.util.Debug;
dee830
 
dee830
 /**
dee830
@@ -65,16 +63,6 @@ final class SystemConfigurator {
dee830
 
dee830
     private static boolean systemFipsEnabled = false;
dee830
 
dee830
-    static {
dee830
-        SharedSecrets.setJavaSecuritySystemConfiguratorAccess(
dee830
-            new JavaSecuritySystemConfiguratorAccess() {
dee830
-                @Override
dee830
-                public boolean isSystemFipsEnabled() {
dee830
-                    return SystemConfigurator.isSystemFipsEnabled();
dee830
-                }
dee830
-            });
dee830
-    }
dee830
-
dee830
     /*
dee830
      * Invoked when java.security.Security class is initialized, if
dee830
      * java.security.disableSystemPropertiesFile property is not set and