RFR: 8308678: (fs) UnixPath::toRealPath needs additional permissions when running with SM (macOS)

Brian Burkhalter bpb at openjdk.org
Thu May 25 20:20:56 UTC 2023


On Thu, 25 May 2023 19:31:13 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> When not resolving links and the case retention algorithm cannot be run due to a security manager being in place with no read permissions for the tree to be traversed, then fall back to the result obtained without case correction.
>
> test/jdk/java/nio/file/Path/MacToRealPathWithSM.java line 63:
> 
>> 61:         System.out.printf("real path no follow: %s%n",
>> 62:                           path.toRealPath(LinkOption.NOFOLLOW_LINKS));
>> 63:     }
> 
> Same comment regarding printf
> 
> Are you expecting an Exception to be thrown if there is an issue given there is no validation?  Either way, I would clarify with additional comments for future maintainers

An `AccessControlException` is thrown by `path.toRealPath(LinkOption.NOFOLLOW_LINKS)` when run against JDK 20 and the current mainline. I concur that more comments would be better.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14157#discussion_r1205966131


More information about the nio-dev mailing list