diff options
-rw-r--r-- | archival/libarchive/get_header_tar.c | 28 |
1 files changed, 17 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 | { |