Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

[SECURITY] Fix Temporary File Information Disclosure Vulnerability #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.concurrent.ScheduledExecutorService;

public class GitProctorStoreFactory implements TrunkQaProdStoresFactory {
Expand Down Expand Up @@ -190,7 +191,7 @@ private File createTempDirectoryForPath(final String relativePath) {
* @return
*/
private File identifyImplicitTempRoot() throws IOException {
final File tempFile = File.createTempFile("implicit", GitProctorStoreFactory.class.getSimpleName());
final File tempFile = Files.createTempFile("implicit", GitProctorStoreFactory.class.getSimpleName()).toFile();

tempFile.delete();
return tempFile.getParentFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -116,7 +117,7 @@ public ProctorStore createStore(final String relativePath) {
* @return
*/
private File identifyImplicitTempRoot() throws IOException {
final File tempFile = File.createTempFile("implicit", SvnProctorStoreFactory.class.getSimpleName());
final File tempFile = Files.createTempFile("implicit", SvnProctorStoreFactory.class.getSimpleName()).toFile();

tempFile.delete();
return tempFile.getParentFile();
Expand Down