summaryrefslogtreecommitdiff
path: root/cpio
Commit message (Collapse)AuthorAgeFilesLines
* Fix cpio test in 2038 (#1836)Bernhard M. Wiedemann2023-01-121-3/+3
| | | | | | | | | | | | | | | | | Without this patch, `bsdcpio_test_option_c` failed after 2038-01-19 with ``` .../libarchive-3.6.2/cpio/test/test_option_c.c:143: Assertion failed: t >= now - 2 .../libarchive-3.6.2/cpio/test/test_option_c.c:169: Assertion failed: t >= now - 2 .../libarchive-3.6.2/cpio/test/test_option_c.c:205: Assertion failed: t >= now - 2 ``` Background: As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future. The usual offset is +16 years, because that is how long I expect some software will be used in some places. This showed up failing tests in our package build. See https://reproducible-builds.org/ for why this matters.
* replace time64 functions with normal ones (#1830)Rosen Penev2023-01-092-6/+6
| | | | | | | | | 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-282-20/+2
| | | | | | | 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-272-0/+3
| | | Issue #1828
* cleanup _localtime64_s (#1820)Rosen Penev2022-12-202-6/+6
| | | Signed-off-by: Rosen Penev <rosenp@gmail.com>
* tests: silence localtime() CodeQL warningsMartin Matuska2022-12-081-2/+22
| | | | Use localtime_r() or _localtime64_s() if available
* Merge pull request #1502 from tih/cpio-bin-formatsMartin Matuška2021-05-105-7/+30
|\ | | | | Support for PWB and v7 binary cpio formats
| * update "-h" output with new formatsTom Ivar Helbekkmo2021-03-061-1/+1
| |
| * update cpio documentation, add basic test of binary formatTom Ivar Helbekkmo2021-03-062-0/+9
| |
| * fix output format handling and symlink detection for PWBTom Ivar Helbekkmo2021-03-061-4/+6
| |
| * add -7 option to bsdcpio for symmetryTom Ivar Helbekkmo2021-03-062-4/+7
| |
| * add support for reading and writing PWB and V7 cpio archivesTom Ivar Helbekkmo2021-03-053-1/+12
| |
| * rearrange cpio output format selectionTom Ivar Helbekkmo2021-03-051-3/+1
| |
* | cpio test: add source file extensionRolf Eike Beer2021-04-061-11/+11
|/ | | | Fixes CMake warnings regarding CMP0115.
* cpio/cpio.c: Fix off-by-one in previous commitMartin Matuska2020-03-021-1/+1
|
* cpio/cpio.c: avoid calling strlen() for destdir twiceMartin Matuska2020-03-022-8/+8
|
* bsdcpio_test: from_hex() needs to be an uint32_tMartin Matuska2020-02-271-15/+18
| | | | Fixes #1339
* Add printf attributes to the printflike functions used in tests and fixzoulasc2020-01-232-12/+17
| | | | | | the format errors. Closes #1318
* Windows: use _localtime64_s and _gmtime64_s where appropriateMartin Matuska2020-01-131-3/+14
|
* 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-2/+1
| | | | | | | | | | | | | | | | | | | | 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
* Windows symlink bugfixes and improvementsMartin Matuska2019-04-133-4/+4
| | | | | | | 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-073-2/+16
| | | | Enable tests on MinGW CI builds
* Fix various symlink bugs with Windows symlinksMartin Matuska2019-04-044-4/+4
| | | | tests: extend assertMakeSymlink with targetIsDir
* Issue 1104: Explicitly limit the printed string to 12 charactersIssue1104Tim Kientzle2018-12-151-4/+4
| | | | | | | | | | | | | | | | | GCC8 tries to diagnose `snprintf()` overflows but isn't quite smart enough for this case, so emits a false-positive warning. Remember that `%12s` only specifies the minimum number of bytes. GCC8 conservatively assumes this might result in writing the full length of `date2`. (Which will never be longer than 12 bytes, but GCC8 apparently can't reason about `strftime` format specifiers yet.) Changing the specifier here to `%12.12s` explicitly truncates to 12 bytes and should help the compiler understand that this will never overflow. While I'm here, correct a minor typo in the previous line; it used `sizeof(date)` instead of `sizeof(date2)`. (Both are the same size, so this had no functional impact.)
* Fix a few obvious resource leaks and strcpy() misusesPavel Raiskup2018-11-231-1/+3
| | | | Per Coverity report.
* Correctly process and verify integer arguments passed to bsdcpio and bsdtarMartin Matuska2018-09-231-4/+11
| | | | Fixes #1068
* Cpio test: Expected error message depends on local strerror()Tim Kientzle2018-09-022-27/+73
|
* Add space after version to fix all unit tests besides sparse testsBenjaminTrapani2018-01-201-1/+1
|
* Fix alphabetical order, other small fixesSean Purcell2017-05-155-11/+11
|
* Add zstd test suiteSean Purcell2017-05-154-0/+141
|
* Add Zstandard write supportSean Purcell2017-05-154-0/+11
|
* Fix use-after-free in error branch. From Ngie Cooper.Joerg Sonnenberger2017-05-111-1/+1
|
* Don't leak memory.Joerg Sonnenberger2017-04-2912-11/+34
|
* Optimize string processing.Joerg Sonnenberger2017-04-291-4/+7
|
* Explicitly free pass_destpath after processing.Joerg Sonnenberger2017-04-291-0/+1
|
* Free linkresolver after processing.Joerg Sonnenberger2017-04-291-0/+1
|
* Add NFSv4 ACL support for Linux via librichaclMartin Matuska2017-03-161-1/+6
| | | | | | | | | | | | Richacls are interpreted as NFSv4 ACLs and stored in archive_acl (Richacl flags and masks are not stored). Analog to mac_metadata, NFSv4 ACLs do not get extracted when the extraction of extended attributes is enabled and the "trusted.richacl" extended attribute is present. RichACL masks and are calculated from file mode on extraction. mac_metadata acl check has been moved in the code to be together with the richacl check.
* Merge pull request #867 from praiskup/cpio-getgrgidTim Kientzle2017-03-111-24/+22
|\ | | | | bsdcpio: show numeric uid/gid when names are not found
| * bsdcpio: ignore ENOENT for get{grg,pwu}id()Pavel Raiskup2017-02-221-24/+22
| | | | | | | | | | | | | | | | | | Starting from glibc 2.25, those calls set errno to ENOENT when the requested id is not found. So let's stop throwing warning in this expected case. Also rework the api of lookup_* functions so it is guaranteed that lookup_name never returns NULL (unless ENOMEM).
* | New tar test: test_option_aclsMartin Matuska2017-03-021-0/+5
| | | | | | | | | | Add sunacl_get() and setTestAcl() to common test code Test for membership.h on Mac OS X and make it a requirement for ACLs
* | Mark functions that don't return as dead.Joerg Sonnenberger2017-02-261-5/+5
|/
* test suite: use a single main test file for all testsMartin Matuska2017-02-214-3406/+16
|
* testsuite: allow 'dev' in versionPavel Raiskup2017-02-212-83/+3
|
* Merge pull request #843 from yaneurabeya/cpio-coverity-fixesMartin Matuska2016-12-301-0/+1
|\ | | | | | | Fix memory leak of struct archive_entry in cpio/cpio.c
| * Don't leak `entry` in `file_to_archive` if archive_read_disk_entry_from_fileNgie Cooper2016-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fails with `ARCHIVE_FAILED` This greatly reduces memory usage when the call fails, e.g. a file cannot be stat'ed Confirmed with the following snippet: % d=/tmp/cpio_test % mkdir -p $d % while : ; do echo /nonexistent ; done | cpio -dump $d 2>/dev/null Reported by: Coverity CID: 1016757
* | Spelling fixes (#846)Graham Percival2016-12-201-1/+1
|/ | | Sponsored by: Tarsnap Backup Inc.
* Merge pull request #807 from csanchezdll/issue696Tim Kientzle2016-12-111-0/+7
|\ | | | | Issue 696: ppc64le mache ckech failure
| * Issue 696: ppc64le mache ckech failureCarlos Sánchez de La Lama2016-10-191-0/+7
| | | | | | | | | | | | | | This issue is not ppc64le specific. I have experienced on my 4.4.22-gnu #1 SMP 1 i686 GNU/Linux. Might be dependant on kernel version and/or machine load. POSIX says errors after posix_spawnp returns can be signaled by child exitting with an 127 exit code.
* | Free p (the memory allocated via slurpfile) when done with the contentsNgie Cooper2016-12-104-3/+15
| | | | | | | | | | Reported by: Coverity CID: 1331631, 1331632, 1331633, 1331646