RFR: 8322881: java/nio/file/Files/CopyMoveVariations.java fails with AccessDeniedException due to permissions of files in /tmp

Jaikiran Pai jpai at openjdk.org
Fri Jan 5 16:41:21 UTC 2024


On Wed, 3 Jan 2024 03:42:17 GMT, yaqsun <duke at openjdk.org> wrote:

> testcase: java/nio/file/Files/CopyMoveVariations.java
> 
> Method createTempFile() creates "/tmp/file*" that it causes file copy permission issue when running through jtreg.
> 
> Create files for method "createTempFile()" passing in the current path(jtreg_test_jdk_java_nio_file_Files_CopyMoveVariations_java/scratch or JTwork/scratch).

Reading through the stacktrace in the linked JBS issue, it appears that it's not the "Files.createTempFile" which is failing but the `Files.move` appears to be failing, unable to move a temporary file (which has `000` posix permission) that was created by the test in the default filesystem's temporary directory, to a non-existent target file on the same filesystem. The copy operation in the `UnixFileSystem` is where this is failing to open the source file. You might have to debug that code a bit to see how that default temporary directory is setup and different from other systems where this is passing.

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

PR Comment: https://git.openjdk.org/jdk/pull/17235#issuecomment-1878955313


More information about the nio-dev mailing list