Re: 5.3-BETA1 spews PaxHeader directories

From: Tim Kientzle <kientzle_at_freebsd.org>
Date: Fri, 27 Aug 2004 17:36:36 -0700
Ceri Davies wrote:
> I've just installed 5.3-BETA1/i386 from the ISOs distributed the other
> week, and have found my file hierarchy littered with PaxHeader
> directories.
> 
> I understand where they've come from, but new users may not, and they're
> also unlikely to know whether they're safe to delete.

Here's one possible solution:  The attached patch modifies
cpio to recognize and ignore the pax extensions.

Tim

Index: tar.c
===================================================================
RCS file: /home/ncvs/src/contrib/cpio/tar.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 tar.c
--- tar.c	29 Mar 1997 22:40:44 -0000	1.1.1.1
+++ tar.c	28 Aug 2004 00:29:40 -0000
_at__at_ -343,6 +343,19 _at__at_
 	  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;
     }
Received on Fri Aug 27 2004 - 22:36:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:09 UTC