Commit Graph

126 Commits

Author SHA1 Message Date
Micah Snyder
0023ecfbdb CMake improvements: copy/install bunzip.exe, bzcat.exe to correct directory (eg build\Release for a Release build). 2019-10-27 15:54:26 -04:00
Micah Snyder
095262feae CMake improvements: Replaces add_definitions with target_compile_definitions for bzip2, bzip2recover targets. 2019-10-27 13:33:17 -04:00
Micah Snyder
bae2dfa931 Changes CMake duplicate install targets (bunzip, etc) to symlinks instead of file copies. 2019-09-14 22:58:37 -04:00
Micah Snyder
1de04548d0 Improves CMake formatting, removing unnecessary quotes and fixing indentation. 2019-09-14 21:19:35 -04:00
Micah Snyder
b52681fab6 Moves BZ_UNIX, BZ_LCCWIN32 defines out of bzip2.c and bzip2recover.c and into the build tooling (cmake, meson, and nmake). 2019-09-14 18:51:17 -04:00
Micah Snyder
d0dae15260 Removing hardcoded BZ_UNIX definition which broke the build on Windows. 2019-09-14 18:51:17 -04:00
Micah Snyder
af3ab6c58f CMake build tooling improvement: Adds install for bunzip, bzcat copies of bzip2, as well as shell-scripts bzdiff, bzgrep, bzmore, and their alternately named copies (not available for Windows). 2019-09-14 18:51:17 -04:00
Federico Mena Quintero
b7a6722911 Merge branch 'meson-warncflags' into 'master'
Port WARNCFLAGS of CMakeLists.txt to meson.build

See merge request federicomenaquintero/bzip2!34
2019-09-10 17:31:00 +00:00
Federico Mena Quintero
cc1d5a784a Merge branch 'meson-install-binary-links' into 'master'
Meson: install symlinks or copies of binaries

See merge request federicomenaquintero/bzip2!26
2019-09-10 17:26:20 +00:00
Chih-Hsuan Yen
4a8a9fd228
Port WARNCFLAGS of CMakeLists.txt to meson.build
And let CMake determine which compiler warning flags are available as
suggested in [1].

[1] https://gitlab.com/federicomenaquintero/bzip2/merge_requests/19#note_206149857
2019-09-05 09:50:06 +08:00
Jordan Petridis
3eff339237 Merge branch 'apt-get' into 'master'
CI: Use apt-get rather than apt

See merge request federicomenaquintero/bzip2!33
2019-07-22 09:26:51 +00:00
Роман Донченко
20201212ab CI: Use apt-get rather than apt
apt does not have a stable interface, as it will itself warn about when
run non-interactively.
2019-07-15 20:57:56 +00:00
Jordan Petridis
ef31e2d0ba Merge branch 'distutils' into 'master'
CI: Install python3-distutils on Debian testing

See merge request federicomenaquintero/bzip2!31
2019-07-15 02:28:23 +00:00
Роман Донченко
60faa3a33c CI: Install python3-distutils on Debian testing
Debian testing recently updated to a new version of meson, which fails
to find Python unless distutils is also installed. On Debian, distutils
is in a separate package from Python itself, so we need to install it
separately.
2019-07-14 20:47:20 +00:00
Federico Mena Quintero
030da03add Merge branch 'cmake-cxx' into 'master'
CMake: remove C++ option checking

See merge request federicomenaquintero/bzip2!25
2019-07-10 19:50:39 +00:00
Mark Wielaard
812a898b76 Accept as many selectors as the file format allows.
But ignore any larger than the theoretical maximum, BZ_MAX_SELECTORS.

The theoretical maximum number of selectors depends on the maximum
blocksize (900000 bytes) and the number of symbols (50) that can be
encoded with a different Huffman tree. BZ_MAX_SELECTORS is 18002.

But the bzip2 file format allows the number of selectors to be encoded
with 15 bits (because 18002 isn't a factor of 2 and doesn't fit in
14 bits). So the file format maximum is 32767 selectors.

Some bzip2 encoders might actually have written out more selectors
than the theoretical maximum because they rounded up the number of
selectors to some convenient factor of 8.

The extra 14766 selectors can never be validly used by the decompression
algorithm. So we can read them, but then discard them.

This is effectively what was done (by accident) before we added a
check for nSelectors to be at most BZ_MAX_SELECTORS to mitigate
CVE-2019-12900.

The extra selectors were written out after the array inside the
EState struct. But the struct has extra space allocated after the
selector arrays of 18060 bytes (which is larger than 14766).
All of which will be initialized later (so the overwrite of that
space with extra selector values would have been harmless).
2019-07-10 14:39:32 -05:00
Dylan Baker
ab22254684 Meson: install symlinks or copies of binaries
On most system symlinks are fine, but on windows symlinks are tricky at
best, or unsupported for older versions of windows. To avoid those
problems we'll just copy the binary if the host or build machine is
windows. This uses a small helper python script to make this all
easier to use and understand.
2019-07-01 14:53:21 -07:00
Rolf Eike Beer
91a3b6d614 CMake: remove needless checks 2019-06-27 08:52:45 +02:00
Rolf Eike Beer
1e6d325fee CMake: remove C++ option checking
There is no C++ code.
2019-06-27 08:39:02 +02:00
Federico Mena Quintero
78aa9c8623 Merge branch 'version-header' into 'master'
(#2): Generate a header file with the version number

Closes #2

See merge request federicomenaquintero/bzip2!24
2019-06-25 23:59:30 +00:00
Federico Mena Quintero
4c6ef278dc (#2): Generate a header file with the version number
Fixes https://gitlab.com/federicomenaquintero/bzip2/issues/2
2019-06-25 18:28:19 -05:00
Federico Mena Quintero
d9a99adca7 Update NEWS 2019-06-25 13:38:19 -05:00
Colin Phipps
31bfafca67 bzip2recover: Refuse to overwrite existing output files
This comes from
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=56386
but is modified to use the more or less the same fopen_output_safely()
from bzip2.c.
2019-06-25 13:36:12 -05:00
Federico Mena Quintero
b1446b53ed NEWS - Link to the Red Hat bug for CVE-2016-3189 2019-06-25 12:35:50 -05:00
Federico Mena Quintero
e275cecc0f NEWS - Fix attribution for the bzip2recover strcpy() patch 2019-06-25 12:33:59 -05:00
Federico Mena Quintero
53766110d1 docs/RELEASING.md - start a release checklist 2019-06-21 17:55:07 -05:00
Federico Mena Quintero
9eac831b5e Bump library revision 2019-06-21 17:55:07 -05:00
Federico Mena Quintero
277548b072 Sync versioning schemes between Meson and CMake
Use a computed soversion of 1.

This keeps compatibility with the version in the SONAME from openSUSE
and Fedora, which fixed the botched soname in bzip2's historical
tarballs.

See this post for details:
https://people.gnome.org/~federico/blog/preparing-the-bzip2-107-release.html
2019-06-21 17:55:07 -05:00
Federico Mena Quintero
29a935d589 Merge branch 'meson-macos' into 'master'
meson: Fix build on macos

Closes #18

See merge request federicomenaquintero/bzip2!22
2019-06-21 17:22:27 +00:00
Dylan Baker
5cd6c8f2b2 meson: Fix build on macos
There is a bug in meson's Compiler.has_function_attribute('visibility'),
which results in it incorrectly returning False on macos. This causes
meson to not defined BZ_EXTERN, but the gnu_symbol_visibility results in
hidden by default symbols. This means that there are no visible symbols
in libbz2 at all and linking naturally fails.

Fixes #18
2019-06-21 09:16:04 -07:00
Federico Mena Quintero
a51fb7324e Merge branch 'remove-autotools' 2019-06-20 11:39:25 -05:00
Federico Mena Quintero
1660afceba NEWS - link to an alternate construction of the bzip2 repository 2019-06-20 11:38:17 -05:00
Federico Mena Quintero
2e006d78c6 Add a NEWS file with the changes in 1.0.7 2019-06-20 11:22:55 -05:00
Federico Mena Quintero
2f8240eaa9 Move NEWS to NEWS-pre-1.0.7
This file is in chronological order, and I think modern NEWS files
tend to be in reverse chronological order.
2019-06-20 11:22:27 -05:00
Federico Mena Quintero
20b522d021 Remove autotools stuff from .gitignore 2019-06-19 21:05:04 -05:00
Federico Mena Quintero
b3722d45a5 Remove references to autotools from COMPILING.md 2019-06-19 21:05:04 -05:00
Federico Mena Quintero
c8900377c7 Remove autotools files
We'll only use Meson and CMake now.
2019-06-19 21:05:00 -05:00
Federico Mena Quintero
b83c7780bf Remove autotools from the CI 2019-06-19 21:00:28 -05:00
Federico Mena Quintero
c61d28ba06 man/meson.build: Add newline to the end of the file 2019-06-19 20:49:05 -05:00
Federico Mena Quintero
6b9b943d78 Merge branch 'windows_build_improvements' 2019-06-14 09:24:07 -05:00
Federico Mena Quintero
6fdb85cb75 List CMake as being available, too 2019-06-14 09:22:46 -05:00
Phil Ross
21c0d94bc4 Update README and makefile.msc comments with Windows build changes. 2019-06-14 09:20:46 -05:00
Phil Ross
6c19bf79c9 Remove the unsupported DESCRIPTION statement.
This causes a warning during the build:
libbz2.def(2) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored

From https://github.com/philr/bzip2-windows/blob/v1.0.6.1/patches/04-remove_unsupported_description_option.diff
2019-06-14 09:18:54 -05:00
Phil Ross
a715b86f57 Add version information to the dll and exe files.
From https://github.com/philr/bzip2-windows/blob/v1.0.6.1/patches/03-add_version_resource.diff
2019-06-14 09:18:34 -05:00
Phil Ross
e0f6201b40 Build bz2-1.dll and dynamically link executables.
From https://github.com/philr/bzip2-windows/blob/v1.0.6.1/patches/02-build_dll.diff
2019-06-14 09:17:31 -05:00
Phil Ross
2b374b8211 Replace the deprecated cl -o option with /Fe.
From https://github.com/philr/bzip2-windows/blob/v1.0.6.1/patches/01-replace_deprecated_compile_options.diff
2019-06-14 09:17:10 -05:00
Phil Ross
a85d910eef Ignore Windows build outputs. 2019-06-14 09:16:49 -05:00
Phil Ross
a723502569 Fix test paths.
Test files were moved into a subdirectory in commit f6f3326c.
2019-06-14 09:15:48 -05:00
Federico Mena Quintero
636c0704c7 Merge branch 'fix_large_files_on_windows' into 'master'
Fix a 'not a normal file' error when compressing large files on Windows.

See merge request federicomenaquintero/bzip2!17
2019-06-14 13:40:50 +00:00
Federico Mena Quintero
06d9aba5f0 Rename COMPILING.MD to COMPILING.md for consistency 2019-06-14 08:38:09 -05:00