From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 1 09:10:07 2009 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 11A951065746 for ; Sun, 1 Feb 2009 09:10:07 +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 DF65C8FC1A for ; Sun, 1 Feb 2009 09:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n119A6MX050827 for ; Sun, 1 Feb 2009 09:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n119A6qo050826; Sun, 1 Feb 2009 09:10:06 GMT (envelope-from gnats) Resent-Date: Sun, 1 Feb 2009 09:10:06 GMT Resent-Message-Id: <200902010910.n119A6qo050826@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, Anonymous Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F405A10656DC for ; Sun, 1 Feb 2009 09:08:12 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id 82E068FC17 for ; Sun, 1 Feb 2009 09:08:12 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so298657fgb.35 for ; Sun, 01 Feb 2009 01:08:11 -0800 (PST) Received: by 10.86.80.17 with SMTP id d17mr218165fgb.14.1233477824019; Sun, 01 Feb 2009 00:43:44 -0800 (PST) Received: from localhost (78-106-78-214.broadband.corbina.ru [78.106.78.214]) by mx.google.com with ESMTPS id 12sm1179517fgg.53.2009.02.01.00.43.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Feb 2009 00:43:42 -0800 (PST) Message-Id: <86hc3efsxv.fsf@gmail.com> Date: Sun, 01 Feb 2009 11:43:40 +0300 From: Anonymous To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/131244: tar adds extra nul bytes at the end of non-emty files in shar archives 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: Sun, 01 Feb 2009 09:10:07 -0000 >Number: 131244 >Category: bin >Synopsis: tar adds extra nul chars at the end of non-emty files in shar archives >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Feb 01 09:10:06 UTC 2009 >Closed-Date: >Last-Modified: >Originator: >Release: FreeBSD 8.0-CURRENT amd64 >Organization: >Environment: System: FreeBSD luffy 8.0-CURRENT FreeBSD 8.0-CURRENT #0 r187947M: Sat Jan 31 12:03:24 UTC 2009 root@luffy:/usr/obj/usr/src/sys/PHOENIX amd64 >Description: >How-To-Repeat: $ touch foo bar $ tar cf a.shar --format shar foo bar $ vis a.shar #!/bin/sh # This is a shell archive echo x foo test -e "foo" || :> "foo" echo x bar test -e "bar" || :> "bar" exit $ echo blah >bar $ tar cf a.shar --format shar foo bar $ vis a.shar #!/bin/sh # This is a shell archive echo x foo test -e "foo" || :> "foo" echo x bar sed 's/^X//' > bar << 'SHAR_END' Xblah X\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@ [...] \^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@\^@ SHAR_END exit >Fix: create tar archive first and convert it to shar one $ tar cf a.shar --format shar @a.tar >Release-Note: >Audit-Trail: >Unformatted: