[PATCH] Allows tar to extract from archives with pax extensions

Erik Frederiksen erik_frederiksen at pmc-sierra.com
Thu Jul 6 12:29:46 PDT 2006


This patch allows busybox tar to extract tar archives that use the pax
extensions.  I noticed that old versions of GNU tar extract the
pax_global_header file as a regular file and duplicated that behaviour.

Here's a few of Linus' thoughts on the situation.
http://lkml.org/lkml/2005/6/18/5

I originally wrote this for 1.0, but the patch applied to 1.2 with no
problems.  I look forward to hearing your comments.

Erik Frederiksen
Firmware Design Engineer Co-op
PMC-Sierra Saskatoon




--- a/archival/libunarchive/get_header_tar.c    2005-08-16
19:29:11.000000000 -0600
+++ b/archival/libunarchive/get_header_tar.c    2006-07-06
11:47:29.000000000 -0600
@@ -144,8 +144,15 @@
                file_header->mode |= S_IFREG;
                break;
        case 'x':
+               bb_error_msg_and_die( "pax is not tar" );
+               break;
        case 'g':
-               bb_error_msg_and_die("pax is not tar");
+               bb_error_msg(
+             "%s: Unknown file type '%c', treating as a regular file.",
+                       file_header->name,
+                       tar.formated.typeflag
+               );
+               file_header->mode |= S_IFREG;
                break;
        case '7':
                /* Reserved for high performance files, treat as normal
file */



More information about the busybox mailing list