diff options
author | Simon Rettberg | 2020-11-17 11:59:12 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-11-17 11:59:43 +0100 |
commit | eab15918121702f5d87b9d25d035826c99e803ea (patch) | |
tree | 5e3ca7a682313ae7e51900b9850366285bb78da7 | |
parent | [SshConfigGenerator] Adapt to changed config from slx-admin (diff) | |
download | tmlite-bwlp-eab15918121702f5d87b9d25d035826c99e803ea.tar.gz tmlite-bwlp-eab15918121702f5d87b9d25d035826c99e803ea.tar.xz tmlite-bwlp-eab15918121702f5d87b9d25d035826c99e803ea.zip |
[util/Archive] Fix tar entry copying (symlinks etc.)
This was introduced when working on issue #3670
-rw-r--r-- | src/main/java/org/openslx/satserver/util/Archive.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/org/openslx/satserver/util/Archive.java b/src/main/java/org/openslx/satserver/util/Archive.java index 25285e7..e52a5f6 100644 --- a/src/main/java/org/openslx/satserver/util/Archive.java +++ b/src/main/java/org/openslx/satserver/util/Archive.java @@ -118,11 +118,10 @@ public class Archive outEntry.setSize( inEntry.getSize() ); if ( inEntry instanceof TarArchiveEntry ) { // Source is tar - easy - outEntry.setUserName( ( (TarArchiveEntry)inEntry ).getUserName() ); - outEntry.setGroupName( ( (TarArchiveEntry)inEntry ).getGroupName() ); - outEntry.setIds( ( (TarArchiveEntry)inEntry ).getUserId(), ( (TarArchiveEntry)inEntry ).getGroupId() ); - outEntry.setMode( ( (TarArchiveEntry)inEntry ).getMode() ); - outEntry.setModTime( ( (TarArchiveEntry)inEntry ).getLastModifiedDate() ); + byte[] buffer = new byte[1000]; + ( (TarArchiveEntry)inEntry ).writeEntryHeader( buffer ); + outEntry.parseTarHeader( buffer ); + outEntry.setName( name ); // Reset, as this was overwritten } else if ( inEntry instanceof ArArchiveEntry ) { // Source is ar - has most of the stuff tar supports; transform outEntry.setIds( ( (ArArchiveEntry)inEntry ).getUserId(), ( (ArArchiveEntry)inEntry ).getGroupId() ); |