File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
src/main/java/io/kubernetes/client Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 5858 <apache .commons.lang3.version>3.11</apache .commons.lang3.version>
5959 <apache .commons.collections4.version>4.4</apache .commons.collections4.version>
6060 <apache .commons.compress>1.20</apache .commons.compress>
61+ <apache .commons.io>2.8.0</apache .commons.io>
6162 <common .codec.version>1.15</common .codec.version>
6263 <spring .boot.version>2.3.5.RELEASE</spring .boot.version>
6364 <spring .version>5.2.9.RELEASE</spring .version>
113114 <artifactId >commons-compress</artifactId >
114115 <version >${apache.commons.compress} </version >
115116 </dependency >
117+ <dependency >
118+ <groupId >commons-io</groupId >
119+ <artifactId >commons-io</artifactId >
120+ <version >${apache.commons.io} </version >
121+ </dependency >
116122 <dependency >
117123 <groupId >com.github.ben-manes.caffeine</groupId >
118124 <artifactId >caffeine</artifactId >
Original file line number Diff line number Diff line change 4646 <groupId >org.apache.commons</groupId >
4747 <artifactId >commons-lang3</artifactId >
4848 </dependency >
49+ <dependency >
50+ <groupId >commons-io</groupId >
51+ <artifactId >commons-io</artifactId >
52+ </dependency >
4953 <dependency >
5054 <groupId >org.slf4j</groupId >
5155 <artifactId >slf4j-api</artifactId >
Original file line number Diff line number Diff line change 4242import org .apache .commons .compress .archivers .tar .TarArchiveInputStream ;
4343import org .apache .commons .compress .archivers .tar .TarArchiveOutputStream ;
4444import org .apache .commons .compress .compressors .gzip .GzipCompressorInputStream ;
45+ import org .apache .commons .io .FilenameUtils ;
4546import org .slf4j .Logger ;
4647import org .slf4j .LoggerFactory ;
4748
@@ -188,7 +189,11 @@ public Future<Integer> copyDirectoryFromPodAsync(
188189 log .error ("Can't read: " + entry );
189190 continue ;
190191 }
191- File f = new File (destination .toFile (), entry .getName ());
192+ String normalName = FilenameUtils .normalize (entry .getName ());
193+ if (normalName == null ) {
194+ throw new IOException ("Invalid entry: " + entry .getName ());
195+ }
196+ File f = new File (destination .toFile (), normalName );
192197 if (entry .isDirectory ()) {
193198 if (!f .isDirectory () && !f .mkdirs ()) {
194199 throw new IOException ("create directory failed: " + f );
You can’t perform that action at this time.
0 commit comments