Skip to content

Commit

Permalink
[SECURITY] Fix Temporary Directory Information Disclosure Vulnerabili…
Browse files Browse the repository at this point in the history
…ty in test (#567)

Reported-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Co-authored-by: Moderne <team@moderne.io>
  • Loading branch information
JLLeitschuh and TeamModerne authored Jul 29, 2022
1 parent c58e4b4 commit cd99d11
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/test/java/hudson/remoting/PrefetchingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.util.concurrent.ExecutionException;

import static org.hamcrest.MatcherAssert.assertThat;
Expand Down Expand Up @@ -40,9 +41,7 @@ protected void setUp() throws Exception {
new URL[] {toFile(jar1).toURI().toURL(), toFile(jar2).toURI().toURL()},
this.getClass().getClassLoader());

dir = File.createTempFile("remoting", "cache");
dir.delete();
dir.mkdirs();
dir = Files.createTempDirectory("remoting-cache").toFile();

channel.setJarCache(new FileSystemJarCache(dir, true));
channel.call(new JarCacherCallable());
Expand Down

0 comments on commit cd99d11

Please sign in to comment.