Blame SOURCES/rh1915071-always_initialise_configurator_access.patch

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