From owner-freebsd-bugs@FreeBSD.ORG Sat Jun 19 02:06:22 2010 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AA38106566C; Sat, 19 Jun 2010 02:06:22 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE5F8FC1B; Sat, 19 Jun 2010 02:06:21 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.3/8.14.3) id o5J1r1MZ082202; Sat, 19 Jun 2010 01:53:01 GMT (envelope-from kientzle@freebsd.org) Received: from horton.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id 8xg84hhshrcvnu4ta3kki6yy7a; Sat, 19 Jun 2010 01:53:00 +0000 (UTC) (envelope-from kientzle@freebsd.org) Message-ID: <4C1C22E9.8000103@freebsd.org> Date: Fri, 18 Jun 2010 18:52:41 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.23) Gecko/20100314 SeaMonkey/1.1.18 MIME-Version: 1.0 To: linimon@freebsd.org References: <201006182125.o5ILPUCw007404@freefall.freebsd.org> In-Reply-To: <201006182125.o5ILPUCw007404@freefall.freebsd.org> Content-Type: multipart/mixed; boundary="------------000108040902070706050304" Cc: freebsd-bugs@freebsd.org Subject: Re: bin/147969: cpio(1): cpio -i cannot extract tar archives, breaking release builds X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 02:06:22 -0000 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--