]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
20 months agoPerform "dead stripping" on macos (#1997)
Mostyn Bramley-Moore [Mon, 4 Dec 2023 16:27:18 +0000 (17:27 +0100)] 
Perform "dead stripping" on macos (#1997)

Since Xcode 1.5, macos ld has a -dead_strip flag which is roughly
equivalent to --gc-sections in GNU style linkers, let's use it.

Reference:
https://opensource.apple.com/source/cctools/cctools-622.5.1/RelNotes/CompilerTools.html

Results from running the following command, before and after this
change, formatted for easy comparison (the actual values will vary with
toolchain and library versions used):
```
size bsdtar bsdcpio bsdunzip bsdcat .libs/libarchive.13.dylib

__TEXT __DATA __OBJC others     dec        hex

655360 16384  0      4295196672 4295868416 1000dc000 bsdtar # before
638976 16384  0      4295180288 4295835648 1000d4000 bsdtar # after

638976 32768  0      4295196672 4295868416 1000dc000 bsdcpio # before
606208 32768  0      4295163904 4295802880 1000cc000 bsdcpio # after

147456 16384  0      4295065600 4295229440 100040000 bsdunzip # before
114688 16384  0      4295032832 4295163904 100030000 bsdunzip # after

131072 16384  0      4295065600 4295213056 10003c000 bsdcat # before
 49152 16384  0      4295016448 4295081984 10001c000 bsdcat # after

638976 16384  0          229376     884736     d8000 .libs/libarchive.13.dylib # before
622592 16384  0          229376     868352     d4000 .libs/libarchive.13.dylib # after
```

20 months agoIncluding getopt.h if HAVE_GETOPT_OPTRESET is defined (#2007)
Klaus Holst Jacobsen [Mon, 4 Dec 2023 16:25:42 +0000 (17:25 +0100)] 
Including getopt.h if HAVE_GETOPT_OPTRESET is defined (#2007)

On platforms that uses optreset we must also include getopt.h to have it
defined

20 months agoxz: fix incorrect eof at the end of an lzip member. (#2027)
YAMASHINA Hio [Mon, 4 Dec 2023 16:24:51 +0000 (01:24 +0900)] 
xz: fix incorrect eof at the end of an lzip member. (#2027)

xz filter returns incorrect eof if the end of an lzip member is at the
end of the read buffer (`state->stream.next_in`).
At next call of `xz_filter_read()`, following lzip members are never
read since `state->eof` is still flagged.
Fixes #2026.

20 months agounzip: Increment option count after swallowing -- (#2022)
Alfred Wingate [Mon, 27 Nov 2023 01:29:11 +0000 (03:29 +0200)] 
unzip: Increment option count after swallowing -- (#2022)

* Option count is used later for the position of the file in the
arguments and otherwise it uses -- as the file.

---------

Signed-off-by: Alfred Wingate <parona@protonmail.com>
20 months agoPrefer OPENSSL_cleanse to memset in OpenSSL code path (#2020)
Jeffrey Walton [Fri, 24 Nov 2023 23:08:59 +0000 (18:08 -0500)] 
Prefer OPENSSL_cleanse to memset in OpenSSL code path (#2020)

`memset` can be optimized away. `OPENSSL_cleanse` is implemented in a
way that usually survives optimizations.

20 months agowin32: ensure that the MSVC build doesn't terminate when MinGW fails (#2018)
Dustin L. Howett [Tue, 21 Nov 2023 20:49:41 +0000 (14:49 -0600)] 
win32: ensure that the MSVC build doesn't terminate when MinGW fails (#2018)

For `matrix`-strategy builds, GitHub actions will terminate all related
matrix legs when one of them fails.

Disabling `fail-fast` knocks this behavior off.

20 months agoAdd a new Windows-only public API, archive_read_open_filenames_w (#2016)
Dustin L. Howett [Tue, 21 Nov 2023 20:26:46 +0000 (14:26 -0600)] 
Add a new Windows-only public API, archive_read_open_filenames_w (#2016)

There is a discrepancy between the w and non-w filename APIs, wherein a
consumer of libarchive can open a multi-volume set with names in the
current locale (on Windows) but not with UTF-16 names.

This patch addresses that issue.

archive_read_open_filename_w delegates its work to
archive_read_open_filenames_w.

Fixes #1728

Tested passing on Windows. In the meantime, I will also test on Linux.
I am hoping that the build agents can help me determine FreeBSD and
macOS coverage.

20 months agoVCSid removal (#2017)
Brooks Davis [Tue, 21 Nov 2023 01:41:49 +0000 (17:41 -0800)] 
VCSid removal (#2017)

The libarchive source tree is littered with `__FBSDID("$FreeBSD.*")` and
'$FreeBSD$' tags left over from extracting it from FreeBSD's Subversion
repo. They never made sense for a git repo as git doesn't expand them
and FreeBSD has now removed `$FreeBSD$` from most local source files so
these stand out.

In addition to `__FBSDID` I've removed `__RCSID` which was used once for
a `$NetBSD$` expansion. There might be more of a case to be made for
preserving this one as a diff-reduction measure, but it seems mostly
pointless.

This builds and tests pass except for
libarchive_test_read_disk_directory_traversals which failed on master as
well.

21 months agoUse calloc arguments that correspond with the variable's true purpose (#1993)
AtariDreams [Wed, 18 Oct 2023 18:29:11 +0000 (14:29 -0400)] 
Use calloc arguments that correspond with the variable's true purpose (#1993)

First argument is number of times to allocate a region of the second
size, which is the size of the element being allocated.

21 months agobuild(deps): bump the all-actions group with 3 updates (#1989)
dependabot[bot] [Mon, 9 Oct 2023 22:43:09 +0000 (00:43 +0200)] 
build(deps): bump the all-actions group with 3 updates (#1989)

actions/checkout from 4.0.0 to 4.1.0r
github/codeql-action from 2.21.7 to 2.22.1
ossf/scorecard-action from 2.2.0 to 2.3.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
22 months agofix detection of lzma_stream_encoder_mt with Werror (#1965)
alice [Fri, 22 Sep 2023 23:57:55 +0000 (01:57 +0200)] 
fix detection of lzma_stream_encoder_mt with Werror (#1965)

the function is marked as warn-unused-result, so by default in a Debug
build with cmake, when Werror is set, this fails to detect. do the same
for autotools.

22 months agobuild(deps): bump the all-actions group with 1 update (#1975)
dependabot[bot] [Fri, 22 Sep 2023 23:53:02 +0000 (01:53 +0200)] 
build(deps): bump the all-actions group with 1 update (#1975)

github/codeql-action v2.21.5 -> v2.21.7

22 months agoPreserve the natural order in ISO9660 archives for linked files (#1974)
Roland Clobus [Sat, 16 Sep 2023 17:53:54 +0000 (19:53 +0200)] 
Preserve the natural order in ISO9660 archives for linked files (#1974)

When an ISO9660 archive contains hard links or sym links, the order of
the files in the output of 'bsdtar -tf filename' is not the natural
order.

With an extension to the key (while still supporting ISO files up to 2^48
bytes) the sorting order is guaranteed for ISO files that contain linked
files for up to 2^16 files in total.

Co-authored-by: Martin Matuska <martin@matuska.de>
22 months agoAdd Scorecard GHA (#1973)
Pedro Kaj Kjellerup Nacht [Sun, 17 Sep 2023 08:27:16 +0000 (05:27 -0300)] 
Add Scorecard GHA (#1973)

Fixes #1972

This adds the Scorecard GitHub Action to monitor the project's
supply-chain security posture.

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
22 months agobuild(deps): bump the all-actions group with 1 update (#1967)
dependabot[bot] [Sun, 17 Sep 2023 08:23:25 +0000 (10:23 +0200)] 
build(deps): bump the all-actions group with 1 update (#1967)

Signed-off-by: dependabot[bot] <support@github.com>
22 months agotests: fix zstd long option test for 32-bit architectures
Martin Matuska [Tue, 12 Sep 2023 06:54:47 +0000 (08:54 +0200)] 
tests: fix zstd long option test for 32-bit architectures

Fixes #1968

22 months agoLibarchive 3.7.3dev
Martin Matuska [Mon, 11 Sep 2023 22:50:11 +0000 (00:50 +0200)] 
Libarchive 3.7.3dev

22 months agoRelease 3.7.2 v3.7.2
Martin Matuska [Mon, 11 Sep 2023 21:59:08 +0000 (23:59 +0200)] 
Release 3.7.2

22 months agoCI: update Windows zlib build dependency to 1.3
Martin Matuska [Mon, 11 Sep 2023 19:53:58 +0000 (21:53 +0200)] 
CI: update Windows zlib build dependency to 1.3

22 months agoHash-pin GitHub Actions, keep them updated with dependabot (#1960)
Pedro Nacht [Mon, 11 Sep 2023 20:02:18 +0000 (17:02 -0300)] 
Hash-pin GitHub Actions, keep them updated with dependabot (#1960)

Fixes #1959.

This PR hash-pins GitHub Actions used in workflows and sets up
dependabot to keep the Actions up-to-date.

I've configured dependabot to group all Actions together. So if it ever
discovers that multiple Actions have new versions, it'll only send a
single PR to bump them all together.

---------

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
22 months agoAdd --long write option for zstd (#1962)
tomaThomas [Wed, 6 Sep 2023 13:24:58 +0000 (15:24 +0200)] 
Add --long write option for zstd (#1962)

Fixes #1795

23 months agoSet read-only workflow tokens (#1958)
Pedro Nacht [Mon, 4 Sep 2023 18:21:27 +0000 (15:21 -0300)] 
Set read-only workflow tokens (#1958)

Fixes #1957.

This PR ensures all workflows run with minimal permissions, instead of
with `write-all` permissions. This will protect the project from
supply-chain attacks.

The change to codeql.yml is for consistency and future-proofing. Should
another job eventually be added to the workflow, it will run with just
`contents: read`.

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
23 months agoFix MSVC warnings on x64 (#1956)
Jarred Sumner [Mon, 4 Sep 2023 09:09:50 +0000 (01:09 -0800)] 
Fix MSVC warnings on x64 (#1956)

On Windows x64, `long` & `ulong` are 4 bytes instead of 8 bytes like
everywhere else

Co-authored-by: Jarred Sumner
23 months agoAdd threads write option for zstd to man pages (#1952)
tomaThomas [Mon, 4 Sep 2023 09:08:39 +0000 (11:08 +0200)] 
Add threads write option for zstd to man pages (#1952)

The threads option of zstd is supported by libarchive, but it is missing
in the man pages.
Fixes #1951

23 months ago7zip reader: improve error message when encountering the ARM64 codec in an unexpected...
Mostyn Bramley-Moore [Sun, 3 Sep 2023 07:27:14 +0000 (09:27 +0200)] 
7zip reader: improve error message when encountering the ARM64 codec in an unexpected place (#1950)

This is a small followup to #1918.

23 months agouudecode filter: free name if already allocated before allocating
Martin Matuska [Wed, 23 Aug 2023 23:15:43 +0000 (01:15 +0200)] 
uudecode filter: free name if already allocated before allocating

23 months agouudecode filter: add missing check for failed malloc
Martin Matuska [Wed, 23 Aug 2023 07:05:35 +0000 (09:05 +0200)] 
uudecode filter: add missing check for failed malloc

23 months agouudecode filter: fix memory allocation and name length calculation
Martin Matuska [Tue, 22 Aug 2023 13:52:27 +0000 (15:52 +0200)] 
uudecode filter: fix memory allocation and name length calculation

23 months agouudecode filter: fix file name length calculation
Martin Matuska [Tue, 22 Aug 2023 13:23:35 +0000 (15:23 +0200)] 
uudecode filter: fix file name length calculation

23 months agouudecode filter: in raw mode decode file name and file mode
Martin Matuska [Tue, 22 Aug 2023 13:03:01 +0000 (15:03 +0200)] 
uudecode filter: in raw mode decode file name and file mode

Fixes #1941

23 months agocontrib/archivetest: add raw archive support and print file modes
Martin Matuska [Tue, 22 Aug 2023 12:07:38 +0000 (14:07 +0200)] 
contrib/archivetest: add raw archive support and print file modes

23 months ago7zip reader: translate windows permissions to unix permissions (#1943)
Mostyn Bramley-Moore [Mon, 21 Aug 2023 11:07:11 +0000 (13:07 +0200)] 
7zip reader: translate windows permissions to unix permissions (#1943)

7z archives created on windows 7zip can lack unix permission info. In
this case, we need to translate the windows permissions into reasonable
unix equivalents.

23 months agopax writer: fix multiple security vulnerabilities
Martin Matuska [Thu, 17 Aug 2023 22:28:39 +0000 (00:28 +0200)] 
pax writer: fix multiple security vulnerabilities

Security vulnerabilities:
1. Heap overflow in url_encode() in archive_write_set_format_pax.c
2. NULL dereference in archive_write_pax_header_xattrs()
3. Another NULL dereference in archive_write_pax_header_xattrs()
4. NULL dereference in archive_write_pax_header_xattr()

The vulnerabilities can be triggered when writing pax archives
with extended attributes (SCHILY or LIBARCHIVE) by feeding attribute
names longer than INT_MAX or attribute names that fail to be encoded
properly.

Reported-by: Bahaa Naamneh of Crosspoint Labs
23 months agoCI: update Windows build dependencies
Martin Matuska [Tue, 15 Aug 2023 07:56:09 +0000 (09:56 +0200)] 
CI: update Windows build dependencies

Update zlib to 1.2.13, xz to 1.4.4 and zstd to 1.5.5

2 years agounzip: correctly handle arguments following an -x after zipfile
Martin Matuska [Thu, 3 Aug 2023 22:13:51 +0000 (00:13 +0200)] 
unzip: correctly handle arguments following an -x after zipfile

2 years agobuild: add missing HAVE_STRUCT_STATFS to build/cmake/config.h.in
Martin Matuska [Wed, 2 Aug 2023 22:31:38 +0000 (00:31 +0200)] 
build: add missing HAVE_STRUCT_STATFS to build/cmake/config.h.in

Fixes #1937

2 years agounzip: correctly define bsdunzip_optind
Martin Matuska [Mon, 31 Jul 2023 11:29:25 +0000 (13:29 +0200)] 
unzip: correctly define bsdunzip_optind

2 years agounzip: use libarchive-style getopt() implementation
Martin Matuska [Mon, 31 Jul 2023 09:51:35 +0000 (11:51 +0200)] 
unzip: use libarchive-style getopt() implementation

2 years agounzip: support --version argument
Martin Matuska [Sun, 30 Jul 2023 22:45:57 +0000 (00:45 +0200)] 
unzip: support --version argument

2 years agocat: fix references and variable names in cmdline.c
Martin Matuska [Sun, 30 Jul 2023 21:25:05 +0000 (23:25 +0200)] 
cat: fix references and variable names in cmdline.c

2 years agoLibarchive 3.7.2dev
Martin Matuska [Sat, 29 Jul 2023 17:30:12 +0000 (19:30 +0200)] 
Libarchive 3.7.2dev

2 years agoRelease 3.7.1 v3.7.1
Martin Matuska [Sat, 29 Jul 2023 16:58:59 +0000 (18:58 +0200)] 
Release 3.7.1

2 years agocontrib/unter: use vendor-dependent number format for size_t (#1613)
Samuel Marks [Wed, 26 Jul 2023 07:04:06 +0000 (03:04 -0400)] 
contrib/unter: use vendor-dependent number format for size_t (#1613)

Use BUF_SIZE constant instead of explicit number

2 years agotar: respect --strip-components and -s patterns in cru modes on read (#1731)
Luke Rewega [Wed, 26 Jul 2023 06:58:57 +0000 (02:58 -0400)] 
tar: respect --strip-components and -s patterns in cru modes on read (#1731)

2 years agocpio: multiple fixes in list_item_verbose()
Martin Matuska [Tue, 25 Jul 2023 13:06:15 +0000 (15:06 +0200)] 
cpio: multiple fixes in list_item_verbose()

Do not call strftime() with NULL timeptr
Adjust uids and gids buffers as cpio_i64toa() may return up to 22 bytes

Fixes #1934
Fixes #1935

2 years agounzip: fix include order in la_getline.c
Martin Matuska [Tue, 25 Jul 2023 12:13:03 +0000 (14:13 +0200)] 
unzip: fix include order in la_getline.c

2 years agoCheck if clang has __builtin_bswap16 (#1932)
Joshua Root [Mon, 24 Jul 2023 12:43:42 +0000 (22:43 +1000)] 
Check if clang has __builtin_bswap16 (#1932)

Some older versions of clang do not in fact have this builtin.

Co-authored-by: Toby Peterson <toby@macports.org>
2 years agobuild: update config_freebsd.h
Martin Matuska [Mon, 24 Jul 2023 11:43:57 +0000 (13:43 +0200)] 
build: update config_freebsd.h

2 years agounzip: add NetBSD implementation of getline() if not supported
Martin Matuska [Mon, 24 Jul 2023 11:35:50 +0000 (13:35 +0200)] 
unzip: add NetBSD implementation of getline() if not supported

Fixes #1933

2 years agounzip: remove optreset from bsdunzip_platform.h
Martin Matuska [Mon, 24 Jul 2023 11:35:33 +0000 (13:35 +0200)] 
unzip: remove optreset from bsdunzip_platform.h

2 years agoCorrect assignment to r when checking for result of reading archive data (#1929)
AtariDreams [Sun, 23 Jul 2023 22:10:10 +0000 (18:10 -0400)] 
Correct assignment to r when checking for result of reading archive data (#1929)

It is impossible for if (r == ARCHIVE_FATAL) to be true otherwise.

2 years agounzip: Pull in upstream updates (#1926)
Adrian Vovk [Sat, 22 Jul 2023 09:00:20 +0000 (05:00 -0400)] 
unzip: Pull in upstream updates (#1926)

Fixes #1873

2 years agoFix various VS2019 compiler warnings (#1927)
Mostyn Bramley-Moore [Sat, 22 Jul 2023 08:57:20 +0000 (10:57 +0200)] 
Fix various VS2019 compiler warnings (#1927)

This PR fixes a bunch of warnings while building with VS2019.
Some lz4 warning fixes are included, too.

2 years agoreturn ((int)r); is not part of if statement due to missing brackets (#1930)
AtariDreams [Sat, 22 Jul 2023 02:30:44 +0000 (22:30 -0400)] 
return ((int)r); is not part of if statement due to missing brackets (#1930)

This is problematic because we need to return if an error occurs, and
because we are letting a continue to be evaluated even though it is
closed.

2 years agoReplace `svfs.f_namelen` with `svfs.f_namemax` (#1924)
Wong Hoi Sing Edison [Wed, 19 Jul 2023 08:59:32 +0000 (16:59 +0800)] 
Replace `svfs.f_namelen` with `svfs.f_namemax` (#1924)

The equivalent for `f_namelen` in struct statvfs is `f_namemax`.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2 years agoMakefile: add mkdirs for all */test/list.h targets (#1923)
Michał Górny [Wed, 19 Jul 2023 08:22:25 +0000 (10:22 +0200)] 
Makefile: add mkdirs for all */test/list.h targets (#1923)

Add missing mkdir calls to `cat/test/list.h` and `unzip/test/list.h`
invocations, making them consistent with the other rules. Otherwise,
the build fails when configured with `--disable-dependency-tracking`,
as configure does not create the directories automatically then.

2 years agounzip: fix build without utimensat() or futimens()
Martin Matuska [Tue, 18 Jul 2023 14:57:10 +0000 (16:57 +0200)] 
unzip: fix build without utimensat() or futimens()

Fixes #1919

2 years agounzip: use libeal port of sys/queue.h if not available
Martin Matuska [Tue, 18 Jul 2023 13:46:20 +0000 (15:46 +0200)] 
unzip: use libeal port of sys/queue.h if not available

Fixes #1920

2 years agounzip: use lchmod() and optreset only if available (fix Android build)
Martin Matuska [Tue, 18 Jul 2023 13:41:43 +0000 (15:41 +0200)] 
unzip: use lchmod() and optreset only if available (fix Android build)

Fixes #1921

2 years agoLibarchive 3.7.1dev
Martin Matuska [Tue, 18 Jul 2023 07:29:44 +0000 (09:29 +0200)] 
Libarchive 3.7.1dev

2 years agoRelease 3.7.0 v3.7.0
Martin Matuska [Tue, 18 Jul 2023 05:54:20 +0000 (07:54 +0200)] 
Release 3.7.0

2 years ago7zip reader: add support for ARM64 filter (#1918)
Mostyn Bramley-Moore [Mon, 17 Jul 2023 11:00:23 +0000 (13:00 +0200)] 
7zip reader: add support for ARM64 filter (#1918)

7-Zip 23.00 added a new ARM64 filter, which is also supported by recent
versions of liblzma. This PR adds support for this filter for both lzma
and non-lzma encoders.

2 years agoCI: use two make jobs for Cirrus CI FreeBSD builds
Martin Matuska [Mon, 17 Jul 2023 09:37:03 +0000 (11:37 +0200)] 
CI: use two make jobs for Cirrus CI FreeBSD builds

2 years agoCI: use multiple make jobs to speed up building (#1917)
Mostyn Bramley-Moore [Mon, 17 Jul 2023 09:29:48 +0000 (11:29 +0200)] 
CI: use multiple make jobs to speed up building (#1917)

2 years agobsdunzip_test: fix link against ACL libs in cmake
Martin Matuska [Mon, 17 Jul 2023 09:20:55 +0000 (11:20 +0200)] 
bsdunzip_test: fix link against ACL libs in cmake

2 years agopax writer: depend ustar_max_mtime on size of time_t
Martin Matuska [Sat, 15 Jul 2023 23:12:25 +0000 (01:12 +0200)] 
pax writer: depend ustar_max_mtime on size of time_t

2 years agoCI: use macos-13 in GitHub Actions
Martin Matuska [Fri, 14 Jul 2023 23:35:26 +0000 (01:35 +0200)] 
CI: use macos-13 in GitHub Actions

2 years agobuild: add mising test archives to Makefile.am
Martin Matuska [Fri, 14 Jul 2023 20:30:01 +0000 (22:30 +0200)] 
build: add mising test archives to Makefile.am

2 years agobuild: fix dist-build in Makefile.am
Martin Matuska [Fri, 14 Jul 2023 18:59:36 +0000 (20:59 +0200)] 
build: fix dist-build in Makefile.am

2 years agoCI: update apt cache on Ubuntu before build
Martin Matuska [Fri, 14 Jul 2023 18:53:39 +0000 (20:53 +0200)] 
CI: update apt cache on Ubuntu before build

2 years agounzip: disable build on Windows
Martin Matuska [Fri, 14 Jul 2023 15:37:19 +0000 (17:37 +0200)] 
unzip: disable build on Windows

Bsdunzip has not been ported to Windows yet.
Add header checks for fcntl.h and sys/queue.h
Add function check for fcntl()

2 years agoCI: ignore directory traversals test nr. 4 on MacOS
Martin Matuska [Fri, 14 Jul 2023 11:53:20 +0000 (13:53 +0200)] 
CI: ignore directory traversals test nr. 4 on MacOS

2 years agounzip: fix mtime number error from last commit
Martin Matuska [Fri, 14 Jul 2023 10:39:25 +0000 (12:39 +0200)] 
unzip: fix mtime number error from last commit

2 years agounzip: fix multi-platform handling of stat mtime
Martin Matuska [Fri, 14 Jul 2023 10:33:26 +0000 (12:33 +0200)] 
unzip: fix multi-platform handling of stat mtime

2 years agoCI: fix debug build with cmake
Martin Matuska [Fri, 14 Jul 2023 09:04:51 +0000 (11:04 +0200)] 
CI: fix debug build with cmake

2 years agobuild: fix cmake build with OpenSSL
Martin Matuska [Fri, 14 Jul 2023 08:04:37 +0000 (10:04 +0200)] 
build: fix cmake build with OpenSSL

2 years agotests: fix exit on failed realloc in libarchive/test/test_fuzz.c
Martin Matuska [Fri, 14 Jul 2023 07:53:13 +0000 (09:53 +0200)] 
tests: fix exit on failed realloc in libarchive/test/test_fuzz.c

2 years agounzip: fix EXTRA_VERSION macro in unzip/test/test.h
Martin Matuska [Fri, 14 Jul 2023 07:52:24 +0000 (09:52 +0200)] 
unzip: fix EXTRA_VERSION macro in unzip/test/test.h

2 years agobuild: fix cmake build with Mbed TLS
Martin Matuska [Fri, 14 Jul 2023 07:50:54 +0000 (09:50 +0200)] 
build: fix cmake build with Mbed TLS

2 years agoFix call to setenv() in unzip/bsdunzip.c
Martin Matuska [Fri, 14 Jul 2023 06:52:06 +0000 (08:52 +0200)] 
Fix call to setenv() in unzip/bsdunzip.c

2 years agoFix missing endif in libarchive/archive_random.c
Martin Matuska [Fri, 14 Jul 2023 06:50:06 +0000 (08:50 +0200)] 
Fix missing endif in libarchive/archive_random.c

2 years agobsdunzip: make it possible to pass filenames starting with dash
Mingye Wang [Sat, 27 May 2023 13:28:23 +0000 (21:28 +0800)] 
bsdunzip: make it possible to pass filenames starting with dash

We now check for residual arguments after the second scan, so any filename protected by `--` is picked up.

2 years agoPort over FreeBSD's unzip utility
Adrian Vovk [Tue, 23 May 2023 20:56:23 +0000 (16:56 -0400)] 
Port over FreeBSD's unzip utility

This allows libarchive to act as a drop-in replacement to Info-ZIP

2 years agoAdd missing brackets to if clause
Sarah Gilmore [Tue, 25 Apr 2023 13:23:39 +0000 (09:23 -0400)] 
Add missing  brackets to if clause

2 years agoFix indentation
Sarah Gilmore [Wed, 29 Mar 2023 14:20:20 +0000 (10:20 -0400)] 
Fix indentation

2 years agoFix typo in calls to close_file_descriptor function
Sarah Gilmore [Fri, 24 Mar 2023 13:52:36 +0000 (09:52 -0400)] 
Fix typo in calls to close_file_descriptor function

2 years agoAlways close file handle on descriptor on posix systems before returning from _archiv...
Sarah Gilmore [Fri, 24 Mar 2023 13:44:38 +0000 (09:44 -0400)] 
Always close file handle on descriptor on posix systems before returning from _archive_write_disk_finish_entry

2 years agoClose file handle on windows when padding/truncating file fails
Sarah Gilmore [Fri, 17 Mar 2023 13:54:32 +0000 (09:54 -0400)] 
Close file handle on windows when padding/truncating file fails

2 years agoAdd security policy (#1866)
Pedro Nacht [Thu, 13 Jul 2023 22:48:47 +0000 (19:48 -0300)] 
Add security policy (#1866)

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
Co-authored-by: Martin Matuska <martin@matuska.de>
2 years agoFix the build with libressl-devel <2.7
Enji Cooper [Sat, 13 May 2023 00:03:04 +0000 (17:03 -0700)] 
Fix the build with libressl-devel <2.7

This change is similar to what was done in
5da00ad75b09e262774ec3675bbe4d5a4502a852.

Co-authored by: Greg Lewis <glewis@FreeBSD.org>
Co-authored by: Piotr Kubaj <pkubaj@anongoth.pl>
Obtained from: FreeBSD ports (9fcaa71e4675d12dc3c9a5895edd68610e03cbcd)
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2 years agofix incorrect test of HAVE_LZMA_STREAM_ENCODER_MT and missed LIBB2_INCLUDE_DIR
Albert Jin [Wed, 24 May 2023 02:46:01 +0000 (10:46 +0800)] 
fix incorrect test of HAVE_LZMA_STREAM_ENCODER_MT and missed LIBB2_INCLUDE_DIR

2 years agoREADME: vulnerability on implicite directory creation
Peter Kaestle [Mon, 3 Apr 2023 11:35:35 +0000 (13:35 +0200)] 
README: vulnerability on implicite directory creation

There's a race condition with the umask() execution in multi-threaded
use of the libarchive.
It's the users responsibility to mutex archive_write_disk_header()
call.

Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
2 years agoREADME.md: HTTP => HTTPS
Kai [Wed, 24 May 2023 11:23:22 +0000 (13:23 +0200)] 
README.md: HTTP => HTTPS

2 years agoUse Windows bcrypt when enabled and building for Vista+ (#1887)
Steve Lhomme [Thu, 13 Jul 2023 22:32:56 +0000 (00:32 +0200)] 
Use Windows bcrypt when enabled and building for Vista+ (#1887)

The wincrypt API is deprecated and is not allowed in UWP builds. We can
use the more modern bcrypt API which has equivalent calls.

2 years agoDisable CreateFileA calls in UWP builds
Steve Lhomme [Fri, 26 May 2023 07:58:48 +0000 (09:58 +0200)] 
Disable CreateFileA calls in UWP builds

Only CreateFile2 and CreateFileFromAppW are allowed.

2 years agoUse CreateFile2 instead of CreateFileW on Win8+ builds
Steve Lhomme [Fri, 26 May 2023 07:57:40 +0000 (09:57 +0200)] 
Use CreateFile2 instead of CreateFileW on Win8+ builds

CreateFileW is not allowed in Universal Windows Platform (UWP) builds but
CreateFile2 is available. We could just enable this code for UWP but
it's probably to use it going forward so the code is properly tested on
both sides.

2 years agotests: use CreateFileA for char* filenames
Steve Lhomme [Wed, 24 May 2023 13:00:04 +0000 (15:00 +0200)] 
tests: use CreateFileA for char* filenames

In case the code is compiled with the UNICODE define.

2 years agoDon't call GetOEMCP() in Universal Windows Platform builds
Steve Lhomme [Wed, 24 May 2023 13:23:14 +0000 (15:23 +0200)] 
Don't call GetOEMCP() in Universal Windows Platform builds

It's not available [1] [2]. However we can use the intermediate CP_OEMCP
value. It can be used to compare charsets in create_sconv_object().
It won't work with comparing charsets in archive_string_default_conversion_for_read()
and archive_string_default_conversion_for_write(). current_codepage being
an actual CodePage value.

[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-localization-l1-2-0dll
[2] https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getoemcp#requirements

2 years agoUse the common CMake BUILD_SHARED_LIBS to build shared library or not
Steve Lhomme [Thu, 25 May 2023 11:56:00 +0000 (13:56 +0200)] 
Use the common CMake BUILD_SHARED_LIBS to build shared library or not

https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html

Usually it's built-in but make sure we have it on by default.

We don't need to rename the windows static library when it's the only one built.
This will also allow proper usage of the pkg-config file in this case. Otherwise
there is no way to select the static library that way.

2 years agoFix bcrypt detection on UNIX cross-compilation
Steve Lhomme [Thu, 25 May 2023 09:47:13 +0000 (11:47 +0200)] 
Fix bcrypt detection on UNIX cross-compilation

The Windows SDK uses an uppercase on the B, but mingw-w64 doesn't.
The autoconf detection already uses a lowercase bcrypt.