summaryrefslogtreecommitdiff
path: root/libarchive
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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
* Add tests for the new zstd options.Dag-Erling Smørgrav2023-01-091-0/+27
|
* 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-091-1/+1
| | | | 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-0912-55/+51
| | | | | | | | | 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-283-30/+3
| | | | | | | These were missing from 2d329073435d36065ce30bfd29428f6a45e41016 Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Rosen Penev <rosenp@gmail.com>
* add "no sanitize undefined" attribute with clang (#1827)TERESH12022-12-281-0/+4
| | | Issue #1826
* Memory leaks fix for tests (#1829)TERESH12022-12-273-0/+9
| | | Issue #1828
* cleanup _localtime64_s (#1820)Rosen Penev2022-12-2013-163/+69
| | | Signed-off-by: Rosen Penev <rosenp@gmail.com>
* Libarchive 3.6.3devMartin Matuska2022-12-092-3/+3
|
* Release 3.6.2v3.6.2Martin Matuska2022-12-091-1/+1
|
* archive_hmac: use EVP_MAC_*() in OpenSSL 3.0Martin Matuska2022-12-092-0/+36
| | | | HMAC_*() functions have been deprecated since OpenSSL 3.0
* 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_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-083-4/+61
| | | | Use localtime_r() or _localtime64_s() if available
* cab reader: cast to int when subtracting unsigned integersMartin Matuska2022-12-071-1/+1
| | | | Found by: GitHub CodeQL
* 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 #1790 from jvoisin/extend_nocrcerrMartin Matuška2022-11-029-0/+38
|\ \ \ | | | | | | | | Extend the usage of the DONT_FAIL_ON_CRC_ERROR macro
| * | | Extend the usage of the DONT_FAIL_ON_CRC_ERROR macroJulien Voisin2022-10-169-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | DONT_FAIL_ON_CRC_ERROR is already used in the rar5 support code, so let's make use of it in another places as well. This should tremendously help with fuzzing.
* | | | Fix out of bounds read in Windows symlink supportErik Olofsson2022-10-061-0/+2
| | | |
* | | | Fix potential out-of-bounds readsErik Olofsson2022-10-062-0/+3
|/ / /
* | | Merge pull request #1721 from wangkerong/masterTim Kientzle2022-10-011-1/+1
|\ \ \ | | | | | | | | libarchive:uninitialized value
| * | | libarchive:uninitialized valuewangkerong2022-04-091-1/+1
| | | | | | | | | | | | Uninitialized variable crash error in oss_fuzz memory type test
* | | | Support reading mtree files with tabsEric van Gyzen2022-09-302-1/+31
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Commit 45c5008c4 requires all characters in an mtree file to be printable, as determined by `isprint()`. This broke support for reading mtree files with tab characters, which are valid and otherwise supported by libarchive. Allow them. Add a unit test. Fixes #1782
* | | Merge pull request #1736 from uckelman-sf/mingw_fixesMartin Matuška2022-09-052-3/+41
|\ \ \ | |_|/ |/| | Fixes for running tests on Windows (or Wine)
| * | Clean up the condition so we check EINVAL on Windows only.Joel Uckelman2022-06-301-6/+11
| | |
| * | Skip match_time tests when running on Windows, since the ctime can't be setZack Weger2022-06-011-0/+30
| | |
| * | Files with invalid names don't exist, so don't set an errorZack Weger2022-06-011-1/+4
| | |
* | | Merge pull request #1761 from kraj/masterTim Kientzle2022-08-041-3/+2
|\ \ \ | | | | | | | | libarchive: Remove unneeded linux/fs.h include
| * | | libarchive: Do not include sys/mount.h when linux/fs.h is presentKhem Raj2022-07-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These headers are in conflict and only one is needed by archive_read_disk_posix.c therefore include linux/fs.h if it exists otherwise include sys/mount.h It also helps compiling with glibc 2.36 where sys/mount.h conflicts with linux/mount.h see [1] [1] https://sourceware.org/glibc/wiki/Release/2.36
* | | | Merge pull request #1745 from bobrofon/rar5-read_data_blockTim Kientzle2022-08-042-1/+31
|\ \ \ \ | | | | | | | | | | rar5: Fix random initial offset if using archive_read_data_into_fd
| * | | | rar5: Fix random initial offset if using archive_read_data_into_fdSergey Bobrenok2022-06-302-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | archive_read_data_into_fd passes a pointer to an uninitialized variable as an output 'offset' argument into archive_read_data_block function, and expects that this variable will always be initialized inside of it. Like this: size_t size; int64_t offset; archive_read_data_block(a, &buf, &size, &offset); /* some work with offset here */ But rar5 implementation of archive_read_data_block function leaves the 'offset' argument uninitialized in one code path (if file is compressed and there are no uncompressed pending data blocks). As a result, archive_read_data_info_fd function is using an uninitialized variable as an initial offset of an output file. And in most cases it causes an appending sparse block of a random size at the beginning of the output file.
* | | | | Added missing file to CMakeLists.Yuri Gribov2022-07-271-0/+1
| | | | |