Blame SOURCES/jdk8009550-rh910107-search_for_versioned_libpcsclite.patch

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