From nobody@FreeBSD.org  Fri Jun 18 12:55:14 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41DE6106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2010 12:55:14 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 30BBC8FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2010 12:55:14 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ICtDwI037890
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2010 12:55:13 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o5ICtD64037889;
	Fri, 18 Jun 2010 12:55:13 GMT
	(envelope-from nobody)
Message-Id: <201006181255.o5ICtD64037889@www.freebsd.org>
Date: Fri, 18 Jun 2010 12:55:13 GMT
From: Rudolf Polzer <rpolzer@mucke-novak.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cpio -i cannot extract tar archives, breaking release builds
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         147969
>Category:       bin
>Synopsis:       cpio(1): cpio -i cannot extract tar archives, breaking release builds
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 18 13:00:14 UTC 2010
>Closed-Date:    Mon Jun 21 22:55:45 UTC 2010
>Last-Modified:  Mon Jun 21 23:00:02 UTC 2010
>Originator:     Rudolf Polzer
>Release:        7-STABLE
>Organization:
Vodafone
>Environment:
FreeBSD 7.3-STABLE FreeBSD 7.3-STABLE #0: Wed Jun 16 10:14:12 UTC 2010     root@freebsd:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
cpio (GNU cpio 2.8-FreeBSD) is unable to extract archives made by tar on 7-STABLE.

The bug had surfaced before in 8-CURRENT, but got fixed by instead replacing cpio by bsdcpio. See the mailing list discussion on:

http://kerneltrap.org/mailarchive/freebsd-current/2008/8/18/2980244/thread

This also e.g. surfaces when creating a release CD using release/Makefile, then trying to install from it - the installation routine will bail out on extracting the distributions.
>How-To-Repeat:
# tar cvf - /var/empty | cpio -i -t
tar: Removing leading '/' from member names
a var/empty
cpio: Malformed number 000555 
cpio: Malformed number 00000000166 
cpio: Malformed number 11351324133 
cpio: Malformed number 000000 
cpio: Malformed number 000000 
4 blocks

(note: the numbers all have a trailing space, causing the "Malformed" output)
>Fix:
Either: undo the upgrade to cpio 2.8
Or: use bsdcpio in 7-STABLE too
Or: change from_ascii() in contrib/cpio/src/copyin.c to accept trailing spaces

>Release-Note:
>Audit-Trail:
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 
State-Changed-From-To: open->closed 
State-Changed-By: delphij 
State-Changed-When: Mon Jun 21 22:54:58 UTC 2010 
State-Changed-Why:  
Patch from Tim have been committed against 7-STABLE. 

Thanks for your submission! 


Responsible-Changed-From-To: kientzle->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Mon Jun 21 22:54:58 UTC 2010 
Responsible-Changed-Why:  
Take.  I have tested the patch so bugs are mine. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/147969: commit references a PR
Date: Mon, 21 Jun 2010 22:54:58 +0000 (UTC)

 Author: delphij
 Date: Mon Jun 21 22:54:47 2010
 New Revision: 209406
 URL: http://svn.freebsd.org/changeset/base/209406
 
 Log:
   Fix a regression when dealing with tar(1) format files
   introduced with GNU cpio 2.8.
   
   This is a direct commit against stable/7 because the
   code have been removed on -HEAD and stable/8.
   
   PR:		bin/147969
   Submitted by:	kientzle
 
 Modified:
   stable/7/contrib/cpio/src/tar.c
 
 Modified: stable/7/contrib/cpio/src/tar.c
 ==============================================================================
 --- stable/7/contrib/cpio/src/tar.c	Mon Jun 21 22:20:52 2010	(r209405)
 +++ stable/7/contrib/cpio/src/tar.c	Mon Jun 21 22:54:47 2010	(r209406)
 @@ -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)
  {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
