summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/untar/untar.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-04-06libmisc/untar: Use a larger block size to read and write filesChris Johns1-20/+33
- A larger block size lets files systems work better. On JFFS a 512 byte compressed block means lots of small flash updates Closes #4635
2022-03-22cpukit/libmisc/untar: Change license to BSD-2Joel Sherrill1-3/+22
Updates #3053.
2021-12-09untar: Make behavior similar to GNU or BSD tarChristian Mauderer1-20/+37
RTEMS untar implementation had problems with overwriting or integrating archives into existing directory structures. This patch adapts the behavior to mimic that of a GNU tar or BSD tar and extends the tar01 test to check for the behavior. That is: * If a directory structure exists, the files from the archive will be integrated. Existing files are overwritten. * If a file exists and the archive contains a directory with the same name, the file is removed and a directory is created. In the above example: if l1/l2 is a file it will be overwritten with a new directory. * If a directory exists and the archive contains a file with the same name, the directory will be replaced if it is empty. If it contains files, the result is an error. * An archive also can contain only a file without the parent directories. If in that case one of the parent directories exists as a file extracting the archive results in an error. In the example: if l1/l2 is a file and the archive doesn't contain the directories but only the file l1/l2/x.txt that would be an error. * In case of an error, it is possible that the archive has been partially extracted. Closes #4568
2019-11-26untar: Properly make parent pathSebastian Huber1-144/+46
Close #3823.
2019-11-25untar: Make path also for symbolic linksSebastian Huber1-9/+8
Close #3823.
2019-11-25untar: Unify untar supportSebastian Huber1-94/+87
Update #3823.
2016-11-18Fix untar mkdir when the directory exists.Chris Johns1-3/+5
2016-08-09libmisc/untar: Set the perms to the value in the tar file.Chris Johns1-19/+28
This patch parses the mode field in the tar header and sets the directory or file to the mode value in the header. Closes #2768.
2016-07-26Add Untar_FromChunk_Print() + TestAlexander Krutwig1-1/+104
2016-06-03libmisc/untar: Support directory create and overwrites. Share the common code.Chris Johns1-126/+337
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.
2015-11-23untar: do not exit with error when created directory already exists.Pavel Pisa1-1/+29
The problem exists for both RTEMS untar implementations and their variants: Untar_FromMemory(), Untar_FromFile() and rtems_tarfs_load(). If filesystem object already exists at extracted directory path then if it is directory, creation is ignored. Attempt to delete/unlink object and make directory is tried for other cases. This simple approach problem reported in ticket fixes #2413. Behavior follows GNU tar and BSD tar practice for directories but much more work is required to achieve full semantics of the full featured tar implementation still.
2015-01-04untar.c: Coverity ID 26151 and reformatJoel Sherrill1-295/+251
The Coverity issue was an ignored return value from a read() in a loop which should have been a seek() since the data read was ignored. The file itself needed reformatting to conform to RTEMS style.
2014-11-21Delete or rename MIN/MAX macros and definesSebastian Huber1-3/+1
Include <sys/param.h> if necessary to get the MIN()/MAX() macros.
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2013-09-05untar: check return value from mkdirGedare Bloom1-1/+5
Check the return value from mkdir instead of failing silently. 1063857 Unchecked return value from library
2013-08-26Stop a resource leakCynthia Rempel1-0/+1
Stops a resource leak in the event that the system cannot malloc
2012-12-19libmisc: Doxygen Enhancement Task #2Mathew Kallada1-2/+11
http://www.google-melange.com/gci/task/view/google/gci2012/7959228
2012-05-11Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill1-2/+0
Script does what is expected and tries to do it as smartly as possible. + remove occurrences of two blank comment lines next to each other after Id string line removed. + remove entire comment blocks which only exited to contain CVS Ids + If the processing left a blank line at the top of a file, it was removed.
2011-11-072011-11-07 Ralf Corsepius <ralf.corsepius@rtems.org>Joel Sherrill1-0/+1
PR 1952/cpukit * libmisc/untar/untar.c: Add return code for failure when unable to write file.
2010-08-242010-08-24 Ralf Corsépius <ralf.corsepius@rtems.org>Ralf Corsepius1-6/+8
* libmisc/untar/untar.c: Return if open fails. Use ssize_t for read() return value.
2010-07-272010-07-27 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-3/+4
* libfs/src/imfs/imfs_load_tar.c, libmisc/untar/untar.c: Now supports both pax and GNU tar created tar files.
2007-09-052007-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-6/+7
* libmisc/untar/untar.c, libmisc/untar/untar.h: Clean up prototype.
2007-09-042007-09-04 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-16/+23
* libmisc/untar/untar.c, libmisc/untar/untar.h: Add const to char *. Use printk.
2005-02-092005-02-09 Ralf Corsepius <ralf.corsepius@rtems.org>Ralf Corsepius1-5/+2
* libmisc/untar/untar.c (_rtems_octal2ulong): Replace.
2005-02-072005-02-07 Ralf Corsepius <ralf.corsepius@rtems.org>Ralf Corsepius1-48/+39
* libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_load_tar.c, libmisc/untar/untar.c, libmisc/untar/untar.h: Various generalizations and fixes.
2005-01-272005-01-27 Ralf Corsepius <ralf.corsepius@rtems.org>Ralf Corsepius1-8/+8
* libmisc/untar/untar.h: New prototype to eleminate warnings. * libmisc/untar/untar.c: Cosmetics, add symlinks.
2004-04-172004-04-17 Ralf Corsepius <ralf_corsepius@rtems.org>Ralf Corsepius1-2/+2
* libmisc/capture/capture-cli.c, libmisc/cpuuse/cpuuse.c, libmisc/dumpbuf/dumpbuf.c, libmisc/fsmount/fsmount.c, libmisc/monitor/mon-command.c, libmisc/monitor/mon-config.c, libmisc/monitor/mon-dname.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-extension.c, libmisc/monitor/mon-itask.c, libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-mpci.c, libmisc/monitor/mon-object.c, libmisc/monitor/mon-prmisc.c, libmisc/monitor/mon-queue.c, libmisc/monitor/mon-symbols.c, libmisc/monitor/mon-task.c, libmisc/rtmonuse/rtmonuse.c, libmisc/shell/cmds.c, libmisc/shell/shell.c, libmisc/shell/shell.h, libmisc/stackchk/check.c, libmisc/untar/untar.c: Use fprintf(stdout,...) instead of printf.
2004-04-16Remove stray white spaces.Ralf Corsepius1-3/+3
2004-04-15Remove stray white spaces.Ralf Corsepius1-1/+0
2003-09-042003-09-04 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-1/+1
* cpuuse/cpuuse.c, cpuuse/cpuuse.h, devnull/devnull.c, devnull/devnull.h, dummy/dummy.c, dumpbuf/dumpbuf.c, dumpbuf/dumpbuf.h, fsmount/fsmount.c, fsmount/fsmount.h, serdbg/serdbgio.c, serdbg/termios_printk.c, stackchk/check.c, stackchk/internal.h, stackchk/stackchk.h, untar/untar.c, untar/untar.h: URL for license changed.
2003-07-082003-07-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>Ralf Corsepius1-0/+4
* capture/capture-cli.c: Add config-header support. * capture/capture.c: Add config-header support. * cpuuse/cpuuse.c: Add config-header support. * devnull/devnull.c: Add config-header support. * dummy/dummy.c: Add config-header support. * dumpbuf/dumpbuf.c: Add config-header support. * monitor/mon-command.c: Add config-header support. * monitor/mon-config.c: Add config-header support. * monitor/mon-dname.c: Add config-header support. * monitor/mon-driver.c: Add config-header support. * monitor/mon-extension.c: Add config-header support. * monitor/mon-itask.c: Add config-header support. * monitor/mon-manager.c: Add config-header support. * monitor/mon-monitor.c: Add config-header support. * monitor/mon-mpci.c: Add config-header support. * monitor/mon-object.c: Add config-header support. * monitor/mon-prmisc.c: Add config-header support. * monitor/mon-queue.c: Add config-header support. * monitor/mon-server.c: Add config-header support. * monitor/mon-symbols.c: Add config-header support. * monitor/mon-task.c: Add config-header support. * mw-fb/mw_fb.c: Add config-header support. * mw-fb/mw_uid.c: Add config-header support. * rtmonuse/rtmonuse.c: Add config-header support. * serdbg/serdbg.c: Add config-header support. * serdbg/serdbgio.c: Add config-header support. * serdbg/termios_printk.c: Add config-header support. * shell/cmds.c: Add config-header support. * stackchk/check.c: Add config-header support. * untar/untar.c: Add config-header support.
1999-04-14Bug report from Ralf on UNIX port where the S_IR* constants were notJoel Sherrill1-0/+1
defined.
1999-04-06Untar support submitted by Jake Janovetz <janovetz@tempest.ece.uiuc.edu>.Joel Sherrill1-0/+381