Blame SOURCES/jdk8009550-rh910107-search_for_versioned_libpcsclite.patch

8eabd2
# 8009550, RH910107: PlatformPCSC should load versioned so
8eabd2
# Author: Andrew Hughes <gnu.andrew@redhat.com>
8eabd2
# Copyright 2019 Red Hat, Inc.
8eabd2
8eabd2
diff --git openjdk.orig///src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java openjdk///src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
8eabd2
--- openjdk.orig/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
8eabd2
+++ openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
8eabd2
@@ -48,9 +48,13 @@
8eabd2
 
8eabd2
     private final static String PROP_NAME = "sun.security.smartcardio.library";
8eabd2
 
8eabd2
-    private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so";
8eabd2
-    private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so";
8eabd2
-    private final static String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC";
8eabd2
+    private final static String[] SYSTEM_LIBS = {
8eabd2
+        "/usr/$LIBISA/libpcsclite.so",
8eabd2
+        "/usr/local/$LIBISA/libpcsclite.so",
8eabd2
+        "/usr/$LIBISA/libpcsclite.so.1",
8eabd2
+        "/usr/local/$LIBISA/libpcsclite.so.1",
8eabd2
+        "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC"
8eabd2
+    };
8eabd2
 
8eabd2
     PlatformPCSC() {
8eabd2
         // empty
8eabd2
@@ -104,20 +108,12 @@
8eabd2
         if (lib.length() != 0) {
8eabd2
             return lib;
8eabd2
         }
8eabd2
-        lib = expand(LIB1);
8eabd2
-        if (new File(lib).isFile()) {
8eabd2
-            // if LIB1 exists, use that
8eabd2
-            return lib;
8eabd2
-        }
8eabd2
-        lib = expand(LIB2);
8eabd2
-        if (new File(lib).isFile()) {
8eabd2
-            // if LIB2 exists, use that
8eabd2
-            return lib;
8eabd2
-        }
8eabd2
-        lib = PCSC_FRAMEWORK;
8eabd2
-        if (new File(lib).isFile()) {
8eabd2
-            // if PCSC.framework exists, use that
8eabd2
-            return lib;
8eabd2
+        for (String sysLib : SYSTEM_LIBS) {
8eabd2
+            lib = expand(sysLib);
8eabd2
+            if (new File(lib).isFile()) {
8eabd2
+                // if sysLib exists, use that
8eabd2
+                return lib;
8eabd2
+            }
8eabd2
         }
8eabd2
         throw new IOException("No PC/SC library found on this system");
8eabd2
     }