#2207 closed enhancement (fixed)

RTEMS tar does not overwrite.

Reported by: Chris Johns Owned by: Chris Johns
Priority: low Milestone: 5.1
Component: unspecified Version: 4.11
Severity: normal Keywords: tar
Cc: Blocked By:
Blocking:

Description

A host tar by default will overwrite the contents of a directory. A sort of refresh. The RTEMS tar requires you remove the existing files rather than overwrite. This is dangerous because you have to remove files yet you do not know if the tar will be successful and moving and saving files assumes you know the contents of the tar file before hand.

Tar should be changed to overwrite and so allow files to be refreshed.

Consistence of files should be managed outside of tar via hashes or checksums.

Change History (6)

comment:1 Changed on 12/03/14 at 10:15:43 by Chris Johns

Running some tests wth tar on MacOS I see tar updates by removing files before outputting the new file. The example shown chowns x1/d1 to root while x1/d1/f1 is still owned by me:

$ tar xf z1.tar
x1/d1/: Can't update time for x1/d1
x1/d1/f2: Can't unlink already-existing object
tar: Error exit delayed from previous errors.

Looks like a delete tree needs to be added.

comment:2 Changed on 12/18/14 at 09:12:11 by Sebastian Huber

Milestone: 4.115.0
Priority: highestlow

comment:3 Changed on 06/04/16 at 00:11:31 by Chris Johns <chrisj@…>

Resolution: fixed
Status: newclosed

In d84e346b26017f021c1a7d5c8ad078c7264240ab/rtems:

libmisc/untar: Support directory create and overwrites. Share the common code.

Support creating directories for files with a path depth greater than 1. Some
tar files can have files with a path depth greater than 1 and no directory
entry in the tar file to create a directory.

Support overwriting existing files and directories failing in a similar
way to tar on common hosts. If a file is replaced with a file delete the
file and create a new file. If a directory replaces a file remove the file
and create the directory. If a file replaces a directory remove the directory,
and if the directory is not empty and cannot be removed report an error. If a
directory alreday exists do nothing leaving the contents untouched.

The untar code now shares the common header parsing and initial processing
with the actual writes still separate. No changes to the IMFS have been made.

Updates #2415.
Closes #2207.

comment:4 Changed on 10/05/17 at 08:33:00 by Sebastian Huber

Milestone: 5.04.12.0

comment:5 Changed on 10/10/17 at 06:35:44 by Sebastian Huber

Component: miscunspecified

comment:6 Changed on 11/09/17 at 06:27:14 by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.