summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
Commit message (Collapse)AuthorAgeFilesLines
* Mark functions as __dead2 in order to help the LLVM static checkercperciva2008-08-041-1/+1
| | | | | | | understand which code paths aren't possible. This commit eliminates 117 false positive bug reports of the form "allocate memory; error out if pointer is NULL; use pointer".
* - Fix mtree example so it works.simon2008-07-261-0/+7
| | | | | | | - Document --version. Reviewed by: kientzle MFC after: 1 week
* Move duplicated code from tar_mode_[cru] into archive_write.cperciva2008-07-051-32/+15
| | | | | Fix a bug I introduced 7 minutes ago: clean up properly from archive_write if we exit the argv-handling loop due to -C not having an argument.
* Use malloc in write_archive to allocate a 64kB buffer for holding file datacperciva2008-07-052-12/+21
| | | | instead of using 64kB of stack space in copy_file_data and write_file_data.
* Clean up write_entry by eliminating fd except in the #ifdef __linux blockcperciva2008-07-051-13/+14
| | | | | | | | | where it is used. [1] Don't leak file descriptors in write_entry_backend if archive_write_header returns ARCHIVE_FAILED. Found by: Coverity Prevent [1]
* Revert CVS revision 1.68; it is now possible for entry to be NULL at the endcperciva2008-07-051-1/+2
| | | | | of write_entry. (This was perfectly safe, since archive_entry_free(NULL) is a no-op, but adding the check back makes the style more consistent.)
* FreeBSD-CURRENT bsdtar is synched up with libarchive-portable 2.5.5.kientzle2008-07-051-1/+1
|
* Remove HAVE_STRUCT_STAT_ST_RDEV, as it's not used anywhere.kientzle2008-07-051-1/+0
|
* Stop using the deprecated linux/ext2_fs.h.kientzle2008-07-051-3/+0
|
* Use %H:%M for strftime() time formatting instead of the non-portable %R.kientzle2008-07-051-1/+1
|
* Pass the entry down into the core write loop, so wekientzle2008-06-251-4/+6
| | | | | | can include the filename when reporting errors. Thanks to: Dan Nelson
* MfP4: Minor portability fix.kientzle2008-06-151-1/+9
|
* MfP4: test harness cleanup.kientzle2008-06-152-19/+21
|
* Make one-bit fields unsigned instead of signed. This has no effect,cperciva2008-06-091-1/+1
| | | | | | | since they are only tested for zero/nonzero; but it's arguably a bad idea to set a {-1, 0} variable to 1 (as happens in this code). Found by: Coverity Prevent
* Rework code to avoid using a pointer after freeing it. Aside from thecperciva2008-06-091-2/+4
| | | | | | | possibility of memory becoming undereferenceable when it is freed, this change should have no effect on bsdtar behaviour. Found by: Coverity Prevent
* Compatibility fix: define REG_BASIC if it isn't already. In particular,kientzle2008-05-271-0/+4
| | | | | | | glibc has a suitable regex implementation, but doesn't define this constant. Thanks to: Diego "Flameeyes" Pettenò
* MFp4: bsdtar 2.5.4bkientzle2008-05-2614-316/+695
| | | | | | | | | | | | | In addition to a number of bug fixes and minor changes: * --numeric-owner (ignore user/group names on create and extract) * -S (sparsify files on extraction) * -s (regex filename substitutions) * Use new libarchive 'linkify' to get correct hardlink handling for both old and new cpio formats * Rework 'copy' test to be insensitive to readdir() filename ordering Most of the credit for this work goes to Joerg Sonnenberger, who has been duplicating features from NetBSD's 'pax' program.
* The value le->name cannot be NULL when we're freeing an entry in thecperciva2008-05-231-2/+1
| | | | | | | | | | | | | hardlink table for two reasons: 1. If le->name is set to NULL, the structure le won't be inserted into the table; 2. Even if le somehow did manage to get into the table with le->name equal to NULL, we would die when we dereferenced le->null before we could get to the point of freeing the entry. Remove the unnecessary "if (le->name != NULL)" test and just free the pointer. Found by: Coverity Prevent
* Improve portability via s/struct siginfo/struct siginfo_data/. This wascperciva2008-05-222-3/+3
| | | | running into a namespace collision on an avian operating system.
* Detect if argv[1] is "" and avoid calling malloc(0). Prior to this commit,cperciva2008-05-191-2/+2
| | | | | | running 'tar ""' would print 'No memory' instead of the correct error message, 'Must specify one of -c, -r, -t, -u, -x' if malloc is set to System V mode (malloc(0) == NULL).
* There's no way for entry to possibly be NULL at the end of write_entrycperciva2008-05-191-2/+1
| | | | | | | | (in fact, there has never been any way for it to be NULL, going all the way back to revision 1.1 of this file), so remove the check and unconditionally free entry. Found by: Coverity Prevent
* Add SIGINFO (and for portability to SIGINFO-lacking systems, SIGUSR1)cperciva2008-05-185-1/+205
| | | | | | | | | | | handling to bsdtar. When writing archives (including copying via the @archive directive) a line is output to stderr indicating what is being done (adding or copying), the path, and how far through the file we are; extracting currently does not report progress within each file, but this is likely to happen eventually. Discussed with: kientzle Obtained from: tarsnap
* Add --keep-newer-files option (as in GNU tar: When in -x mode, ignorecperciva2008-05-172-0/+9
| | | | | | | | | | | files if the existing file is newer than the archive entry). Currently if any files are ignored, bsdtar will exit with a non-zero exit status; this is likely to change in the future, but requires some API changes in libarchive. Discussed with: kientzle Obtained from: tarsnap
* Documentation updates:kientzle2008-05-022-3/+9
| | | | | | * --format can be used with -r or -u * -o is a synonym for --format=ustar when used with -c, -r, or -u Also, fix the erroneous sanity check that suppressed --format with -r or -u.
* bsdtar --version should succeed.kientzle2008-05-021-1/+1
|
* New bsdtar test harness. Still rather skimpy, but a lot easierkientzle2008-05-0211-0/+2203
| | | | to run and maintain than the old scripts that used to be here.
* Allow -r with -T even if there are no files on the command line.kientzle2008-05-021-1/+1
| | | | | PR: bin/123246 MFC after: 3 days
* Fix --fast-read by decrementing the remaining patterns to be matched,kientzle2008-03-182-2/+2
| | | | | | | | instead of incrementing. Pointy hat: me Thanks to: Tomasz Przygoda MFC after: 3 days
* style(9) fix to add whitespace around an '=' sign and restorekientzle2008-03-151-1/+2
| | | | a comment that got accidentally dropped.
* Support NetBSD's --insecure as a synonym for -P.kientzle2008-03-151-0/+1
|
* Document --chroot.kientzle2008-03-151-0/+6
|
* Support -q (from NetBSD) as a synonym for --fast-read (the old FreeBSDkientzle2008-03-152-14/+13
| | | | | | extension to GNU tar). Thanks to: Joerg Sonnenberger
* Also accept --uncompress as a synonym for -Z.kientzle2008-03-151-0/+1
| | | | Thanks to: Joerg Sonnenberger
* --chroot implementation thanks to Joerg Sonnenberger.kientzle2008-03-154-0/+18
|
* Support --compress as a synonym for -Z.kientzle2008-03-151-0/+1
|
* Enable and document the -Z option for selecting "compress" compression,kientzle2008-03-153-5/+13
| | | | now that libarchive supports it.
* Allow appending to archives on block devices as well askientzle2008-02-191-1/+1
| | | | | | archives in regular files, since both are seekable. Thanks to: Reinoud Zandijk (@netbsd.org)
* Make -l always have the SUSv2 meaning of "check links."kientzle2008-01-222-30/+11
| | | | | | | | GNU tar changed -l to match SUSv2 a couple of years ago, so bsdtar no longer needs to pander to this particular GNUism. Thanks to: Debian maintainers MFC after: 7 days
* Remove the old bsdtar test scripts; something muchkientzle2008-01-028-859/+0
| | | | better is almost ready to commit.
* A couple of miscellaneous fixes:kientzle2008-01-023-4/+18
| | | | | | | | * prototypes for optarg/optind on platforms that don't already have them * Disambiguate version number macros * Remove unnecessary PACKAGE_NAME macro * Hook for forthcoming bsdtar test suite * Sync version number up with the portable distribution
* Fill in the approximate date when tar(1) first appeared.kientzle2008-01-021-1/+1
|
* Include a suitable stub definition of __FBSDID() for non-FreeBSD platforms.kientzle2008-01-021-1/+2
|
* Use archive_entry_strmode() instead of a local bsdtar_strmode().kientzle2008-01-023-53/+3
| | | | | | (This does a couple of things that the standard library's strmode() doesn't; it proved useful in bsdcpio as well, so I pushed it down into libarchive.)
* Include Guido's copyright for the fnmatch() code I cribbed from.kientzle2008-01-021-1/+36
| | | | (It's in the C source, just wasn't in the COPYING file until now.)
* Add --posix as a synonym for --format=pax, for GNUkientzle2007-09-091-0/+5
| | | | | | tar compatibility. Approved by: re (bmah)
* Fix for PR bin/115033. This corrects a crash when long optionskientzle2007-08-011-0/+4
| | | | | | | are specified with the "-W option=arg" syntax and the '=' is omitted. MFC after: 3 days Approved by: re (rwatson)
* Fill in some casts that are needed (according to GCC 4.1)kientzle2007-07-201-6/+6
| | | | | | Thanks to: Joerg Sonnenberger Approved by: re (hrs) MFC after: 3 days
* Don't exit immediately on libarchive warnings, justkientzle2007-07-202-4/+4
| | | | | | | set the delayed return value and keep going. Approved by: re (hrs) MFC after: 7 days
* bsdtar 2.2.3:kientzle2007-05-296-20/+39
| | | | | | | | | * Implement --use-compress-program using new libarchive feature. * Minor portability improvement by adjusting casts used to print out uids, gids, and device numbers. Thanks to: Joerg Sonnenberger for the --use-compress-program implementation. MFC after: 15 days
* Mention the formats supported by bsdtar; include ankientzle2007-05-201-0/+6
| | | | example that shows how to work with an ISO 9660 image.
OpenPOWER on IntegriCloud