On Fri, 22 Jan 2021 20:08:48 GMT, Martin Buchholz <mar...@openjdk.org> wrote:

>> src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java 
>> line 132:
>> 
>>> 130:         // existence of the containing directory instead of the file.
>>> 131:         lib = PCSC_FRAMEWORK;
>>> 132:         if (new File(lib).getParentFile().isDirectory()) {
>> 
>> This is outside of my normal area, could you please explain why checking the 
>> existence of the containing directory is equivalent to checking the file 
>> here? Does it provide the expected behavior on all unix-like platforms or 
>> only macos?
>> 
>> Could you please also provide a jtreg test for this change?
>
> The directory structure is intact - only the file is removed from the 
> filesystem.
> More generally, for many frameworks, where there used to be
> 
> 
> the file is gone, but 
> 
> 
> remains.
> 
> I don't think we need a jtreg test, since any functionality associated with 
> PCSC is broken on this platform.  I added label noreg-other

Ok, I see Java_sun_security_smartcardio_PlatformPCSC_initialize does dlopen 
using the 'jLibName' (string) obtained from getLibraryName() and throws 
IOException if dlopen fails. The change seems safe enough.

I'm wondering if you want to check the file first then check the parent 
directory if the file does not exist. Not sure if that's a little more optimal 
on older macos, so I'll leave that to you to decide.

For the jtreg test, how about converting Dominik's TestPCSC? As the file is a 
shared for 'unix' platforms, it feels safer at least with some level of unit 
test. Could you please give some more contexts about the functionalities 
associated with PCSC are broken on macos?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2119

Reply via email to