Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jun 2010 18:52:41 -0700
From:      Tim Kientzle <kientzle@freebsd.org>
To:        linimon@freebsd.org
Cc:        freebsd-bugs@freebsd.org
Subject:   Re: bin/147969: cpio(1): cpio -i cannot extract tar archives, breaking release builds
Message-ID:  <4C1C22E9.8000103@freebsd.org>
In-Reply-To: <201006182125.o5ILPUCw007404@freefall.freebsd.org>
References:  <201006182125.o5ILPUCw007404@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------000108040902070706050304
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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

linimon@FreeBSD.org 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
> 
> 

--------------000108040902070706050304
Content-Type: text/x-patch;
 name="gnu-cpio.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="gnu-cpio.patch"

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)
 {

--------------000108040902070706050304--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C1C22E9.8000103>