RFR: 8287097: (fs) Files::copy requires an undocumented permission when copying from the default file system to a non-default file system [v2]
Alan Bateman
alanb at openjdk.java.net
Thu Jun 2 05:02:42 UTC 2022
On Wed, 1 Jun 2022 16:10:47 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> src/java.base/share/classes/java/nio/file/CopyMoveHelper.java line 119:
>>
>>> 117: PosixFileAttributes.class,
>>> 118: linkOptions);
>>> 119: } catch (SecurityException ignored) {
>>
>> Ignoring SecurityException looks right here but you need to do the same with targetPosixView.setPermissions(...) for the case that you are copying from a custom file system that supports permissions to the default file system.
>
> Fixed by 80961915b339fb3bf39acf120e25c363aff16afc.
Would it be possible to add the comment
// okay to continue if RuntimePermission("accessUserInformation") not granted
in the catch block of both places so that it's clear to readers why it is okay to ignore the SE?
-------------
PR: https://git.openjdk.java.net/jdk/pull/8963
More information about the nio-dev
mailing list