summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Reduce overlinking per pkg-config spec (#1870)HEADmasterEnji Cooper2023-05-121-1/+1
| | | | | | | | libssl isn't required for libarchive. Remove libssl so the installed .pc file doesn't cause consumers to subsequently overlink libssl into their code. This doesn't affect how the code is linked -- only consumers of the pkg-config specified spec.
* Fix FreeBSD builds with WARNS=6 (#1869)Enji Cooper2023-05-122-5/+12
| | | | | | | | | | | | | | | | | | WARNS=6 on FreeBSD passes several CFLAGS that causes the previous code to fail with `-Wincompatible-pointer-types-discards-qualifiers` when compiled with clang. This particular change adjusts the code to be `-Wincompatible-pointer-types-discards-qualifiers` clean. This change changes the calls to use OSSL_PARAM macro abbreviated calls, instead of calling more verbose (and less documented) callers. While here, also address a `mac` object leak if `ctx` cannot be allocated cleanly by always free'ing `mac` after it's been attached to `ctx`. Co-authored-by: Pierre Pronchery <pierre@freebsdfoundation.org> Sponsored by: The FreeBSD Foundation Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Make single bit bitfields unsigned to avoid clang 16 warning (#1860)Dimitry Andric2023-04-173-10/+10
| | | | | | | | | | | | | | | | | Clang 16 introduced a warning about single bit bitfields in structs, which is triggered by a few libarchive formats: libarchive/archive_write_set_format_7zip.c:1541:13: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] file->dir = 1; ^ ~ This is because single bit bitfields only support values -1 and 0, if they are signed. For bitfields with two or more bits this can be intentional, but single bit bitfields are typically used as booleans, so it is better to make them unsigned.
* fix typo in config.h.in (#1851)Xin "Russell" Liu2023-03-011-1/+1
|
* Fix date (#1846)Po-Chuan Hsieh2023-02-191-1/+1
|
* archive_read_data_into_fd: Increase pointer assignment check (#1843)Li kunyu2023-02-131-1/+6
|
* Allow tests to pass after 2038 (#1838)Bernhard M. Wiedemann2023-01-191-6/+12
| | | | | | Now uses 33 bits (the maximum possible) in the ustar header in order to support times out to 2106. Fixes #1837
* 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.
* Add tests for the new zstd options.Dag-Erling Smørgrav2023-01-091-0/+27
|
* Document the new zstd options.Dag-Erling Smørgrav2023-01-091-1/+14
|
* Support producing multi-fragment zstd archives.Dag-Erling Smørgrav2023-01-091-38/+113
| | | | | | | | | | When the `zstd:frame-per-file` option is specified, the zstd filter will start a new frame when flushed, i.e. for each file in the archive. The `zstd:min-frame-size=N` option modifies the `zstd:frame-per-file` option in that it will not start a new frame unless the current one exceeds `N` bytes. When the `zstd:max-frame-size=N` option is specified, the zstd filter will start a new frame any time the compressed size of the previous one exceeds `N` bytes. These options decrease compression efficiency by a varying amount (depending on the exact composition of its contents) but render the tarball seekable, to a certain extent.
* Flush write filters between entries.Dag-Erling Smørgrav2023-01-092-0/+32
| | | | | | * Add a flush() method to write filters. * Add an __archive_write_filters_flush() function which iterates over filters in order and invokes the flush method for any filter that has one and that has written data. * Call __archive_write_filters_flush() before writing a new header.
* Clean up zstd support code.Dag-Erling Smørgrav2023-01-092-77/+50
|
* Do not account for NULL terminator when comparing with "TRAILER!!!" (#1814)Rose2023-01-091-1/+1
| | | | Because at that point, you may as well replace the whole thing with strcmp
* Update autotools and fix warnings (#1815)Rose2023-01-096-8/+7
| | | | We do not need to check TIME_WITH_SYS_TIME anymore. We can check HAVE_SYS_TIME_H and not bother checking for C99.
* replace time64 functions with normal ones (#1830)Rosen Penev2023-01-0920-88/+101
| | | | | | | | | 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-287-70/+7
| | | | | | | These were missing from 2d329073435d36065ce30bfd29428f6a45e41016 Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Rosen Penev <rosenp@gmail.com>
* Only add "iconv" to the .pc file if needed (#1825)Peter Pentchev2022-12-281-1/+3
| | | | | | | | | | | | | | | | | Hi, Thanks for writing and maintaining libarchive! What do you think about this trivial change that does not add "iconv" to the pkg-config file's list of required packages unless it is actually needed? On at least Debian GNU/Linux systems, the iconv(3) function is part of the system C library and there is no Debian package that installs an iconv.pc file, so I had to make this change to the Debian package of libarchive. Thanks again, and keep up the great work! G'luck, Peter
* add "no sanitize undefined" attribute with clang (#1827)TERESH12022-12-281-0/+4
| | | Issue #1826
* Memory leaks fix for tests (#1829)TERESH12022-12-276-0/+13
| | | Issue #1828
* cleanup _localtime64_s (#1820)Rosen Penev2022-12-2017-179/+85
| | | Signed-off-by: Rosen Penev <rosenp@gmail.com>
* Libarchive 3.6.3devMartin Matuska2022-12-095-7/+7
|
* Release 3.6.2v3.6.2Martin Matuska2022-12-094-3/+5
|
* archive_hmac: use EVP_MAC_*() in OpenSSL 3.0Martin Matuska2022-12-092-0/+36
| | | | HMAC_*() functions have been deprecated since OpenSSL 3.0
* CI: update Ubuntu to 22.04 and MacOS to 12Martin Matuska2022-12-091-3/+3
|
* archive_read_support_format_tar: avoid always-true comparsionMartin Matuska2022-12-081-3/+2
| | | | | Reported by: GitHub CodeQL Code Scanning Alert: 125
* test_sparse_basic: avoid always-true comparsionMartin Matuska2022-12-081-1/+3
| | | | | Reported by: CodeQL Code Scanning Alert: 126
* test_main.c: omit always-true comparsionMartin Matuska2022-12-081-8/+6
| | | | | Reported by: CodeQL Code Scanning Alert: 127
* test_read_format_rar5: correctly use verify_data()Martin Matuska2022-12-081-9/+9
| | | | | Reported by: CodeQL Code Scanning Alert: 129
* mtree reader: check __archive_rb_tree_find_node() for NULL returnMartin Matuska2022-12-081-3/+5
| | | | | Reported by: GitHub CodeQL Code Scanning Alert: 190
* archive_read_disk_posix: fail if unable to alocate memory in tree_push()Martin Matuska2022-12-081-0/+2
| | | | | Reported by: GitHub CodeQL Code Scanning Alert: 189
* various: fix unitialized local variablesMartin Matuska2022-12-083-5/+5
| | | | | Reported by: GitHub CodeQL Code scanning alerts: 214, 215, 216
* tests: silence localtime() CodeQL warningsMartin Matuska2022-12-085-8/+104
| | | | Use localtime_r() or _localtime64_s() if available
* tests: silence more CodeQL warnings in test_utils/test_main.cMartin Matuska2022-12-081-4/+6
| | | | Catch one more uncatched strcpy() and strcat()
* tests: silence some CodeQL warnings in test_utils/test_main.cMartin Matuska2022-12-071-8/+18
| | | | | Use fchmod() instead of chmod() if available Use strncpy() and strncat() instead of strcpy() and strcat()
* tests: silence CodeQL warning in tar/test_option_bMartin Matuska2022-12-071-3/+5
| | | | Use strncpy() and strncat() instead of strcpy() and strcat()
* cab reader: cast to int when subtracting unsigned integersMartin Matuska2022-12-071-1/+1
| | | | Found by: GitHub CodeQL
* Add CodeQL workflow for GitHub code scanning (#1800)lgtm-com[bot]2022-12-071-0/+41
| | | Co-authored-by: LGTM Migrator <lgtm-migrator@users.noreply.github.com>
* Merge pull request #1806 from kikht/share-writeMartin Matuška2022-12-071-6/+12
|\ | | | | Use FILE_SHARE_WRITE and FILE_SHARE_DELETE when opening files on Windows
| * Use FILE_SHARE_WRITE and FILE_SHARE_DELETE when opening files on WindowsVladimir Kikhtenko2022-11-181-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | Many standard libraries( [libc++](https://github.com/llvm/llvm-project/blob/main/libcxx/src/filesystem/posix_compat.h#L159), [go](https://cs.opensource.google/go/go/+/refs/tags/go1.19.3:src/syscall/syscall_windows.go;l=331), [rust](https://doc.rust-lang.org/src/std/os/windows/fs.rs.html#126-131) ) open files on windows with `FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE` mode by default. Libarchive uses only `FILE_SHARE_READ`, so when file is being opened by any program that uses these standard libraries libarchive fails to open it. Here we change libarchive shared flags, so it plays well with common practice in other programs.
* | Merge pull request #1771 from ↵Martin Matuška2022-12-061-0/+3
|\ \ | | | | | | | | | | | | EwgeniWolowik/extend_cleanup_pathname_by_windows_remote_path Fixed issue #1770: base dir deals with network drive paths like \\server\file
| * | Fixed issue #1770: cleanup_pathname deals with network drive paths like ↵Ewgeni Wolowik2022-09-071-0/+3
| | | | | | | | | | | | \\server\file
* | | Merge pull request #1802 from banjiuqingshan/masterMartin Matuška2022-12-061-0/+1
|\ \ \ | | | | | | | | free mstr to fix memory leaks
| * | | free mstr to fix memory leaksbanjiuqingshan2022-11-151-0/+1
| | |/ | |/| | | | free mstr to fix memory leaks.#1801
* | | Merge pull request #1772 from bgermann/masterMartin Matuška2022-12-061-0/+14
|\ \ \ | | | | | | | | archive_entry_pathname() tries UTF-8 if MBS returns EILSEQ
| * | | archive_entry_pathname() tries UTF-8 if MBS returns EILSEQJohn Reiser2022-08-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | For better pathname portability across OS, in particular Windows to Linux. Original bug: unrar in https://bugzilla.redhat.com/show_bug.cgi?id=2120926 modified: libarchive/archive_entry.c
* | | | Merge pull request #1793 from flyingdutchman23/fix-cmake-warningMartin Matuška2022-12-062-3/+4
|\ \ \ \ | | | | | | | | | | Fix CMake warning
| * | | | Fix CMake warningJoris Clement2022-10-282-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warnings occurs at least with CMake version 3.24. It is caused by CMake trying to find the gcc library due to case sensitivity. The warning message was: ``` CMake Warning (dev) at /usr/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to `find_package_handle_standard_args` (LIBGCC) does not match the name of the calling package (LibGCC). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern. Call Stack (most recent call first): build/cmake/FindLibGCC.cmake:17 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:1269 (FIND_PACKAGE) This warning is for project developers. Use -Wno-dev to suppress it. ```
* | | | | Merge pull request #1805 from banjiuqingshan/sync-masterMartin Matuška2022-12-061-0/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | use regfree to release the memory
| * | | | use regfree to release the memorybanjiuqingshan2022-11-181-0/+1
|/ / / / | | | | | | | | use regfree() to release the memory requested by the regular expression.#1804