Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Feb 2009 11:43:40 +0300
From:      Anonymous <swell.k@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/131244: tar adds extra nul bytes at the end of non-emty files in shar archives
Message-ID:  <86hc3efsxv.fsf@gmail.com>
Resent-Message-ID: <200902010910.n119A6qo050826@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86hc3efsxv.fsf>