diff options
| author | Glenn L McGrath <bug1@ihug.co.nz> | 2003-09-12 06:31:28 +0000 |
|---|---|---|
| committer | Glenn L McGrath <bug1@ihug.co.nz> | 2003-09-12 06:31:28 +0000 |
| commit | ef91bf67ed675cd6de2cc78acd930059fbefa375 (patch) | |
| tree | e50db73bddc0517cef8ed2c82e4280bc275085e6 | |
| parent | 51ed242ad6c94f34d01461afc7141579f855017d (diff) | |
| download | busybox-w32-ef91bf67ed675cd6de2cc78acd930059fbefa375.tar.gz busybox-w32-ef91bf67ed675cd6de2cc78acd930059fbefa375.tar.bz2 busybox-w32-ef91bf67ed675cd6de2cc78acd930059fbefa375.zip | |
Use the typeflag to identify if its a hardlink on OLD and GNU posix
modes, fixes a bug extracting hardlinks to symlinks.
| -rw-r--r-- | archival/libunarchive/get_header_tar.c | 12 |
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) | |||
| 29 | { | 29 | { |
| 30 | file_header_t *file_header = archive_handle->file_header; | 30 | file_header_t *file_header = archive_handle->file_header; |
| 31 | union { | 31 | union { |
| 32 | /* ustar header, Posix 1003.1 */ | ||
| 32 | unsigned char raw[512]; | 33 | unsigned char raw[512]; |
| 33 | struct { | 34 | struct { |
| 34 | char name[100]; /* 0-99 */ | 35 | char name[100]; /* 0-99 */ |
| @@ -128,12 +129,6 @@ extern char get_header_tar(archive_handle_t *archive_handle) | |||
| 128 | file_header->mode |= S_IFREG; | 129 | file_header->mode |= S_IFREG; |
| 129 | } | 130 | } |
| 130 | break; | 131 | break; |
| 131 | #if 0 | ||
| 132 | /* hard links are detected as entries with 0 size, a link name, | ||
| 133 | * and not being a symlink, hence we have nothing to do here */ | ||
| 134 | case '1': | ||
| 135 | break; | ||
| 136 | #endif | ||
| 137 | case '2': | 132 | case '2': |
| 138 | file_header->mode |= S_IFLNK; | 133 | file_header->mode |= S_IFLNK; |
| 139 | break; | 134 | break; |
| @@ -150,6 +145,11 @@ extern char get_header_tar(archive_handle_t *archive_handle) | |||
| 150 | file_header->mode |= S_IFIFO; | 145 | file_header->mode |= S_IFIFO; |
| 151 | break; | 146 | break; |
| 152 | # endif | 147 | # endif |
| 148 | /* hard links are detected as entries with 0 size, a link name, | ||
| 149 | * and not being a symlink, hence we have nothing to do here */ | ||
| 150 | case '1': | ||
| 151 | file_header->mode |= ~S_IFLNK; | ||
| 152 | break; | ||
| 153 | # ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS | 153 | # ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS |
| 154 | case 'L': { | 154 | case 'L': { |
| 155 | longname = xmalloc(file_header->size + 1); | 155 | longname = xmalloc(file_header->size + 1); |
