diff options
author | Harald van Dijk <harald@gigawatt.nl> | 2018-05-22 17:34:31 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-05-22 17:34:31 +0200 |
commit | 8c24af9dcfe0d89a660c39838eec4d20bc13efbf (patch) | |
tree | 1be6f930fb21383ba8c46a6d0491cafe3e26d687 /archival/libarchive/data_extract_all.c | |
parent | a40a661d971cf75c617c83357ac0e87a45f41f4f (diff) | |
download | busybox-8c24af9dcfe0d89a660c39838eec4d20bc13efbf.tar.gz |
tar: fix interaction of delayed symlink and hardlink creation
function old new delta
create_or_remember_link - 106 +106
create_links_from_list - 93 +93
find_applet_by_name 124 128 +4
unzip_main 2724 2726 +2
data_extract_all 891 873 -18
create_symlinks_from_list 64 - -64
create_or_remember_symlink 94 - -94
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/1 up/down: 205/-176) Total: 29 bytes
Signed-off-by: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive/data_extract_all.c')
-rw-r--r-- | archival/libarchive/data_extract_all.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/archival/libarchive/data_extract_all.c b/archival/libarchive/data_extract_all.c index 8fa69ffaf..4c95db4a6 100644 --- a/archival/libarchive/data_extract_all.c +++ b/archival/libarchive/data_extract_all.c @@ -122,13 +122,10 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) /* Handle hard links separately */ if (hard_link) { - res = link(hard_link, dst_name); - if (res != 0) { - /* shared message */ - bb_perror_msg("can't create %slink '%s' to '%s'", - "hard", dst_name, hard_link - ); - } + create_or_remember_link(&archive_handle->link_placeholders, + hard_link, + dst_name, + 1); /* Hardlinks have no separate mode/ownership, skip chown/chmod */ goto ret; } @@ -195,9 +192,10 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) * * Untarring bug.tar would otherwise place evil.py in '/tmp'. */ - create_or_remember_symlink(&archive_handle->symlink_placeholders, + create_or_remember_link(&archive_handle->link_placeholders, file_header->link_target, - dst_name); + dst_name, + 0); break; case S_IFSOCK: case S_IFBLK: |