From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 17 16:50:02 2007 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 0D3E416A419 for ; Mon, 17 Dec 2007 16:50:02 +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 E810713C448 for ; Mon, 17 Dec 2007 16:50: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 lBHGo1Hh059376 for ; Mon, 17 Dec 2007 16:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBHGo1ur059375; Mon, 17 Dec 2007 16:50:01 GMT (envelope-from gnats) Resent-Date: Mon, 17 Dec 2007 16:50:01 GMT Resent-Message-Id: <200712171650.lBHGo1ur059375@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, Bjoern Koenig Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 476AA16A55A for ; Mon, 17 Dec 2007 16:41:53 +0000 (UTC) (envelope-from bkoenig@alpha-tierchen.de) Received: from mail.liberty-hosting.de (mail.smartterra.de [195.225.132.203]) by mx1.freebsd.org (Postfix) with ESMTP id 1830D13C458 for ; Mon, 17 Dec 2007 16:41:52 +0000 (UTC) (envelope-from bkoenig@alpha-tierchen.de) Received: from home.alpha-tierchen.de (port-212-202-40-215.dynamic.qsc.de [212.202.40.215]) by mail.liberty-hosting.de (Postfix) with ESMTP id 226F33E95F2 for ; Mon, 17 Dec 2007 17:41:41 +0100 (CET) Received: by home.alpha-tierchen.de (Postfix, from userid 2000) id 0E2C428689; Mon, 17 Dec 2007 17:40:20 +0100 (CET) Message-Id: <20071217164020.0E2C428689@home.alpha-tierchen.de> Date: Mon, 17 Dec 2007 17:40:20 +0100 (CET) From: Bjoern Koenig To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/118782: shar sometimes creates broken archives X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bjoern Koenig List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 16:50:02 -0000 >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: