summaryrefslogtreecommitdiff
path: root/tar
Commit message (Collapse)AuthorAgeFilesLines
* Document the new zstd options.Dag-Erling Smørgrav2023-01-091-1/+14
|
* replace time64 functions with normal ones (#1830)Rosen Penev2023-01-091-3/+3
| | | | | | | | | Otherwise there are 32/64-bit pointer conversions going on. In Windows since MSVC2005, time_t has been 64-bit. MinGW needs a hack to get 64-bit time_t. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Rosen Penev <rosenp@gmail.com>
* further cleanup _localtime64_s (#1824)Rosen Penev2022-12-281-10/+1
| | | | | | | These were missing from 2d329073435d36065ce30bfd29428f6a45e41016 Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Rosen Penev <rosenp@gmail.com>
* Memory leaks fix for tests (#1829)TERESH12022-12-271-0/+1
| | | Issue #1828
* cleanup _localtime64_s (#1820)Rosen Penev2022-12-201-3/+3
| | | Signed-off-by: Rosen Penev <rosenp@gmail.com>
* tests: silence CodeQL warning in tar/test_option_bMartin Matuska2022-12-071-3/+5
| | | | Use strncpy() and strncat() instead of strcpy() and strcat()
* use regfree to release the memorybanjiuqingshan2022-11-181-0/+1
| | | use regfree() to release the memory requested by the regular expression.#1804
* Fixed issue #1743: Changed sprintf to safer snprintfSean McBride2022-06-222-20/+21
| | | | | | Also changed a few vsprintf to vsnprintf. Most cases were trivial, one private function was changed to take the buffer length, one case required some fancy arithmetic.
* fix Bl -widthJan Starý2022-06-051-1/+1
|
* bsdtar(1): Document threads options for zstd and xzJung-uk Kim2022-02-081-0/+10
|
* tar: fix format name typo in creation_set.cMartin Matuska2022-02-071-1/+1
| | | | Closes #1659
* Fix check for tape deviceWalter Lozano2021-12-211-2/+2
| | | | | | | | In b6b423f0 a fallback in tar to stdio was implemented. However, the check for the tape device didn't interpret the correct value returned from access(). Fix the check to implement the fallback to stdio properly. Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
* Merge pull request #1632 from wlozano0collabora/default-archive-fileTim Kientzle2021-12-041-17/+26
|\ | | | | | | | | | | | | | | | | Have `bsdtar` default to stdout if this system has no tape device. This uses an `access()` check to see if the default tape device (e.g., `/dev/tape` on FreeBSD) exists and will use stdout as the default if it doesn't exist. If the system does have a tape device, there is no change to the existing behavior. For libarchive 4.0, we'll change the default behavior of `bsdtar`: * The `TAPE` environment variable will still be honored at runtime * The `_PATH_DEFTAPE` preprocessor macro will still be honored at build time * But `_PATH_DEFTAPE` will no longer be set by libarchive's default build, with the effect that for most people, bsdtar will default to stdout if there is no `-f` option provided.
| * Add path fallback in tarWalter Lozano2021-12-031-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | Since current tar defaults to tape devices that are rare nowadays add an additional step to fallback to "-" if tape devices are not found. This is a clean way to have a default to "-" on those systems that tape devices are not present while keeping the current behavior for other cases. Additionally prepare for future releases where this kind of defaults will be dropped. Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
* | tar: demote -xa from error to a warningEmil Velikov2021-11-211-2/+8
|/ | | | | | | | | | | | | | It's fairly common for people to use caf and xaf on Linux. The former in itself being GNU tar specific - libarchive tar does not allow xa. While it makes little sense to use xaf with libarchive tar, that is implementation detail which gets in the way when trying to write trivial tooling/scripts. For the sake of compatibility, reduce the error to a warning and augment the message itself. Making it clear that the option makes little sense. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* Merge pull request #1614 from diabonas/add-no-read-sparseMartin Matuška2021-11-214-0/+25
|\ | | | | Add ARCHIVE_READDISK_NO_SPARSE/--no-read-sparse to improve reproducibility of generated archives
| * tar: expose ARCHIVE_READDISK_NO_SPARSE as --no-read-sparseJonas Witschel2021-11-144-0/+25
| |
* | tar/test/test_option_ignore_zeros.c: test tar --ignore-zerosRyan Libby2021-11-192-0/+148
| | | | | | | | Add some basic tests for operations on concatenated archives.
* | tar: respect --ignore-zeros in c r & u modes when reading archivesRyan Libby2021-11-191-0/+4
| | | | | | | | Previously, --ignore-zeros was only being applied to t and x modes.
* | Added error message when archive extraction failsjiat752021-11-021-4/+3
|/
* Fix typosSamanta Navarro2021-06-011-1/+1
| | | | Typos found with codespell
* zstd: Support negative compression-levelsHarry Mallon2020-04-071-1/+2
|
* Update filter and format options in manual pages.Martin Matuska2020-01-311-19/+9
| | | | | | | | The list of format and filter options in bsdtar(1) is incomplete. Add reference to manual pages archive_write_set_options(3) and archive_read_set_options(3) for a complete list of supported options. Fixes #1323
* XAR writer: fix compression output buffer handlingMartin Matuska2020-01-231-1/+18
| | | | | | | Add "none" as acceptable value to xar:checksum and xar:toc-checksum Document XAR options in bsdtar(1) Fixes #1317
* Add printf attributes to the printflike functions used in tests and fixzoulasc2020-01-234-8/+6
| | | | | | the format errors. Closes #1318
* bsdtar.1: --exclude-vcs sort version control systems and add gitMartin Matuska2020-01-201-6/+7
| | | | Fixes #1314
* Add test_option_safe_writes to tar testsMartin Matuska2020-01-202-0/+78
|
* Introduce archive_write_disk(3) flag ARCHIVE_EXTRACT_SAFE_WRITESzoulasc2020-01-204-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | This flag changes the way that regular files are extracted: Instead of removing existing files first and re-creating them in order to replace their contents, a temporary file is created and when writing to the temporary file is completed, the file is rename(2)d to the final destination name. This has the effect of presenting a consistent view of the file to the system (either the file with the new contents or the file with the old contents). Removing and overwriting the file has the undesired side effect that the the system can either not see the file at all (from the time it is being removed till the time it is being re-created), or worse it can see partial file contents. This is problematic when extracting system files (for example shared libraries). If the existing file that is going to be overwritten is a hard link, for now we unlink it before calling rename(2). This can be done correctly by creating a hardlink to a tmpnam(3) generated file and then use rename(2), but that is fairly intrusive and requires refactoring. Fixes #1289
* Windows: use _localtime64_s and _gmtime64_s where appropriateMartin Matuska2020-01-131-2/+13
|
* Unify header style, header guard comes firstMartin Matuska2020-01-131-0/+5
| | | | Found by LGTM.com code analysis
* Use localtime_r and gmtime_r if supportedMartin Matuska2020-01-131-1/+10
| | | | Found by LGTM.com code analysis
* Minor corrections to the formatting of manual page.Ingo Schwarze2019-09-211-21/+35
| | | | | | | | | | | | | | | | | | | | Found with mandoc -Tlint; fixing the following messages: WARNING: bad NAME section content WARNING: missing comma before name WARNING: new sentence, new line WARNING: parenthesis in function name WARNING: skipping no-space macro WARNING: skipping paragraph macro WARNING: unusual Xr order WARNING: unusual Xr punctuation STYLE: no blank before trailing delimiter STYLE: possible typo in section name STYLE: trailing delimiter STYLE: whitespace at end of input line For the meaning of the messages, see: https://man.openbsd.org/mandoc#DIAGNOSTICS
* Correct some typographical and grammatical errors.Peter Pentchev2019-09-212-3/+3
|
* Fix typo in tar/bsdtar.1Martin Matuska2019-06-061-1/+1
|
* More bsdtar.1 manpage fixesMartin Matuska2019-06-031-10/+11
| | | | | - use term "extended file attributes" - use term "file attributes or file flags"
* Minor bsdtar.1 manpage fixesMartin Matuska2019-06-031-7/+7
| | | | | | | | - the -p option does not restore owner by default. - the -n option was listed twice - file flags are called file attributes on Linux and are platform-specific Fixes #1204
* CI: increase make command output verbosityMartin Matuska2019-05-111-0/+1
| | | | | | Add Fedora_29_distcheck task with "make distcheck" Add support for debug build with address sanitizer Add missing free to tar/test/test_option_C_mtree.c
* tar/test_option_n: fix build and operation on WindowsMartin Matuska2019-04-161-40/+28
|
* test_option_n.c: cover non-recursive extract/listPatrick Ohly2019-04-161-0/+93
| | | | | | | | | | | Testing uses only listing because extraction uses the same code paths. Indirectly this covers also the new API call. Some corner cases get special attention: - archive where a file in a directory is present without the directory - the error when asking to extract a directory which is not present
* non-recursive extract and listPatrick Ohly2019-04-152-4/+11
| | | | | | | | | | | | | | | | | Sometimes it makes sense to extract or list a directory contained in an archive without also doing the same for the content of the directory, i.e. allowing -n (= --no-recursion) in combination with the x and t modes. bsdtar uses the match functionality in libarchive to track include matches. A new libarchive API call archive_match_set_inclusion_recursion() gets introduced to influence the matching behavior, with the default behavior as before. Non-recursive matching can be achieved by anchoring the path match at both start and end. Asking for a directory which itself isn't in the archive when in non-recursive mode is an error and handled by the existing mechanism for tracking unused inclusion entries.
* tar: add option --exclude-vcsMartin Matuska2019-04-146-0/+276
| | | | Fixes #999
* Windows symlink bugfixes and improvementsMartin Matuska2019-04-138-39/+39
| | | | | | | Treat targets ending with /. and /.. as directory symlinks Explicitly test for file and directory symlinks Improve debug output on test failure Fix two memory allocations
* Fix remaining MinGW testsMartin Matuska2019-04-072-2/+18
| | | | Enable tests on MinGW CI builds
* Fix various symlink bugs with Windows symlinksMartin Matuska2019-04-048-32/+32
| | | | tests: extend assertMakeSymlink with targetIsDir
* tar/write.c: call missing archive_read_close() in write_archive()Martin Matuska2018-11-241-2/+1
|
* Fix use-after-free in delayed link processing (newc format)Pavel Raiskup2018-11-231-5/+4
| | | | | | | | | | During archiving, if some of the "delayed" hard link entries happened to disappear on filesystem (or become unreadable) for some reason (most probably race), the old code free()d the 'entry' and continued with the loop; the next loop though dereferenced 'entry' and crashed the archiver. Per report from Coverity.
* Correctly process and verify integer arguments passed to bsdcpio and bsdtarMartin Matuska2018-09-231-18/+32
| | | | Fixes #1068
* put the absolute path in quotes in case user's directory has spaces in itArshan Khanifar2018-02-121-1/+1
|
* absolute path fixArshan Khanifar2018-02-071-5/+10
|
* build fail fix, simplified logicArshan Khanifar2018-02-062-5/+2
|