RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2]
Johannes Döbler
duke at openjdk.org
Tue Aug 5 19:31:05 UTC 2025
On Tue, 5 Aug 2025 17:48:59 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8364277: 1) Add and use package scope isDirectoryJunction(); 2) Remove explicit delete of junction from test
test/lib/jdk/test/lib/util/libFileUtils.c line 167:
> 165: lpInBuffer = NULL;
> 166:
> 167: if (result == 0) {
Suggestion: Would it be possible to avoid the dreaded goto
if ((result != 0) && (CloseHandle(hJunction) != 0)) {
return JNI_TRUE;
}
...do error handling...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255151112
More information about the core-libs-dev
mailing list