summaryrefslogtreecommitdiff
path: root/archival/libunarchive/data_extract_all.c
diff options
context:
space:
mode:
authorGlenn L McGrath2003-11-27 00:01:43 +0000
committerGlenn L McGrath2003-11-27 00:01:43 +0000
commite39ee01821d537b3b249b0c136bb150734016c35 (patch)
treef80ff1767e2b0fc8ce022bf45e36ffc776e9e8f9 /archival/libunarchive/data_extract_all.c
parentfea4b446df1b4d7c81804252ec7978092143f36e (diff)
downloadbusybox-e39ee01821d537b3b249b0c136bb150734016c35.zip
busybox-e39ee01821d537b3b249b0c136bb150734016c35.tar.gz
Fix tar hard links
Diffstat (limited to 'archival/libunarchive/data_extract_all.c')
-rw-r--r--archival/libunarchive/data_extract_all.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c
index bf3be5b..b77cd11 100644
--- a/archival/libunarchive/data_extract_all.c
+++ b/archival/libunarchive/data_extract_all.c
@@ -66,8 +66,9 @@ extern void data_extract_all(archive_handle_t *archive_handle)
}
}
- /* Handle hard links seperately */
- if (!S_ISLNK(file_header->mode) && (file_header->link_name) && (file_header->size == 0)) {
+ /* Handle hard links seperately
+ * We identified hard links as regular files of size 0 with a symlink */
+ if (S_ISREG(file_header->mode) && (file_header->link_name) && (file_header->size == 0)) {
/* hard link */
res = link(file_header->link_name, file_header->name);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {