Merge from old tar.c rev 1.2: Recognize and skip 'x' and 'g' pax

extension entries.
This commit is contained in:
Tim J. Robbins 2005-10-01 05:42:44 +00:00
parent 2437584cf0
commit 56160607b6

View File

@ -1,3 +1,5 @@
/* $FreeBSD$ */
/* tar.c - read in write tar headers for cpio
Copyright (C) 1992, 2001, 2004 Free Software Foundation, Inc.
@ -402,6 +404,19 @@ read_in_tar_header (struct new_cpio_header *file_hdr, int 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;
}