diff options
Diffstat (limited to 'archival/libarchive')
| -rw-r--r-- | archival/libarchive/get_header_tar.c | 28 | ||||
| -rw-r--r-- | archival/libarchive/open_transformer.c | 7 |
2 files changed, 24 insertions, 11 deletions
diff --git a/archival/libarchive/get_header_tar.c b/archival/libarchive/get_header_tar.c index 2dbcdb50c..fb68673b9 100644 --- a/archival/libarchive/get_header_tar.c +++ b/archival/libarchive/get_header_tar.c | |||
| @@ -350,7 +350,14 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) | |||
| 350 | case '6': | 350 | case '6': |
| 351 | file_header->mode |= S_IFIFO; | 351 | file_header->mode |= S_IFIFO; |
| 352 | goto size0; | 352 | goto size0; |
| 353 | case 'g': /* pax global header */ | ||
| 354 | case 'x': { /* pax extended header */ | ||
| 355 | if ((uoff_t)file_header->size > 0xfffff) /* paranoia */ | ||
| 356 | goto skip_ext_hdr; | ||
| 357 | process_pax_hdr(archive_handle, file_header->size, (tar.typeflag == 'g')); | ||
| 358 | goto again_after_align; | ||
| 353 | #if ENABLE_FEATURE_TAR_GNU_EXTENSIONS | 359 | #if ENABLE_FEATURE_TAR_GNU_EXTENSIONS |
| 360 | /* See http://www.gnu.org/software/tar/manual/html_node/Extensions.html */ | ||
| 354 | case 'L': | 361 | case 'L': |
| 355 | /* free: paranoia: tar with several consecutive longnames */ | 362 | /* free: paranoia: tar with several consecutive longnames */ |
| 356 | free(p_longname); | 363 | free(p_longname); |
| @@ -370,18 +377,17 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) | |||
| 370 | archive_handle->offset += file_header->size; | 377 | archive_handle->offset += file_header->size; |
| 371 | /* return get_header_tar(archive_handle); */ | 378 | /* return get_header_tar(archive_handle); */ |
| 372 | goto again; | 379 | goto again; |
| 373 | case 'D': /* GNU dump dir */ | 380 | /* |
| 374 | case 'M': /* Continuation of multi volume archive */ | 381 | * case 'S': // Sparse file |
| 375 | case 'N': /* Old GNU for names > 100 characters */ | 382 | * Was seen in the wild. Not supported (yet?). |
| 376 | case 'S': /* Sparse file */ | 383 | * See https://www.gnu.org/software/tar/manual/html_section/tar_92.html |
| 377 | case 'V': /* Volume header */ | 384 | * for the format. (An "Old GNU Format" was seen, not PAX formats). |
| 385 | */ | ||
| 386 | // case 'D': /* GNU dump dir */ | ||
| 387 | // case 'M': /* Continuation of multi volume archive */ | ||
| 388 | // case 'N': /* Old GNU for names > 100 characters */ | ||
| 389 | // case 'V': /* Volume header */ | ||
| 378 | #endif | 390 | #endif |
| 379 | case 'g': /* pax global header */ | ||
| 380 | case 'x': { /* pax extended header */ | ||
| 381 | if ((uoff_t)file_header->size > 0xfffff) /* paranoia */ | ||
| 382 | goto skip_ext_hdr; | ||
| 383 | process_pax_hdr(archive_handle, file_header->size, (tar.typeflag == 'g')); | ||
| 384 | goto again_after_align; | ||
| 385 | } | 391 | } |
| 386 | skip_ext_hdr: | 392 | skip_ext_hdr: |
| 387 | { | 393 | { |
diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c index 0a8c657b7..1c5c185d0 100644 --- a/archival/libarchive/open_transformer.c +++ b/archival/libarchive/open_transformer.c | |||
| @@ -183,6 +183,13 @@ static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_comp | |||
| 183 | USE_FOR_NOMMU(xstate->xformer_prog = "gunzip";) | 183 | USE_FOR_NOMMU(xstate->xformer_prog = "gunzip";) |
| 184 | goto found_magic; | 184 | goto found_magic; |
| 185 | } | 185 | } |
| 186 | if (ENABLE_FEATURE_SEAMLESS_Z | ||
| 187 | && magic.b16[0] == COMPRESS_MAGIC | ||
| 188 | ) { | ||
| 189 | xstate->xformer = unpack_Z_stream; | ||
| 190 | USE_FOR_NOMMU(xstate->xformer_prog = "uncompress";) | ||
| 191 | goto found_magic; | ||
| 192 | } | ||
| 186 | if (ENABLE_FEATURE_SEAMLESS_BZ2 | 193 | if (ENABLE_FEATURE_SEAMLESS_BZ2 |
| 187 | && magic.b16[0] == BZIP2_MAGIC | 194 | && magic.b16[0] == BZIP2_MAGIC |
| 188 | ) { | 195 | ) { |
