[FIX Permission issue after upgrade to 2.93
Simply revert to using pre-NIO createTempFile for backward compatibility.
There is no simple way to restore a similar way using NIO's createTempFile.
@@ -138,7 +138,8 @@ public class AtomicFileWriter extends Writer {
}
try {
- tmpPath = Files.createTempFile(dir, "atomic", "tmp");
+ // JENKINS-48407: NIO's createTempFile creates file with 0600 permissions, so we use pre-NIO for this...
+ tmpPath = File.createTempFile("atomic", "tmp", dir.toFile()).toPath();
} catch (IOException e) {
throw new IOException("Failed to create a temporary file in "+ dir,e);
}
