RFR: 8324811: java/nio/file/Files/CopyMoveVariations.java fails run with non-root user

SendaoYan syan at openjdk.org
Thu Feb 22 15:14:01 UTC 2024


On Wed, 21 Feb 2024 21:18:53 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> > @bplb Did you ever run into this? I don't run the tests with root access and haven't seen this. The current changes in pull/17235 aren't complete but if that change goes in then the test won't be testing /tmp.
> 
> @AlanBateman No, I have not seen this behavior, nor that addressed in #17235 for that matter. I think that if issue [JDK-8324811](https://bugs.openjdk.org/browse/JDK-8324811) is not reproducible after #17235, then the present PR and its associated issue can be closed.

This testcase include 3 `Files.move(source, target, options` operations(line 195, line 212, line 232), only the line 195 miss `try catch AccessDeniedException` surround.
And for the line 219, when there is a `AccessDeniedException`, then the source file should miss read permission, so `mode.charAt(1) != 'r'` , rather than `mode.charAt(1) != 'w'`.
So, it seems that it's a testcase bug cause this testcase run fail at some situation.
Maybe this PR is more reasonable more than https://github.com/openjdk/jdk/pull/17235

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

PR Comment: https://git.openjdk.org/jdk/pull/17606#issuecomment-1959655669


More information about the nio-dev mailing list