RFR: 8273922: (fs) UserDefinedFileAttributeView doesn't handle file names that are just under the MAX_PATH limit (win) [v2]
Brian Burkhalter
bpb at openjdk.java.net
Thu Sep 23 16:16:50 UTC 2021
On Tue, 21 Sep 2021 18:38:23 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8273922: Add bug ID to @bug in test
>
> src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java line 62:
>
>> 60: StringBuilder sb = new StringBuilder(wp.getPathForWin32Calls());
>> 61: sb.setCharAt(sb.length() - name.length() - 1, ':');
>> 62: return sb.toString();
>
> I suspect the right thing here is to parse "name" and maybe reject if it is not RELATIVE. Then concatenate and use createFromNormalizedPath(...) to create the WindowsPath. I expect it will be possible to reduce the number of conversions too although this isn't critical for now.
Fixed in third commit.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5594
More information about the nio-dev
mailing list