I believe the attached patch to stable/7 fixes this,
but I've not had a chance to test it yet.

If you could try this and let me know, I'm happy
to commit it if it works.

Cheers,
Tim

[email protected] wrote:
Old Synopsis: cpio -i cannot extract tar archives, breaking release builds
New Synopsis: cpio(1): cpio -i cannot extract tar archives, breaking release 
builds

Responsible-Changed-From-To: freebsd-bugs->kientzle
Responsible-Changed-By: linimon
Responsible-Changed-When: Fri Jun 18 21:24:34 UTC 2010
Responsible-Changed-Why: Tim, can you comment on this one please? Thanks.

http://www.freebsd.org/cgi/query-pr.cgi?pr=147969


Index: contrib/cpio/src/tar.c
===================================================================
--- contrib/cpio/src/tar.c	(revision 209324)
+++ contrib/cpio/src/tar.c	(working copy)
@@ -32,6 +32,32 @@
 
 /* Stash the tar linkname in static storage.  */
 
+#undef FROM_OCTAL
+#define FROM_OCTAL(f)	tar_otoa(f, sizeof f)
+
+/* Convert the string of octal digits S into a number.
+ * Converted from GNU cpio 2.6 sources in
+ * order to fix tar breakage caused by using
+ * from_ascii.
+ */
+static unsigned long
+tar_otoa(const char *where, size_t digs)
+{
+  const char *s = where;
+  const char *end = s + digs;
+  unsigned long val = 0;
+
+  while (s < end && *s == ' ')
+    ++s;
+  while (s < end && *s >= '0' && *s <= '7')
+    val = 8 * val + *s++ - '0';
+  while (s < end && (*s == ' ' || *s == '\0'))
+    ++s;
+  if (s < end)
+	  error (0, 0, _("Malformed number %.*s"), digs, where);
+  return val;
+}
+
 static char *
 stash_tar_linkname (char *linkname)
 {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to