RFR: 8287097: (fs) Files::copy requires an undocumented permission when copying from the default file system to a non-default file system

Alan Bateman alanb at openjdk.java.net
Wed Jun 1 06:44:43 UTC 2022


On Wed, 1 Jun 2022 00:27:26 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Ignore the `SecurityException` thrown while trying to retrieve the POSIX attributes when a `SecurityManager` is set.

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.

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

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


More information about the nio-dev mailing list