Blame SOURCES/jdk8009550-rh910107-search_for_versioned_libpcsclite.patch

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