From katsu@miyoshi.matsuyama.ehime.jp  Fri May 23 05:18:30 2008
Return-Path: <katsu@miyoshi.matsuyama.ehime.jp>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9945D106567B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 May 2008 05:18:30 +0000 (UTC)
	(envelope-from katsu@miyoshi.matsuyama.ehime.jp)
Received: from mail.as.customer.ne.jp (mail09.as.customer.ne.jp [202.239.124.4])
	by mx1.freebsd.org (Postfix) with ESMTP id 3ACC58FC12
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 May 2008 05:18:29 +0000 (UTC)
	(envelope-from katsu@miyoshi.matsuyama.ehime.jp)
Received: (qmail 7986 invoked from network); 23 May 2008 13:51:49 +0900
Received: from unknown (HELO kmgw.miyoshi.matsuyama.ehime.jp) ([210.141.213.174])
  by mail.as.customer.ne.jp with SMTP; 23 May 2008 13:51:49 +0900
Received: by kmgw.miyoshi.matsuyama.ehime.jp (Postfix, from userid 2852)
	id 2FAB85E8402; Fri, 23 May 2008 13:51:49 +0900 (JST)
Message-Id: <20080523045149.2FAB85E8402@kmgw.miyoshi.matsuyama.ehime.jp>
Date: Fri, 23 May 2008 13:51:49 +0900 (JST)
From: Katsuyuki Miyoshi <katsu@miyoshi.matsuyama.ehime.jp>
Reply-To: Katsuyuki Miyoshi <katsu@miyoshi.matsuyama.ehime.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: cpio -oc bug with write_out_header()
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         123921
>Category:       gnu
>Synopsis:       [patch] cpio(1): cpio -oc bug with write_out_header()
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 23 05:20:01 UTC 2008
>Closed-Date:    Wed Mar 31 02:36:14 UTC 2010
>Last-Modified:  Wed Mar 31 02:36:14 UTC 2010
>Originator:     Katsuyuki Miyoshi
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
Katsuyuki Miyoshi, Ehime, Japan.
>Environment:
System: FreeBSD kmgw.miyoshi.matsuyama.ehime.jp 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Wed May 21 20:18:53 JST 2008 root@kmgw.miyoshi.matsuyama.ehime.jp:/usr/obj/usr/src/sys/KMGW i386


>Description:
	 cpio cannot use with -c option.
>How-To-Repeat:
	% find foo | cpio -oc > foo.cpio
	Internal overflow, aborting
>Fix:
--- contrib/cpio/src/copyout.c.org	2006-01-11 21:38:05.000000000 +0900
+++ contrib/cpio/src/copyout.c	2008-05-23 13:27:13.000000000 +0900
@@ -371,7 +371,7 @@ write_out_header (struct new_cpio_header
       /* Debian hack: The type of dev_t has changed in glibc.  Fixed output
          to ensure that a long int is passed to sprintf.  This has been
          reported to "bug-gnu-utils@prep.ai.mit.edu". (1998/5/26) -BEM */
-      snprintf (ascii_header, sizeof(ascii_header),
+      ret = snprintf (ascii_header, sizeof(ascii_header),
 	       "%06ho%06lo%06lo%06lo%06lo%06lo%06lo%06lo%011lo%06lo%011lo",
 	       file_hdr->c_magic & 0xFFFF, (long) dev & 0xFFFF,
 	       file_hdr->c_ino & 0xFFFF, file_hdr->c_mode & 0xFFFF,


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: brd 
State-Changed-When: Wed Mar 31 02:35:33 UTC 2010 
State-Changed-Why:  
Closed because GNU cpio has been replaced by libarchive(3). 

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