summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-02-09 16:54:10 +0200
committerTimo Teräs <timo.teras@iki.fi>2016-02-09 16:55:06 +0200
commit9c736d01d9647d302f9011cc1db5e6e6b99c70b7 (patch)
tree1a865b7d139a7f6a110d7374246bd7649d644e2d
parent2a066169bd60419576f065fbe3532d671dabb085 (diff)
downloadapk-tools-9c736d01d9647d302f9011cc1db5e6e6b99c70b7.tar.bz2
apk-tools-9c736d01d9647d302f9011cc1db5e6e6b99c70b7.tar.xz
archive: fix long symlink target names
don't overwrite the link_target if it was found from pax header. ref #5076
-rw-r--r--src/archive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/archive.c b/src/archive.c
index ecb276a..e86a53a 100644
--- a/src/archive.c
+++ b/src/archive.c
@@ -258,11 +258,11 @@ int apk_tar_parse(struct apk_istream *is, apk_archive_entry_parser parser,
break;
case '1': /* hard link */
entry.mode |= S_IFREG;
- entry.link_target = buf.linkname;
+ if (!entry.link_target) entry.link_target = buf.linkname;
break;
case '2': /* symbolic link */
entry.mode |= S_IFLNK;
- entry.link_target = buf.linkname;
+ if (!entry.link_target) entry.link_target = buf.linkname;
if (entry.csum.type == APK_CHECKSUM_NONE && soft_checksums) {
EVP_Digest(buf.linkname, strlen(buf.linkname),
entry.csum.data, NULL,