aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-09-12 06:31:28 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-09-12 06:31:28 +0000
commitef91bf67ed675cd6de2cc78acd930059fbefa375 (patch)
treee50db73bddc0517cef8ed2c82e4280bc275085e6 /archival/libunarchive
parent51ed242ad6c94f34d01461afc7141579f855017d (diff)
downloadbusybox-ef91bf67ed675cd6de2cc78acd930059fbefa375.tar.gz
Use the typeflag to identify if its a hardlink on OLD and GNU posix
modes, fixes a bug extracting hardlinks to symlinks.
Diffstat (limited to 'archival/libunarchive')
-rw-r--r--archival/libunarchive/get_header_tar.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 55c9a22f4..b66bd322b 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -29,6 +29,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
{
file_header_t *file_header = archive_handle->file_header;
union {
+ /* ustar header, Posix 1003.1 */
unsigned char raw[512];
struct {
char name[100]; /* 0-99 */
@@ -128,12 +129,6 @@ extern char get_header_tar(archive_handle_t *archive_handle)
file_header->mode |= S_IFREG;
}
break;
-#if 0
- /* hard links are detected as entries with 0 size, a link name,
- * and not being a symlink, hence we have nothing to do here */
- case '1':
- break;
-#endif
case '2':
file_header->mode |= S_IFLNK;
break;
@@ -150,6 +145,11 @@ extern char get_header_tar(archive_handle_t *archive_handle)
file_header->mode |= S_IFIFO;
break;
# endif
+ /* hard links are detected as entries with 0 size, a link name,
+ * and not being a symlink, hence we have nothing to do here */
+ case '1':
+ file_header->mode |= ~S_IFLNK;
+ break;
# ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
case 'L': {
longname = xmalloc(file_header->size + 1);