Blame SOURCES/rh1915071-always_initialise_configurator_access.patch

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