Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Dec 2005 17:54:04 -0500
From:      Brian Fundakowski Feldman <green@freebsd.org>
To:        Steven Hartland <killing@multiplay.co.uk>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: bsdtar / libarchive bug?
Message-ID:  <20051208225404.GF98704@green.homeunix.org>
In-Reply-To: <00c701c5fc1c$e6db4220$b3db87d4@multiplay.co.uk>
References:  <00c701c5fc1c$e6db4220$b3db87d4@multiplay.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 08, 2005 at 05:29:06PM -0000, Steven Hartland wrote:
> It seems bsdtar can create files it cant read. i.e. it will happily create
> empty tar.gz files but when it comes to read them the following error
> is output:
> tar: Unrecognized archive format: Inappropriate file type or format
> 
> Having a look at libarchive shows the following code:
>    /* An empty archive is a serious error. */
>    if (bytes_read == 0) {
>        archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
>            "Empty input file");
>        return (ARCHIVE_FATAL);
>    }
> 
> Which is where I expect the issue is, why would an empty archive
> be fatal? I can see any reason for this, yes its strange but there's
> nothing fatal about it imo.

I don't think it will "happily create empty tar.gz files", even where
by empty you mean the tar itself inside of the gz.

{"/home/green" green@green}$ tar cfv x.tar
tar: no files or directories specified
{"/home/green" green@green}$ tar cfvz x.tar.gz
tar: no files or directories specified
{"/home/green" green@green}$ ls -l x.ta*
ls: x.ta*: No such file or directory

-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green@FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\



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