RFR: 8252971: WindowsFileAttributes does not know about Unix domain sockets [v4]
Michael McMahon
michaelm at openjdk.java.net
Mon Feb 8 21:51:44 UTC 2021
On Mon, 8 Feb 2021 16:48:44 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Michael McMahon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:
>>
>> - Merge branch 'master' into 8252971-socket-attributes
>> - add specific check for unix domain socket
>> - Merge branch 'master' into 8252971-socket-attributes
>> - update
>> - update
>> - update
>> - update
>> - update after Alan's first review
>> - Merge branch 'master' into 8252971-socket-attributes
>> - test update
>> - ... and 1 more: https://git.openjdk.java.net/jdk/compare/6a98ca22...746b4762
>
> src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 346:
>
>> 344: Set.of(WindowsChannelFactory.OPEN_REPARSE_POINT),
>> 345: 0L);
>> 346: fc.close();
>
> The new version looks a bit strange. As I read it, the attempt to open the file fails with ERROR_CANT_ACCESS_FILE so you then check test if the file is a socket file. That succeeds so we should be done. What is the reason for opening the file again?
I added the test of the socket reparse tag to be 100% sure that we weren't returning false positives for other cases of ERROR_CANT_ACCESS_FILE. But, otherwise, I thought I had to open the file the same way as before to be sure that it is readable. If checking the reparse tag is sufficient then great, that simplifies the change.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2424
More information about the core-libs-dev
mailing list