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 58
58
<apache .commons.lang3.version>3.11</apache .commons.lang3.version>
59
59
<apache .commons.collections4.version>4.4</apache .commons.collections4.version>
60
60
<apache .commons.compress>1.20</apache .commons.compress>
61
+ <apache .commons.io>2.8.0</apache .commons.io>
61
62
<common .codec.version>1.15</common .codec.version>
62
63
<spring .boot.version>2.3.5.RELEASE</spring .boot.version>
63
64
<spring .version>5.2.9.RELEASE</spring .version>
113
114
<artifactId >commons-compress</artifactId >
114
115
<version >${apache.commons.compress} </version >
115
116
</dependency >
117
+ <dependency >
118
+ <groupId >commons-io</groupId >
119
+ <artifactId >commons-io</artifactId >
120
+ <version >${apache.commons.io} </version >
121
+ </dependency >
116
122
<dependency >
117
123
<groupId >com.github.ben-manes.caffeine</groupId >
118
124
<artifactId >caffeine</artifactId >
Original file line number Diff line number Diff line change 46
46
<groupId >org.apache.commons</groupId >
47
47
<artifactId >commons-lang3</artifactId >
48
48
</dependency >
49
+ <dependency >
50
+ <groupId >commons-io</groupId >
51
+ <artifactId >commons-io</artifactId >
52
+ </dependency >
49
53
<dependency >
50
54
<groupId >org.slf4j</groupId >
51
55
<artifactId >slf4j-api</artifactId >
Original file line number Diff line number Diff line change 42
42
import org .apache .commons .compress .archivers .tar .TarArchiveInputStream ;
43
43
import org .apache .commons .compress .archivers .tar .TarArchiveOutputStream ;
44
44
import org .apache .commons .compress .compressors .gzip .GzipCompressorInputStream ;
45
+ import org .apache .commons .io .FilenameUtils ;
45
46
import org .slf4j .Logger ;
46
47
import org .slf4j .LoggerFactory ;
47
48
@@ -188,7 +189,11 @@ public Future<Integer> copyDirectoryFromPodAsync(
188
189
log .error ("Can't read: " + entry );
189
190
continue ;
190
191
}
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 );
192
197
if (entry .isDirectory ()) {
193
198
if (!f .isDirectory () && !f .mkdirs ()) {
194
199
throw new IOException ("create directory failed: " + f );
You can’t perform that action at this time.
0 commit comments