summaryrefslogtreecommitdiffstats
path: root/contrib/cpio
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2005-10-01 05:42:44 +0000
committertjr <tjr@FreeBSD.org>2005-10-01 05:42:44 +0000
commit6b16a660d3089ee16c46212092cd7c6c1e592924 (patch)
treed239fbd07751232e4b5c67cc92e555653ab77667 /contrib/cpio
parent058cbad8094e4a18727e0f0366e1f5b2cbc25468 (diff)
downloadFreeBSD-src-6b16a660d3089ee16c46212092cd7c6c1e592924.zip
FreeBSD-src-6b16a660d3089ee16c46212092cd7c6c1e592924.tar.gz
Merge from old tar.c rev 1.2: Recognize and skip 'x' and 'g' pax
extension entries.
Diffstat (limited to 'contrib/cpio')
-rw-r--r--contrib/cpio/src/tar.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/cpio/src/tar.c b/contrib/cpio/src/tar.c
index 939d83a..75db547 100644
--- a/contrib/cpio/src/tar.c
+++ b/contrib/cpio/src/tar.c
@@ -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;
}
OpenPOWER on IntegriCloud