diff options
| -rw-r--r-- | archival/libarchive/get_header_tar.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/archival/libarchive/get_header_tar.c b/archival/libarchive/get_header_tar.c index f73cd338e..79caff55a 100644 --- a/archival/libarchive/get_header_tar.c +++ b/archival/libarchive/get_header_tar.c | |||
| @@ -348,10 +348,20 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) | |||
| 348 | /* Set bits 12-15 of the files mode */ | 348 | /* Set bits 12-15 of the files mode */ |
| 349 | /* (typeflag was not trashed because chksum does not use getOctal) */ | 349 | /* (typeflag was not trashed because chksum does not use getOctal) */ |
| 350 | switch (tar.typeflag) { | 350 | switch (tar.typeflag) { |
| 351 | /* busybox identifies hard links as being regular files with 0 size and a link name */ | 351 | case '1': /* hardlink */ |
| 352 | case '1': | 352 | /* we mark hardlinks as regular files with zero size and a link name */ |
| 353 | file_header->mode |= S_IFREG; | 353 | file_header->mode |= S_IFREG; |
| 354 | break; | 354 | /* on size of link fields from star(4) |
| 355 | * ... For tar archives written by pre POSIX.1-1988 | ||
| 356 | * implementations, the size field usually contains the size of | ||
| 357 | * the file and needs to be ignored as no data may follow this | ||
| 358 | * header type. For POSIX.1- 1988 compliant archives, the size | ||
| 359 | * field needs to be 0. For POSIX.1-2001 compliant archives, | ||
| 360 | * the size field may be non zero, indicating that file data is | ||
| 361 | * included in the archive. | ||
| 362 | * i.e; always assume this is zero for safety. | ||
| 363 | */ | ||
| 364 | goto size0; | ||
| 355 | case '7': | 365 | case '7': |
| 356 | /* case 0: */ | 366 | /* case 0: */ |
| 357 | case '0': | 367 | case '0': |
