bin/131244: tar adds extra nul bytes at the end of non-emty files
in shar archives
Anonymous
swell.k at gmail.com
Sun Feb 1 01:10:07 PST 2009
>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 at 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:
More information about the freebsd-bugs
mailing list