From owner-freebsd-bugs@FreeBSD.ORG Fri May 23 05:20:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5E8F106567C for ; Fri, 23 May 2008 05:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A79CE8FC18 for ; Fri, 23 May 2008 05:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4N5K1Cp074983 for ; Fri, 23 May 2008 05:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4N5K1JC074982; Fri, 23 May 2008 05:20:01 GMT (envelope-from gnats) Resent-Date: Fri, 23 May 2008 05:20:01 GMT Resent-Message-Id: <200805230520.m4N5K1JC074982@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Katsuyuki Miyoshi Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9945D106567B for ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: gnu/123921: cpio -oc bug with write_out_header() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Katsuyuki Miyoshi List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2008 05:20:01 -0000 >Number: 123921 >Category: gnu >Synopsis: cpio -oc bug with write_out_header() >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 23 05:20:01 UTC 2008 >Closed-Date: >Last-Modified: >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: >Unformatted: