|
54 | 54 | import java.util.stream.Stream; |
55 | 55 | import jenkins.bouncycastle.api.PEMEncodable; |
56 | 56 | import jenkins.model.Jenkins; |
57 | | -import org.apache.commons.compress.archivers.tar.TarArchiveEntry; |
58 | | -import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; |
| 57 | +import org.apache.tools.tar.TarEntry; |
| 58 | +import org.apache.tools.tar.TarOutputStream; |
59 | 59 | import org.jenkinsci.Symbol; |
60 | 60 | import org.jenkinsci.main.modules.instance_identity.InstanceIdentity; |
61 | 61 | import org.kohsuke.accmod.Restricted; |
@@ -298,13 +298,13 @@ public void beforeContainerStarted(DockerAPI api, String workdir, DockerTransien |
298 | 298 | + "|| :"; |
299 | 299 | final byte[] authorizedKeysCommandAsBytes = authorizedKeysCommand.getBytes(StandardCharsets.UTF_8); |
300 | 300 | try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
301 | | - TarArchiveOutputStream tar = new TarArchiveOutputStream(bos)) { |
302 | | - TarArchiveEntry entry = new TarArchiveEntry("authorized_key"); |
| 301 | + TarOutputStream tar = new TarOutputStream(bos)) { |
| 302 | + TarEntry entry = new TarEntry("authorized_key"); |
303 | 303 | entry.setSize(authorizedKeysCommandAsBytes.length); |
304 | 304 | entry.setMode(0700); |
305 | | - tar.putArchiveEntry(entry); |
| 305 | + tar.putNextEntry(entry); |
306 | 306 | tar.write(authorizedKeysCommandAsBytes); |
307 | | - tar.closeArchiveEntry(); |
| 307 | + tar.closeEntry(); |
308 | 308 | tar.close(); |
309 | 309 | try (InputStream is = new ByteArrayInputStream(bos.toByteArray()); |
310 | 310 | DockerClient client = api.getClient()) { |
|
0 commit comments