diff options
Diffstat (limited to 'configserver/src')
2 files changed, 5 insertions, 4 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java index 30fbfd48f78..6f141e3e6ad 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java @@ -43,11 +43,12 @@ public class CompressedApplicationInputStream implements AutoCloseable { */ public static CompressedApplicationInputStream createFromCompressedStream(InputStream is, String contentType) { try { + Options options = Options.standard().allowDotSegment(true); switch (contentType) { case ApplicationApiHandler.APPLICATION_X_GZIP: - return new CompressedApplicationInputStream(ArchiveStreamReader.ofTarGzip(is, Options.standard())); + return new CompressedApplicationInputStream(ArchiveStreamReader.ofTarGzip(is, options)); case ApplicationApiHandler.APPLICATION_ZIP: - return new CompressedApplicationInputStream(ArchiveStreamReader.ofZip(is, Options.standard())); + return new CompressedApplicationInputStream(ArchiveStreamReader.ofZip(is, options)); default: throw new BadRequestException("Unable to decompress"); } @@ -87,7 +88,7 @@ public class CompressedApplicationInputStream implements AutoCloseable { while ((file = reader.readNextTo(tmpStream)) != null) { tmpStream.close(); log.log(Level.FINE, "Creating output file: " + file.path()); - Path dstFile = dir.resolve(file.path().toString()); + Path dstFile = dir.resolve(file.path().toString()).normalize(); Files.createDirectories(dstFile.getParent()); Files.move(tmpFile, dstFile); tmpFile = createTempFile(dir); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java index e8c7cff4e75..61642d33e62 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java @@ -158,7 +158,7 @@ public class CompressedApplicationInputStreamTest { private static File createTarGz(String appDir) throws IOException, InterruptedException { File tmpTar = File.createTempFile("myapp", ".tar"); - Process p = new ProcessBuilder("tar", "-C", appDir, "--exclude=.svn", "--strip-components=1", "-cvf", tmpTar.getAbsolutePath(), ".").start(); + Process p = new ProcessBuilder("tar", "-C", appDir, "-cvf", tmpTar.getAbsolutePath(), ".").start(); p.waitFor(); p = new ProcessBuilder("gzip", tmpTar.getAbsolutePath()).start(); p.waitFor(); |