bin/118782: shar sometimes creates broken archives
Bjoern Koenig
bkoenig at alpha-tierchen.de
Mon Dec 17 08:50:02 PST 2007
>Number: 118782
>Category: bin
>Synopsis: shar sometimes creates broken archives
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Dec 17 16:50:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator: Bjoern Koenig
>Release: affects all releases
>Organization:
>Environment:
>Description:
The shar(1) utility creates EOF markers from the pathname
of a file. The length EOF markers are restricted to 79
bytes by sh(1). If the length of the EOF marker created
by shar exceeds this limit then you'll get an error while
extracting the archive:
Syntax error: Illegal eof marker for << redirection
>How-To-Repeat:
$ mkdir -p this/is/a/long/path/name/for/demonstration/of/a/bug
$ echo test > this/is/a/long/path/name/for/demonstration/of/a/bug/and-this-is-a-filename
$ shar `find this -type f` > archive
$ sh archive
x - this/is/a/long/path/name/for/demonstration/of/a/bug/and-this-is-a-filename
archive: 11: Syntax error: Illegal eof marker for << redirection
>Fix:
I do not provide a patch yet since there are several solutions which
should be discussed:
a) increase EOFMARKLEN in src/bin/sh/parser.c
This won't actually solve the problem, but shifts it away if
EOFMARKLEN is reasonable large enough.
b) change sh that it doesn't restrict length of the EOF marker
This is possible and in my opinion most elegant.
c) change shar to respect the limitation of sh
This is almost unjustifiable, because the shar utility is an
incredibly simple shell script and this solution requires to
add complex code.
d) add a small notice to the BUGS section of shar's manpage
Suggest also to use another shell code interpreter
to extract the archive, e.g. bash.
Choose one!
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list