Skip to content

Commit c836da3

Browse files
Martin Buchholzdrott
andcommitted
8252412: [macos11] system dynamic libraries removed from filesystem
Co-authored-by: Dominik Röttsches <drott@google.com> Reviewed-by: jiangli, valeriep
1 parent e1411fd commit c836da3

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,26 @@ private static String getLibraryName() throws IOException {
110110
// if LIB2 exists, use that
111111
return lib;
112112
}
113+
114+
// As of macos 11, framework libraries have been removed from the file
115+
// system, but in such a way that they can still be dlopen()ed, even
116+
// though they can no longer be open()ed.
117+
//
118+
// https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes
119+
//
120+
// """New in macOS Big Sur 11.0.1, the system ships with a built-in
121+
// dynamic linker cache of all system-provided libraries. As part of
122+
// this change, copies of dynamic libraries are no longer present on
123+
// the filesystem. Code that attempts to check for dynamic library
124+
// presence by looking for a file at a path or enumerating a directory
125+
// will fail. Instead, check for library presence by attempting to
126+
// dlopen() the path, which will correctly check for the library in the
127+
// cache."""
128+
//
129+
// The directory structure remains otherwise intact, so check for
130+
// existence of the containing directory instead of the file.
113131
lib = PCSC_FRAMEWORK;
114-
if (new File(lib).isFile()) {
132+
if (new File(lib).getParentFile().isDirectory()) {
115133
// if PCSC.framework exists, use that
116134
return lib;
117135
}

0 commit comments

Comments
 (0)