]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
2 years agoCMake: Update for liblzma_*.map files and fix wrong common_w32res.rc dep.
Lasse Collin [Thu, 8 Sep 2022 12:02:41 +0000 (15:02 +0300)] 
CMake: Update for liblzma_*.map files and fix wrong common_w32res.rc dep.

The previous commit split liblzma.map into liblzma_linux.map and
liblzma_generic.map. This commit updates the CMake build for those.

common_w32res.rc dependency was listed under Linux/FreeBSD while
obviously it belongs to Windows when building a DLL.

2 years agoCMake: Add xz symlinks.
Lasse Collin [Wed, 31 Aug 2022 13:42:04 +0000 (16:42 +0300)] 
CMake: Add xz symlinks.

These are a minor thing especially since the xz build has
some real problems still like lack of large file support
on 32-bit systems but I'll commit this since the code exists.

Thanks to Jia Tan.

2 years agoCMake: Put xz man page install under if(UNIX) like is for xzdec.
Lasse Collin [Wed, 31 Aug 2022 13:29:38 +0000 (16:29 +0300)] 
CMake: Put xz man page install under if(UNIX) like is for xzdec.

Thanks to Jia Tan.

2 years agoTranslations: Add Turkish translation.
Lasse Collin [Fri, 16 Sep 2022 12:10:07 +0000 (15:10 +0300)] 
Translations: Add Turkish translation.

2 years agoBuild: Include the CMake files in the distribution.
Lasse Collin [Thu, 18 Aug 2022 14:49:16 +0000 (17:49 +0300)] 
Build: Include the CMake files in the distribution.

This was supposed to be done in 2020 with 5.2.5 release
already but it was noticed only today. 5.2.5 and 5.2.6
even mention experiemental CMake support in the NEWS entries.

Thanks to Olivier B. for reporting the problem.

2 years agoWindows: Fix broken liblzma.dll build with Visual Studio project files.
Lasse Collin [Thu, 18 Aug 2022 14:38:05 +0000 (17:38 +0300)] 
Windows: Fix broken liblzma.dll build with Visual Studio project files.

The bug was introduced in 352ba2d69af2136bc814aa1df1a132559d445616
"Windows: Fix building of resource files when config.h isn't used."

That commit fixed liblzma.dll build with CMake while keeping it
working with Autotools on Windows but the VS project files were
forgotten.

I haven't tested these changes.

Thanks to Olivier B. for reporting the bug and for the initial patch.

2 years agoBump version and soname for 5.2.6. v5.2.6
Lasse Collin [Fri, 12 Aug 2022 11:30:13 +0000 (14:30 +0300)] 
Bump version and soname for 5.2.6.

2 years agoAdd NEWS for 5.2.6.
Lasse Collin [Fri, 12 Aug 2022 11:29:28 +0000 (14:29 +0300)] 
Add NEWS for 5.2.6.

2 years agoAdd Jia Tan to AUTHORS.
Lasse Collin [Fri, 12 Aug 2022 11:28:41 +0000 (14:28 +0300)] 
Add Jia Tan to AUTHORS.

3 years agoTranslations: Change the copyright comment string to use with po4a.
Lasse Collin [Mon, 25 Jul 2022 16:11:05 +0000 (19:11 +0300)] 
Translations: Change the copyright comment string to use with po4a.

This affects the second line in po4a/xz-man.pot. The man pages of
xzdiff, xzgrep, and xzmore are from GNU gzip and under GNU GPLv2+
while the rest of the man pages are in the public domain.

3 years agoliblzma: Refactor lzma_mf_is_supported() to use a switch-statement.
Jia Tan [Mon, 25 Jul 2022 15:30:05 +0000 (18:30 +0300)] 
liblzma: Refactor lzma_mf_is_supported() to use a switch-statement.

3 years agoBuild: Don't allow empty LIST in --enable-match-finders=LIST.
Jia Tan [Mon, 25 Jul 2022 15:20:01 +0000 (18:20 +0300)] 
Build: Don't allow empty LIST in --enable-match-finders=LIST.

It's enforced only when a match finder is needed, that is,
when LZMA1 or LZMA2 encoder is enabled.

3 years agoxz: Make --keep accept symlinks, hardlinks, and setuid/setgid/sticky.
Lasse Collin [Mon, 11 Jan 2021 21:41:16 +0000 (23:41 +0200)] 
xz: Make --keep accept symlinks, hardlinks, and setuid/setgid/sticky.

Previously this required using --force but that has other
effects too which might be undesirable. Changing the behavior
of --keep has a small risk of breaking existing scripts but
since this is a fairly special corner case I expect the
likehood of breakage to be low enough.

I think the new behavior is more logical. The only reason for
the old behavior was to be consistent with gzip and bzip2.

Thanks to Vincent Lefevre and Sebastian Andrzej Siewior.

3 years agoxzgrep man page: Document exit statuses.
Lasse Collin [Tue, 19 Jul 2022 20:19:49 +0000 (23:19 +0300)] 
xzgrep man page: Document exit statuses.

3 years agoxzgrep: Improve error handling, especially signals.
Lasse Collin [Tue, 19 Jul 2022 20:13:24 +0000 (23:13 +0300)] 
xzgrep: Improve error handling, especially signals.

xzgrep wouldn't exit on SIGPIPE or SIGQUIT when it clearly
should have. It's quite possible that it's not perfect still
but at least it's much better.

If multiple exit statuses compete, now it tries to pick
the largest of value.

Some comments were added.

The exit status handling of signals is still broken if the shell
uses values larger than 255 in $? to indicate that a process
died due to a signal ***and*** their "exit" command doesn't take
this into account. This seems to work well with the ksh and yash
versions I tried. However, there is a report in gzip/zgrep that
OpenSolaris 5.11 (not 5.10) has a problem with "exit" truncating
the argument to 8 bits:

    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22900#25

Such a bug would break xzgrep but I didn't add a workaround
at least for now. 5.11 is old and I don't know if the problem
exists in modern descendants, or if the problem exists in other
ksh implementations in use.

3 years agoxzgrep: Make the fix for ZDI-CAN-16587 more robust.
Lasse Collin [Mon, 18 Jul 2022 21:10:55 +0000 (00:10 +0300)] 
xzgrep: Make the fix for ZDI-CAN-16587 more robust.

I don't know if this can make a difference in the real world
but it looked kind of suspicious (what happens with sed
implementations that cannot process very long lines?).
At least this commit shouldn't make it worse.

3 years agoxzgrep: Use grep -H --label when available (GNU, *BSDs).
Lasse Collin [Mon, 18 Jul 2022 18:52:31 +0000 (21:52 +0300)] 
xzgrep: Use grep -H --label when available (GNU, *BSDs).

It avoids the use of sed for prefixing filenames to output lines.
Using sed for that is slower and prone to security bugs so now
the sed method is only used as a fallback.

This also fixes an actual bug: When grepping a binary file,
GNU grep nowadays prints its diagnostics to stderr instead of
stdout and thus the sed-method for prefixing the filename doesn't
work. So with this commit grepping binary files gives reasonable
output with GNU grep now.

This was inspired by zgrep but the implementation is different.

3 years agoxzgrep: Use -e to specify the pattern to grep.
Lasse Collin [Mon, 18 Jul 2022 18:10:25 +0000 (21:10 +0300)] 
xzgrep: Use -e to specify the pattern to grep.

Now we don't need the separate test for adding the -q option
as it can be added directly in the two places where it's needed.

3 years agoScripts: Use printf instead of echo in a few places.
Lasse Collin [Mon, 18 Jul 2022 16:18:48 +0000 (19:18 +0300)] 
Scripts: Use printf instead of echo in a few places.

It's a good habbit as echo has some portability corner cases
when the string contents can be anything.

3 years agoxzgrep: Add more LC_ALL=C to avoid bugs with multibyte characters.
Lasse Collin [Sun, 17 Jul 2022 18:36:25 +0000 (21:36 +0300)] 
xzgrep: Add more LC_ALL=C to avoid bugs with multibyte characters.

Also replace one use of expr with printf.

The rationale for LC_ALL=C was already mentioned in
69d1b3fc29677af8ade8dc15dba83f0589cb63d6 that fixed a security
issue. However, unrelated uses weren't changed in that commit yet.

POSIX says that with sed and such tools one should use LC_ALL=C
to ensure predictable behavior when strings contain byte sequences
that aren't valid multibyte characters in the current locale. See
under "Application usage" in here:

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html

With GNU sed invalid multibyte strings would work without this;
it's documented in its Texinfo manual. Some other implementations
aren't so forgiving.

3 years agoxzgrep: Fix parsing of certain options.
Lasse Collin [Sun, 17 Jul 2022 17:55:16 +0000 (20:55 +0300)] 
xzgrep: Fix parsing of certain options.

Fix handling of "xzgrep -25 foo" (in GNU grep "grep -25 foo" is
an alias for "grep -C25 foo"). xzgrep would treat "foo" as filename
instead of as a pattern. This bug was fixed in zgrep in gzip in 2012.

Add -E, -F, -G, and -P to the "no argument required" list.

Add -X to "argument required" list. It is an
intentionally-undocumented GNU grep option so this isn't
an important option for xzgrep but it seems that other grep
implementations (well, those that I checked) don't support -X
so I hope this change is an improvement still.

grep -d (grep --directories=ACTION) requires an argument. In
contrast to zgrep, I kept -d in the "no argument required" list
because it's not supported in xzgrep (or zgrep). This way
"xzgrep -d" gives an error about option being unsupported instead
of telling that it requires an argument. Both zgrep and xzgrep
tell that it's unsupported if an argument is specified.

Add comments.

3 years agoTests: Add the .lzma files to test_files.sh.
Lasse Collin [Thu, 14 Jul 2022 17:33:05 +0000 (20:33 +0300)] 
Tests: Add the .lzma files to test_files.sh.

3 years agoTests: Add .lzma test files.
Lasse Collin [Thu, 14 Jul 2022 16:37:42 +0000 (19:37 +0300)] 
Tests: Add .lzma test files.

3 years agoliblzma: Rename a variable and improve a comment.
Lasse Collin [Thu, 14 Jul 2022 15:12:38 +0000 (18:12 +0300)] 
liblzma: Rename a variable and improve a comment.

3 years agoUpdate THANKS.
Lasse Collin [Wed, 13 Jul 2022 19:24:41 +0000 (22:24 +0300)] 
Update THANKS.

3 years agoliblzma: Add optional autodetection of LZMA end marker.
Lasse Collin [Wed, 13 Jul 2022 19:24:07 +0000 (22:24 +0300)] 
liblzma: Add optional autodetection of LZMA end marker.

Turns out that this is needed for .lzma files as the spec in
LZMA SDK says that end marker may be present even if the size
is stored in the header. Such files are rare but exist in the
real world. The code in liblzma is so old that the spec didn't
exist in LZMA SDK back then and I had understood that such
files weren't possible (the lzma tool in LZMA SDK didn't
create such files).

This modifies the internal API so that LZMA decoder can be told
if EOPM is allowed even when the uncompressed size is known.
It's allowed with .lzma and not with other uses.

Thanks to Karl Beldan for reporting the problem.

3 years agoTests: Add test file good-1-empty-bcj-lzma2.xz.
Lasse Collin [Tue, 14 Jun 2022 14:20:49 +0000 (17:20 +0300)] 
Tests: Add test file good-1-empty-bcj-lzma2.xz.

This is from test_bcj_exact_size.c.
It's good to have it as a standalone file.

3 years agoUpdate THANKS.
Lasse Collin [Wed, 30 Mar 2022 21:05:07 +0000 (00:05 +0300)] 
Update THANKS.

3 years agoxzgrep: Fix escaping of malicious filenames (ZDI-CAN-16587).
Lasse Collin [Tue, 29 Mar 2022 16:19:12 +0000 (19:19 +0300)] 
xzgrep: Fix escaping of malicious filenames (ZDI-CAN-16587).

Malicious filenames can make xzgrep to write to arbitrary files
or (with a GNU sed extension) lead to arbitrary code execution.

xzgrep from XZ Utils versions up to and including 5.2.5 are
affected. 5.3.1alpha and 5.3.2alpha are affected as well.
This patch works for all of them.

This bug was inherited from gzip's zgrep. gzip 1.12 includes
a fix for zgrep.

The issue with the old sed script is that with multiple newlines,
the N-command will read the second line of input, then the
s-commands will be skipped because it's not the end of the
file yet, then a new sed cycle starts and the pattern space
is printed and emptied. So only the last line or two get escaped.

One way to fix this would be to read all lines into the pattern
space first. However, the included fix is even simpler: All lines
except the last line get a backslash appended at the end. To ensure
that shell command substitution doesn't eat a possible trailing
newline, a colon is appended to the filename before escaping.
The colon is later used to separate the filename from the grep
output so it is fine to add it here instead of a few lines later.

The old code also wasn't POSIX compliant as it used \n in the
replacement section of the s-command. Using \<newline> is the
POSIX compatible method.

LC_ALL=C was added to the two critical sed commands. POSIX sed
manual recommends it when using sed to manipulate pathnames
because in other locales invalid multibyte sequences might
cause issues with some sed implementations. In case of GNU sed,
these particular sed scripts wouldn't have such problems but some
other scripts could have, see:

    info '(sed)Locale Considerations'

This vulnerability was discovered by:
cleemy desu wayo working with Trend Micro Zero Day Initiative

Thanks to Jim Meyering and Paul Eggert discussing the different
ways to fix this and for coordinating the patch release schedule
with gzip.

3 years agoUpdate THANKS.
Lasse Collin [Wed, 23 Mar 2022 14:34:00 +0000 (16:34 +0200)] 
Update THANKS.

3 years agoliblzma: Fix docs: lzma_block_decoder() cannot return LZMA_UNSUPPORTED_CHECK.
Lasse Collin [Sun, 6 Mar 2022 14:54:23 +0000 (16:54 +0200)] 
liblzma: Fix docs: lzma_block_decoder() cannot return LZMA_UNSUPPORTED_CHECK.

If Check is unsupported, it will be silently ignored.
It's the caller's job to handle it.

3 years agoliblzma: Index hash: Change return value type of hash_append() to void.
Lasse Collin [Sun, 6 Mar 2022 13:18:58 +0000 (15:18 +0200)] 
liblzma: Index hash: Change return value type of hash_append() to void.

3 years agoliblzma: Minor addition to lzma_vli_size() API doc.
Lasse Collin [Tue, 22 Feb 2022 01:42:57 +0000 (03:42 +0200)] 
liblzma: Minor addition to lzma_vli_size() API doc.

Thanks to Jia Tan.

3 years agoliblzma: Check the return value of lzma_index_append() in threaded encoder.
Lasse Collin [Tue, 22 Feb 2022 00:04:18 +0000 (02:04 +0200)] 
liblzma: Check the return value of lzma_index_append() in threaded encoder.

If lzma_index_append() failed (most likely memory allocation failure)
it could have gone unnoticed and the resulting .xz file would have
an incorrect Index. Decompressing such a file would produce the
correct uncompressed data but then an error would occur when
verifying the Index field.

3 years agoUpdate THANKS.
Lasse Collin [Mon, 21 Feb 2022 23:37:39 +0000 (01:37 +0200)] 
Update THANKS.

3 years agoliblzma: Use non-executable stack on FreeBSD as on Linux
Ed Maste [Fri, 11 Feb 2022 15:25:46 +0000 (15:25 +0000)] 
liblzma: Use non-executable stack on FreeBSD as on Linux

3 years agoliblzma: Make Block decoder catch certain types of errors better.
Lasse Collin [Sun, 20 Feb 2022 18:36:27 +0000 (20:36 +0200)] 
liblzma: Make Block decoder catch certain types of errors better.

Now it limits the input and output buffer sizes that are
passed to a raw decoder. This way there's no need to check
if the sizes can grow too big or overflow when updating
Compressed Size and Uncompressed Size counts. This also means
that a corrupt file cannot cause the raw decoder to process
useless extra input or output that would exceed the size info
in Block Header (and thus cause LZMA_DATA_ERROR anyway).

More importantly, now the size information is verified more
carefully in case raw decoder returns LZMA_OK. This doesn't
really matter with the current single-threaded .xz decoder
as the errors would be detected slightly later anyway. But
this helps avoiding corner cases in the upcoming threaded
decompressor, and it might help other Block decoder uses
outside liblzma too.

The test files bad-1-lzma2-{9,10,11}.xz test these conditions.
With the single-threaded .xz decoder the only difference is
that LZMA_DATA_ERROR is detected in a difference place now.

3 years agoTests: Add bad-1-lzma2-11.xz.
Lasse Collin [Sun, 20 Feb 2022 17:38:55 +0000 (19:38 +0200)] 
Tests: Add bad-1-lzma2-11.xz.

3 years agoTranslations: Fix po4a failure with the French man page translations.
Lasse Collin [Fri, 18 Feb 2022 16:51:10 +0000 (18:51 +0200)] 
Translations: Fix po4a failure with the French man page translations.

Thanks to Mario Blättermann for the patch.

3 years agoTranslations: Add French translation of man pages.
Lasse Collin [Sun, 6 Feb 2022 23:14:37 +0000 (01:14 +0200)] 
Translations: Add French translation of man pages.

This matches xz-utils 5.2.5-2 in Debian.

The translation was done by "bubu", proofread by the debian-l10n-french
mailing list contributors, and submitted to me on the xz-devel mailing
list by Jean-Pierre Giraud. Thanks to everyone!

3 years agoliblzma: Add NULL checks to LZMA and LZMA2 properties encoders.
jiat75 [Fri, 28 Jan 2022 12:47:55 +0000 (20:47 +0800)] 
liblzma: Add NULL checks to LZMA and LZMA2 properties encoders.

Previously lzma_lzma_props_encode() and lzma_lzma2_props_encode()
assumed that the options pointers must be non-NULL because the
with these filters the API says it must never be NULL. It is
good to do these checks anyway.

3 years agoCMake: Keep compatible with Windows 95 for 32-bit build.
huangqinjin [Mon, 13 Dec 2021 12:49:21 +0000 (20:49 +0800)] 
CMake: Keep compatible with Windows 95 for 32-bit build.

3 years agoxzgrep: Update man page timestamp.
Lasse Collin [Sat, 13 Nov 2021 19:04:05 +0000 (21:04 +0200)] 
xzgrep: Update man page timestamp.

3 years agoUpdate THANKS.
Lasse Collin [Sat, 13 Nov 2021 16:23:24 +0000 (18:23 +0200)] 
Update THANKS.

3 years agoxzgrep: use `grep -E/-F` instead of `egrep` and `fgrep`
Ville Skyttä [Sat, 13 Nov 2021 08:11:57 +0000 (10:11 +0200)] 
xzgrep: use `grep -E/-F` instead of `egrep` and `fgrep`

`egrep` and `fgrep` have been deprecated in GNU grep since 2007, and in
current post 3.7 Git they have been made to emit obsolescence warnings:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1

3 years agoUpdate THANKS.
Lasse Collin [Wed, 27 Oct 2021 20:27:48 +0000 (23:27 +0300)] 
Update THANKS.

3 years agoxz: Change the coding style of the previous commit.
Lasse Collin [Wed, 27 Oct 2021 20:23:11 +0000 (23:23 +0300)] 
xz: Change the coding style of the previous commit.

It isn't any better now but it's consistent with
the rest of the code base.

3 years agoxz: Avoid fchown(2) failure.
Alexander Bluhm [Tue, 5 Oct 2021 21:33:16 +0000 (23:33 +0200)] 
xz: Avoid fchown(2) failure.

OpenBSD does not allow to change the group of a file if the user
does not belong to this group.  In contrast to Linux, OpenBSD also
fails if the new group is the same as the old one.  Do not call
fchown(2) in this case, it would change nothing anyway.

This fixes an issue with Perl Alien::Build module.
https://github.com/PerlAlien/Alien-Build/issues/62

3 years agoUpdate THANKS.
Lasse Collin [Thu, 9 Sep 2021 19:21:07 +0000 (22:21 +0300)] 
Update THANKS.

3 years agoliblzma: Use _MSVC_LANG to detect when "noexcept" can be used with MSVC.
Lasse Collin [Thu, 9 Sep 2021 18:41:51 +0000 (21:41 +0300)] 
liblzma: Use _MSVC_LANG to detect when "noexcept" can be used with MSVC.

By default, MSVC always sets __cplusplus to 199711L. The real
C++ standard version is available in _MSVC_LANG (or one could
use /Zc:__cplusplus to set __cplusplus correctly).

Fixes <https://sourceforge.net/p/lzmautils/discussion/708858/thread/f6bc3b108a/>.

Thanks to Dan Weiss.

3 years agoxzdiff: Update the man page about the exit status.
Lasse Collin [Fri, 4 Jun 2021 16:02:38 +0000 (19:02 +0300)] 
xzdiff: Update the man page about the exit status.

This was forgotten from 194029ffaf74282a81f0c299c07f73caca3232ca.

3 years agoxzless: Fix less(1) version detection when it contains a dot.
Lasse Collin [Fri, 4 Jun 2021 15:52:48 +0000 (18:52 +0300)] 
xzless: Fix less(1) version detection when it contains a dot.

Sometimes the version number from "less -V" contains a dot,
sometimes not. xzless failed detect the version number when
it does contain a dot. This fixes it.

Thanks to nick87720z for reporting this. Apparently it had been
reported here <https://bugs.gentoo.org/489362> in 2013.

3 years agoxz: Document the special memlimit case of 2000 MiB on MIPS32.
Lasse Collin [Tue, 12 Jul 2022 15:53:04 +0000 (18:53 +0300)] 
xz: Document the special memlimit case of 2000 MiB on MIPS32.

See commit 95806a8a52ae57bddf6c77dfd19cf7938a92e040.

3 years agoUpdate THANKS.
Lasse Collin [Sun, 11 Apr 2021 16:58:10 +0000 (19:58 +0300)] 
Update THANKS.

3 years agoReduce maximum possible memory limit on MIPS32
Ivan A. Melnikov [Fri, 9 Apr 2021 08:45:10 +0000 (11:45 +0300)] 
Reduce maximum possible memory limit on MIPS32

Due to architectural limitations, address space available to a single
userspace process on MIPS32 is limited to 2 GiB, not 4, even on systems
that have more physical RAM -- e.g. 64-bit systems with 32-bit
userspace, or systems that use XPA (an extension similar to x86's PAE).

So, for MIPS32, we have to impose stronger memory limits. I've chosen
2000MiB to give the process some headroom.

3 years agoCMake: Use interface library for better FindLibLZMA compatibility.
Lasse Collin [Sat, 13 Feb 2021 21:31:27 +0000 (23:31 +0200)] 
CMake: Use interface library for better FindLibLZMA compatibility.

https://www.mail-archive.com/xz-devel@tukaani.org/msg00446.html

Thanks to Markus Rickert.

3 years agoCMake: Try to improve compatibility with the FindLibLZMA module.
Lasse Collin [Sat, 30 Jan 2021 16:36:04 +0000 (18:36 +0200)] 
CMake: Try to improve compatibility with the FindLibLZMA module.

The naming conflict with FindLibLZMA module gets worse.
Not avoiding it in the first place was stupid.

Normally find_package(LibLZMA) will use the module and
find_package(liblzma 5.2.5 REQUIRED CONFIG) will use the config
file even with a case insensitive file system. However, if
CMAKE_FIND_PACKAGE_PREFER_CONFIG is TRUE and the file system
is case insensitive, find_package(LibLZMA) will find our liblzma
config file instead of using FindLibLZMA module.

One big problem with this is that FindLibLZMA uses
LibLZMA::LibLZMA and we use liblzma::liblzma as the target
name. With target names CMake happens to be case sensitive.
To workaround this, this commit adds

    add_library(LibLZMA::LibLZMA ALIAS liblzma::liblzma)

to the config file. Then both spellings work.

To make the behavior consistent between case sensitive and
insensitive file systems, the config and related files are
renamed from liblzmaConfig.cmake to liblzma-config.cmake style.
With this style CMake looks for lowercase version of the package
name so find_package(LiBLzmA 5.2.5 REQUIRED CONFIG) will work
to find our config file.

There are other differences between our config file and
FindLibLZMA so it's still possible that things break for
reasons other than the spelling of the target name. Hopefully
those situations aren't too common.

When the config file is available, it should always give as good or
better results as FindLibLZMA so this commit doesn't affect the
recommendation to use find_package(liblzma 5.2.5 REQUIRED CONFIG)
which explicitly avoids FindLibLZMA.

Thanks to Markus Rickert.

3 years agoTests: Add bad-1-lzma2-10.xz and also modify -9.xz.
Lasse Collin [Sun, 24 Jan 2021 20:32:41 +0000 (22:32 +0200)] 
Tests: Add bad-1-lzma2-10.xz and also modify -9.xz.

3 years agoTests: Add bad-1-lzma2-9.xz.
Lasse Collin [Sun, 24 Jan 2021 16:51:51 +0000 (18:51 +0200)] 
Tests: Add bad-1-lzma2-9.xz.

3 years agoTests: Add bad-1-check-crc32-2.xz.
Lasse Collin [Sun, 24 Jan 2021 15:02:00 +0000 (17:02 +0200)] 
Tests: Add bad-1-check-crc32-2.xz.

3 years agoScripts: Add zstd support to xzdiff.
Lasse Collin [Mon, 11 Jan 2021 21:57:11 +0000 (23:57 +0200)] 
Scripts: Add zstd support to xzdiff.

3 years agoScripts: Fix exit status of xzgrep.
Lasse Collin [Mon, 11 Jan 2021 21:28:52 +0000 (23:28 +0200)] 
Scripts: Fix exit status of xzgrep.

Omit the -q option from xz, gzip, and bzip2. With xz this shouldn't
matter. With gzip it's important because -q makes gzip replace SIGPIPE
with exit status 2. With bzip2 it's important because with -q bzip2
is completely silent if input is corrupt while other decompressors
still give an error message.

Avoiding exit status 2 from gzip is important because bzip2 uses
exit status 2 to indicate corrupt input. Before this commit xzgrep
didn't recognize corrupt .bz2 files because xzgrep was treating
exit status 2 as SIGPIPE for gzip compatibility.

zstd still needs -q because otherwise it is noisy in normal
operation.

The code to detect real SIGPIPE didn't check if the exit status
was due to a signal (>= 128) and so could ignore some other exit
status too.

3 years agoScripts: Fix exit status of xzdiff/xzcmp.
Lasse Collin [Mon, 11 Jan 2021 20:01:51 +0000 (22:01 +0200)] 
Scripts: Fix exit status of xzdiff/xzcmp.

This is a minor fix since this affects only the situation when
the files differ and the exit status is something else than 0.
In such case there could be SIGPIPE from a decompression tool
and that would result in exit status of 2 from xzdiff/xzcmp
while the correct behavior would be to return 1 or whatever
else diff or cmp may have returned.

This commit omits the -q option from xz/gzip/bzip2/lzop arguments.
I'm not sure why the -q was used in the first place, perhaps it
hides warnings in some situation that I cannot see at the moment.
Hopefully the removal won't introduce a new bug.

With gzip the -q option was harmful because it made gzip return 2
instead of >= 128 with SIGPIPE. Ignoring exit status 2 (warning
from gzip) isn't practical because bzip2 uses exit status 2 to
indicate corrupt input file. It's better if SIGPIPE results in
exit status >= 128.

With bzip2 the removal of -q seems to be good because with -q
it prints nothing if input is corrupt. The other tools aren't
silent in this situation even with -q. On the other hand, if
zstd support is added, it will need -q since otherwise it's
noisy in normal situations.

Thanks to Étienne Mollier and Sebastian Andrzej Siewior.

3 years agoUpdate THANKS.
Lasse Collin [Wed, 23 Dec 2020 15:15:49 +0000 (17:15 +0200)] 
Update THANKS.

3 years agoliblzma: Enable Intel CET in x86 CRC assembly codes
H.J. Lu [Wed, 23 Dec 2020 14:49:04 +0000 (06:49 -0800)] 
liblzma: Enable Intel CET in x86 CRC assembly codes

When Intel CET is enabled, we need to include <cet.h> in assembly codes
to mark Intel CET support and add _CET_ENDBR to indirect jump targets.

Tested on Intel Tiger Lake under CET enabled Linux.

3 years agoUpdate THANKS.
Lasse Collin [Wed, 16 Dec 2020 16:33:29 +0000 (18:33 +0200)] 
Update THANKS.

3 years agoBuild: Don't build bundles on Apple OSes.
Lasse Collin [Wed, 16 Dec 2020 16:30:14 +0000 (18:30 +0200)] 
Build: Don't build bundles on Apple OSes.

Thanks to Daniel Packard.

3 years agoUpdate THANKS.
Lasse Collin [Sat, 5 Dec 2020 20:44:03 +0000 (22:44 +0200)] 
Update THANKS.

3 years agoScripts: Add zstd support to xzgrep.
Adam Borowski [Fri, 25 Sep 2020 01:35:18 +0000 (03:35 +0200)] 
Scripts: Add zstd support to xzgrep.

Thanks to Adam Borowski.

3 years agoCMake: Fix compatibility with CMake 3.13.
Lasse Collin [Tue, 17 Nov 2020 18:51:48 +0000 (20:51 +0200)] 
CMake: Fix compatibility with CMake 3.13.

The syntax "if(DEFINED CACHE{FOO})" requires CMake 3.14.
In some other places the code treats the cache variables
like normal variables already (${FOO} or if(FOO) is used,
not ${CACHE{FOO}).

Thanks to ygrek for reporting the bug on IRC.

3 years agoUpdate THANKS.
Lasse Collin [Sun, 1 Nov 2020 20:56:43 +0000 (22:56 +0200)] 
Update THANKS.

3 years agoxz: Avoid unneeded \f escapes on the man page.
Lasse Collin [Sun, 1 Nov 2020 20:34:25 +0000 (22:34 +0200)] 
xz: Avoid unneeded \f escapes on the man page.

I don't want to use \c in macro arguments but groff_man(7)
suggests that \f has better portability. \f would be needed
for the .TP strings for portability reasons anyway.

Thanks to Bjarni Ingi Gislason.

3 years agoxz: Use non-breaking spaces when intentionally using more than one space.
Lasse Collin [Sun, 1 Nov 2020 17:09:53 +0000 (19:09 +0200)] 
xz: Use non-breaking spaces when intentionally using more than one space.

This silences some style checker warnings. Seems that spaces
in the beginning of a line don't need this treatment.

Thanks to Bjarni Ingi Gislason.

3 years agoxz: Protect the ellipsis (...) on the man page with \&.
Lasse Collin [Sun, 1 Nov 2020 16:49:37 +0000 (18:49 +0200)] 
xz: Protect the ellipsis (...) on the man page with \&.

This does it only when ... appears outside macro calls.

Thanks to Bjarni Ingi Gislason.

3 years agoxz: Avoid the abbreviation "e.g." on the man page.
Lasse Collin [Sun, 1 Nov 2020 16:41:21 +0000 (18:41 +0200)] 
xz: Avoid the abbreviation "e.g." on the man page.

A few are simply omitted, most are converted to "for example"
and surrounded with commas. Sounds like that this is better
style, for example, man-pages(7) recommends avoiding such
abbreviations except in parenthesis.

Thanks to Bjarni Ingi Gislason.

3 years agoxz man page: Change \- (minus) to \(en (en-dash) for a numeric range.
Lasse Collin [Sun, 12 Jul 2020 20:10:03 +0000 (23:10 +0300)] 
xz man page: Change \- (minus) to \(en (en-dash) for a numeric range.

Docs of ancient troff/nroff mention \(em (em-dash) but not \(en
and \- was used for both minus and en-dash. I don't know how
portable \(en is nowadays but it can be changed back if someone
complains. At least GNU groff and OpenBSD's mandoc support it.

Thanks to Bjarni Ingi Gislason for the patch.

3 years agoWindows: Fix building of resource files when config.h isn't used.
Lasse Collin [Sun, 12 Jul 2020 17:46:24 +0000 (20:46 +0300)] 
Windows: Fix building of resource files when config.h isn't used.

Now CMake + Visual Studio works for building liblzma.dll.

Thanks to Markus Rickert.

3 years agosrc/scripts/xzgrep.1: Filenames to xzgrep are optional.
Lasse Collin [Mon, 6 Apr 2020 16:31:50 +0000 (19:31 +0300)] 
src/scripts/xzgrep.1: Filenames to xzgrep are optional.

xzgrep --help was correct already.

3 years agoTranslations: Add Portuguese translation.
Lasse Collin [Tue, 12 Jul 2022 14:59:41 +0000 (17:59 +0300)] 
Translations: Add Portuguese translation.

Jia Tan made white-space changes and also changed "Language: pt_BR\n"
to pt. The translator wasn't reached so I'm hoping these changes
are OK and will commit it without translator's approval.

Thanks to Pedro Albuquerque and Jia Tan.

3 years agosrc/script/xzgrep.1: Remove superfluous '.RB'
Bjarni Ingi Gislason [Thu, 26 Mar 2020 22:17:31 +0000 (22:17 +0000)] 
src/script/xzgrep.1: Remove superfluous '.RB'

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ./src/scripts/xzgrep.1

<src/scripts/xzgrep.1>:20 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:23 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:26 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:29 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:32 (macro RB): only 1 argument, but more are expected

 "abc..." does not mean the same as "abc ...".

  The output from nroff and troff is unchanged except for the space
between "file" and "...".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agoxzgrep.1: Delete superfluous '.PP'
Bjarni Ingi Gislason [Mon, 30 Mar 2020 21:56:36 +0000 (21:56 +0000)] 
xzgrep.1: Delete superfluous '.PP'

Summary:

mandoc -T lint xzgrep.1 :
mandoc: xzgrep.1:79:2: WARNING: skipping paragraph macro: PP empty

  There is no change in the output of "nroff" and "troff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agosrc/xz/xz.1: Correct misused two-fonts macros
Bjarni Ingi Gislason [Thu, 26 Mar 2020 21:16:18 +0000 (21:16 +0000)] 
src/xz/xz.1: Correct misused two-fonts macros

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ./src/xz/xz.1

<src/xz/xz.1>:408 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1009 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1743 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1920 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:2213 (macro BR): only 1 argument, but more are expected

  Output from nroff and troff is unchanged, except for a font change of a
full stop (.).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agoTranslations: Add Serbian translation.
Lasse Collin [Sun, 10 Jul 2022 18:16:40 +0000 (21:16 +0300)] 
Translations: Add Serbian translation.

Quite a few white-space changes were made by Jia Tan to make
this look good. Contacting the translator didn't succeed so
I'm committing this without getting translator's approval.

Thanks to Мирослав Николић (Miroslav Nikolic) and Jia Tan.

3 years agoTranslations: Add Swedish translation.
Lasse Collin [Mon, 4 Jul 2022 20:51:36 +0000 (23:51 +0300)] 
Translations: Add Swedish translation.

Thanks to Sebastian Rasmussen and Jia Tan.

3 years agoTranslations: Add Esperanto translation.
Lasse Collin [Mon, 4 Jul 2022 20:40:27 +0000 (23:40 +0300)] 
Translations: Add Esperanto translation.

Thanks to Keith Bowes and Jia Tan.

3 years agoTranslations: Add Catalan translation.
Lasse Collin [Thu, 30 Jun 2022 21:22:33 +0000 (00:22 +0300)] 
Translations: Add Catalan translation.

Thanks to Jordi Mas and Jia Tan.

3 years agoTranslations: Add Ukrainian translation.
Lasse Collin [Thu, 30 Jun 2022 14:47:08 +0000 (17:47 +0300)] 
Translations: Add Ukrainian translation.

Thanks to Yuri Chornoivan and Jia Tan.

3 years agoTranslators: Add Romanian translation.
Lasse Collin [Thu, 30 Jun 2022 14:45:26 +0000 (17:45 +0300)] 
Translators: Add Romanian translation.

Thanks to Remus-Gabriel Chelu and Jia Tan.

3 years agoTranslations: Update Brazilian Portuguese translation.
Lasse Collin [Wed, 29 Jun 2022 15:33:32 +0000 (18:33 +0300)] 
Translations: Update Brazilian Portuguese translation.

One msgstr was changed. The diff is long due to changes
in the source code line numbers in the comments.

Thanks to Rafael Fontenelle.

3 years agoTranslations: Add Croatian translation.
Lasse Collin [Wed, 29 Jun 2022 15:04:44 +0000 (18:04 +0300)] 
Translations: Add Croatian translation.

Thanks to Božidar Putanec and Jia Tan.

3 years agoTranslations: Add Spanish translation.
Lasse Collin [Wed, 29 Jun 2022 14:58:48 +0000 (17:58 +0300)] 
Translations: Add Spanish translation.

Thanks to Cristian Othón Martínez Vera and Jia Tan.

3 years agoTranslations: Add Korean translation.
Lasse Collin [Wed, 29 Jun 2022 14:49:43 +0000 (17:49 +0300)] 
Translations: Add Korean translation.

Thanks to Seong-ho Cho and Jia Tan.

5 years agov5.2-specific typo fix from fossies.org.
Lasse Collin [Mon, 23 Mar 2020 16:09:40 +0000 (18:09 +0200)] 
v5.2-specific typo fix from fossies.org.

5 years agoTypo fixes from fossies.org.
Lasse Collin [Mon, 23 Mar 2020 16:07:50 +0000 (18:07 +0200)] 
Typo fixes from fossies.org.

https://fossies.org/linux/misc/xz-5.2.5.tar.xz/codespell.html

5 years agoBump version and soname for 5.2.5. v5.2.5
Lasse Collin [Tue, 17 Mar 2020 14:27:42 +0000 (16:27 +0200)] 
Bump version and soname for 5.2.5.

5 years agoUpdate NEWS for 5.2.5.
Lasse Collin [Tue, 17 Mar 2020 14:26:04 +0000 (16:26 +0200)] 
Update NEWS for 5.2.5.

5 years agoTranslations: Rebuild cs.po to avoid incorrect fuzzy strings.
Lasse Collin [Mon, 16 Mar 2020 19:57:21 +0000 (21:57 +0200)] 
Translations: Rebuild cs.po to avoid incorrect fuzzy strings.

"make dist" updates the .po files and the fuzzy strings would
result in multiple very wrong translations.

5 years agoREADME: Update outdated sections.
Lasse Collin [Mon, 16 Mar 2020 18:01:37 +0000 (20:01 +0200)] 
README: Update outdated sections.

5 years agoREADME: Mention that translatable strings will change after 5.2.x.
Lasse Collin [Mon, 16 Mar 2020 17:46:27 +0000 (19:46 +0200)] 
README: Mention that translatable strings will change after 5.2.x.

5 years agoREADME: Mention that man pages can be translated.
Lasse Collin [Mon, 16 Mar 2020 17:39:45 +0000 (19:39 +0200)] 
README: Mention that man pages can be translated.