Skip to content

Commit

Permalink
Merge pull request #1433 from brendandburns/release-9.0.3
Browse files Browse the repository at this point in the history
Cherry-pick #1426
  • Loading branch information
k8s-ci-robot committed Dec 14, 2020
2 parents 4c43c6a + f5de2e7 commit 7e14950
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pom.xml
Expand Up @@ -48,6 +48,7 @@
<common.codec.version>1.14</common.codec.version>
<spring.boot.version>2.3.1.RELEASE</spring.boot.version>
<spring.version>5.2.8.RELEASE</spring.version>
<apache.commons.io>2.8.0</apache.commons.io>

<gpg.keyname>48540ECBBF00A28EACCF04E720FD12AFB0C9EBA9</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
Expand Down Expand Up @@ -97,6 +98,11 @@
<artifactId>commons-compress</artifactId>
<version>${apache.commons.compress}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${apache.commons.io}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions util/pom.xml
Expand Up @@ -38,6 +38,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
7 changes: 6 additions & 1 deletion util/src/main/java/io/kubernetes/client/Copy.java
Expand Up @@ -35,6 +35,7 @@
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -137,7 +138,11 @@ public void copyDirectoryFromPod(
log.error("Can't read: " + entry);
continue;
}
File f = new File(destination.toFile(), entry.getName());
String normalName = FilenameUtils.normalize(entry.getName());
if (normalName == null) {
throw new IOException("Invalid entry: " + entry.getName());
}
File f = new File(destination.toFile(), normalName);
if (entry.isDirectory()) {
if (!f.isDirectory() && !f.mkdirs()) {
throw new IOException("create directory failed: " + f);
Expand Down

0 comments on commit 7e14950

Please sign in to comment.