PATCH] untar: do not exit with error when created directory already exists (fixes #2413).

Pavel Pisa pisa at cmp.felk.cvut.cz
Wed Sep 9 21:30:38 UTC 2015


Hello Gedare,

On Wednesday 09 of September 2015 17:05:43 Gedare Bloom wrote:
> Do we still have two versions of the untar code?

There is another implementation which is IMFS specific.
It is invoked by function rtems_tarfs_load() located in

  rtems/cpukit/libfs/src/imfs/imfs_load_tar.c

It is better optimized that it does not copy data from image
to RAM. But on the other hand is specific for IMFS only.

The corrected implementation

  rtems/cpukit/libmisc/untar/untar.c

is generic untar code which is independent on filesystem.
So it can be used (in theory) to untar file to FAT or other
filesystems  and supports untar from memory Untar_FromMemory()
and Untar_FromFile(). It has disadvantage that does not easily
support to specify location where to untar when compared
with rtems_tarfs_load().

So both implementations are not 1:1 feature equivalent.
The rtems_tarfs_load() has been introduced in 2000 year.

We use Untar_FromMemory() in our application but it may
be more for historical reasons than that use of rtems_tarfs_load()
would not provide same function and rtems_tarfs_load() is much
less memory hungry than Untar_FromMemory().

But I think that it would worth to fix untar.c when it is present.
It correctly worked in previous releases and (as I have located now)
has been broken at commit e075b388728408e8745408c8dbdbe9635ccea399
  untar: check return value from mkdir
by Gedare Bloom :-)

Best wishes,

             Pavel

> This looks good to commit.
>
> On Mon, Sep 7, 2015 at 5:23 AM, Pavel Pisa <pisa at cmp.felk.cvut.cz> wrote:
> > ---
> >  cpukit/libmisc/untar/untar.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/cpukit/libmisc/untar/untar.c b/cpukit/libmisc/untar/untar.c
> > index aed8fed..4591a8b 100644
> > --- a/cpukit/libmisc/untar/untar.c
> > +++ b/cpukit/libmisc/untar/untar.c



More information about the devel mailing list