5.3-BETA1 spews PaxHeader directories

Tim Kientzle kientzle at freebsd.org
Fri Aug 27 17:36:37 PDT 2004


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
-------------- next part --------------
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
@@ -343,6 +343,19 @@
 	  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;
     }


More information about the freebsd-current mailing list