aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Buchholz <martin@openjdk.org>2021-01-27 04:31:29 +0000
committerMartin Buchholz <martin@openjdk.org>2021-01-27 04:31:29 +0000
commitc836da387e2803e3f4eaa8918650a3ebcda8b216 (patch)
treea52d49894e20f207975a8530b30573a438f19ae4
parente1411fd4d4beef5d792d715751fd8c4980be3bab (diff)
downloadlibcore-c836da387e2803e3f4eaa8918650a3ebcda8b216.tar.gz
8252412: [macos11] system dynamic libraries removed from filesystemjdk21u/jdk-17+7jdk17u/jdk-17+7jdk/jdk-17+7
Co-authored-by: Dominik Röttsches <drott@google.com> Reviewed-by: jiangli, valeriep
-rw-r--r--src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
index 43d93c93d3b..23980b09c1f 100644
--- a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
+++ b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
@@ -110,8 +110,26 @@ class PlatformPCSC {
// if LIB2 exists, use that
return lib;
}
+
+ // As of macos 11, framework libraries have been removed from the file
+ // system, but in such a way that they can still be dlopen()ed, even
+ // though they can no longer be open()ed.
+ //
+ // https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes
+ //
+ // """New in macOS Big Sur 11.0.1, the system ships with a built-in
+ // dynamic linker cache of all system-provided libraries. As part of
+ // this change, copies of dynamic libraries are no longer present on
+ // the filesystem. Code that attempts to check for dynamic library
+ // presence by looking for a file at a path or enumerating a directory
+ // will fail. Instead, check for library presence by attempting to
+ // dlopen() the path, which will correctly check for the library in the
+ // cache."""
+ //
+ // The directory structure remains otherwise intact, so check for
+ // existence of the containing directory instead of the file.
lib = PCSC_FRAMEWORK;
- if (new File(lib).isFile()) {
+ if (new File(lib).getParentFile().isDirectory()) {
// if PCSC.framework exists, use that
return lib;
}