Recognize and skip 'x' and 'g' pax extension entries. In particular,

this avoids the creation of "PaxHeader" dirs when unpacking pax-format
tar archives such as those written by bsdtar.

MFC after: 3 days
This commit is contained in:
kientzle 2004-08-28 03:13:05 +00:00
parent 826fb4fba8
commit fb64ba1c55

View File

@ -15,6 +15,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* $FreeBSD$ */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -343,6 +345,19 @@ read_in_tar_header (file_hdr, in_des)
else
file_hdr->c_mode |= CP_IFREG;
break;
case 'x': case 'g':
/* Ignore pax 'x' and 'g' extension entries. */
/* Skip body of this entry. */
while (file_hdr->c_filesize > 0) {
tape_buffered_read(((char *) &tar_rec), in_des, TARRECORDSIZE);
if (file_hdr->c_filesize > TARRECORDSIZE)
file_hdr->c_filesize -= TARRECORDSIZE;
else
file_hdr->c_filesize = 0;
}
/* Read next header and return that instead. */
read_in_tar_header(file_hdr, in_des);
break;
}
break;
}