From nobody@FreeBSD.org  Tue Dec  7 06:57:27 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D17B916A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  7 Dec 2004 06:57:27 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C270843D5C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  7 Dec 2004 06:57:27 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id iB76vRrA077356
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 7 Dec 2004 06:57:27 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id iB76vR7R077355;
	Tue, 7 Dec 2004 06:57:27 GMT
	(envelope-from nobody)
Message-Id: <200412070657.iB76vR7R077355@www.freebsd.org>
Date: Tue, 7 Dec 2004 06:57:27 GMT
From: Toerless Eckert <tte@fau.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cpio -p --sparse creates truncated files
X-Send-Pr-Version: www-2.3

>Number:         74801
>Category:       bin
>Synopsis:       cpio(1) -p --sparse creates truncated files
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 07 07:00:42 GMT 2004
>Closed-Date:    Sun Dec 20 10:28:37 UTC 2009
>Last-Modified:  Sun Dec 20 10:28:37 UTC 2009
>Originator:     Toerless Eckert
>Release:        5.3
>Organization:
>Environment:
FreeBSD eckert-mistpc 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov  5 04:19:18 UTC 2004     root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
Copying binary files from windows (.exe, .dll) with "cpio -p --sparse"
does create files that are truncated. These files seem to have multiple hole (0) segments and zero segments at the end of the files.

Copying works fine without "--sparse". 
>How-To-Repeat:
Try copying windows binaries or dlls. Example file is from Acrobat
Reader 5.0:
% echo ACROFX32.DLL | /usr/bin/cpio -p --sparse /tmp
% ls -l ACROFX32.DLL /tmp/ACROFX32.DLL 
-rw-r--r--  1 root    wheel  52224 Dec  6 17:49 /tmp/ACROFX32.DLL
-rw-r--r--  1 root    staff  53248 Apr 16  2001 ACROFX32.DLL

>Fix:

>Release-Note:
>Audit-Trail:

From: Nate Eldredge <nge@cs.hmc.edu>
To: bug-followup@FreeBSD.org, tte@fau.de
Cc:  
Subject: Re: bin/74801: cpio -p --sparse creates truncated files
Date: Thu, 13 Oct 2005 15:09:23 -0700 (PDT)

 This appears to have been fixed in CURRENT with the merge of GNU cpio 2.6. 
 I can't reproduce it there, but I can on 5.4-RELEASE-p7.
 
 I posted a copy of the file in question at 
 http://www.cs.hmc.edu/~nate/sparse-testcase.bin .  It appears to depend on 
 the specific file, since a simple testcase made with echo and truncate 
 didn't trigger the bug.
 
 -- 
 Nate Eldredge
 nge@cs.hmc.edu
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Sun Dec 20 10:19:32 UTC 2009 
State-Changed-Why:  
Reportedly fixed in GNU cpio 2.6. In head and stable/8 cpio(1) is 
bsdcpio by default. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=74801 
>Unformatted:
