netty5/transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests
Norman Maurer c735357bf2 Use Files.createTempFile(...) to ensure the file is created with proper permissions
Motivation:

File.createTempFile(String, String)` will create a temporary file in the system temporary directory if the 'java.io.tmpdir'. The permissions on that file utilize the umask. In a majority of cases, this means that the file that java creates has the permissions: `-rw-r--r--`, thus, any other local user on that system can read the contents of that file.
This can be a security concern if any sensitive data is stored in this file.

This was reported by Jonathan Leitschuh <jonathan.leitschuh@gmail.com> as a security problem.

Modifications:

Use Files.createTempFile(...) which will use safe-defaults when running on java 7 and later. If running on java 6 there isnt much we can do, which is fair enough as java 6 shouldnt be considered "safe" anyway.

Result:

Create temporary files with sane permissions by default.
2021-02-08 11:44:05 +01:00
..
DetectPeerCloseWithoutReadTest.java Enable nohttp check during the build (#10708) 2020-10-23 14:44:18 +02:00
IovArrayTest.java Ensure IovArray is usuable without sun.misc.Unsafe (#10870) 2020-12-16 20:46:19 +01:00
package-info.java Enable nohttp check during the build (#10708) 2020-10-23 14:44:18 +02:00
SocketTest.java Enable nohttp check during the build (#10708) 2020-10-23 14:44:18 +02:00
UnixTestUtils.java Use Files.createTempFile(...) to ensure the file is created with proper permissions 2021-02-08 11:44:05 +01:00