| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* tests/write-error: Make executable. Skip the test if we're running as root.
|
|
|
|
|
|
|
|
|
|
|
| |
* gzip.c (create_outfile): Call write_error, not progerror,
so failure to open for writing gives a better diagnostic:
gzip: failed to write d/f.gz: Permission denied
rather than this:
gzip: d/f.gz: Permission denied
* tests/write-error: New file, to test for this.
* tests/Makefile.am (TESTS): Add the file name.
Reported in https://bugs.gnu.org/16876.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix gzip to behave like cat etc. when outputting to a broken pipe:
i.e., exit with nonzero status if SIGPIPE is ignored, and be
terminated by SIGPIPE otherwise.
* NEWS: Mention this.
* gzip.c: Do not install signal handlers unless creating an output
file, for which signal handlers are needed. This avoids gzip
having to deal with signal handlers when outputting to stdout.
(exiting_signal): Remove. All uses removed.
(main): Do not install signal handlers at first.
(create_outfile): Instead, install them only when needed.
(finish_up_gzip): New function, which generalizes abort_gzip.
(abort_gzip): Use it.
* tests/pipe-output: New test.
* tests/Makefile.am (TESTS): Add it.
* util.c (EPIPE): Default to 0.
(write_error): Just warn if it is a pipe error, and suppress that
warning if quiet. In any event exit with status 2 (warning),
not status 1 (error).
* zgrep.in: Treat gzip status 141 like status 2;
it is a broken pipe either way.
|
| |
|
|
|
|
|
| |
* NEWS: Mention the bug.
* tests/unpack-invalid: Test for the bug.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Jim Avera (Bug#31280).
This became more of an issue when GNU grep 3.5 (2020) started sending
"binary file matches" diagnostics to stderr instead of to stdout.
* tests/Makefile.am (TESTS): Add zgrep-binary.
* tests/zgrep-binary: New test.
* zgrep.in (args): New var, to accumulate args separately
from grep command, so we can prepend args if need be.
Most uses of 'grep' changed to use 'args' instead, or also.
(with_filename): Set to 1 if more than one file and -h not given;
this simplifies later code.
(gnuish_grep): New var; evaluates to true if grep supports
-H and --label options, as is true for GNU and FreeBSD grep.
Append -H to 'grep' if outputting file names with GNUish grep,
and use --label with GNUish grep unless reading from stdin,
as that’s safer and more efficient than relabeling with 'sed'.
|
|
|
|
|
|
|
| |
* tests/zgrep-abuse: New file, based on PoC by cleemy desu wayo.
* tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the exploit.
The bug appears to have been present since the beginning.
|
|
|
|
|
| |
* bootstrap, tests/init.sh: Copy manually from current Gnulib.
* lib/.gitignore, m4/.gitignore: Update as per current Gnulib.
|
|
|
|
| |
* tests/list-big: Use dd, not truncate, to create a big file.
|
|
|
|
|
|
|
| |
* tests/help-version (zmore_setup): Unset PAGER so that we test
'more', not whatever the tester has in its PAGER environment
variable. This works around a problem I found when I ran
'PAGER=less make check' on a platform that lacked 'less'.
|
|
|
|
|
|
|
|
|
| |
Problem reported by Michael Felt (Bug#30029).
* Makefile.am (ZLESS_MAN, ZLESS_PROG): New macros.
(man_MANS, bin_SCRIPTS): Use them.
* configure.ac: Check for 'less'.
* tests/Makefile.am (ZLESS_PROG): New macro.
(built_programs): Use it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gzip -l now decompresses to see how long the uncompressed file was.
This fixes what is by far the most common bug report for gzip.
It has a significant performance cost, but it’s worth it nowadays.
* gzip.c (main): -l now sets 'test' too. All uses of
'test' changed.
(treat_stdin, treat_file): Call do_list after decompressing,
so that the length is known.
(do_list): Omit arg IFD, since it is no longer needed.
All callers changed. Get the CRC and uncompressed size
from input_crc and bytes_out instead of using lseek.
* tests/list-big: New test.
* unzip.c (unzip): Set unzip_crc before returning.
* util.c (write_buf): If 'test', output nothing.
Update bytes_out with output byte count, regardless of 'test'.
All callers changed.
|
|
|
|
| |
* tests/hufts: Ignore more lines starting with ‘+’ in stderr.
|
|
|
|
|
|
| |
* tests/hufts, tests/zdiff:
Ignore lines starting with ‘+’ in stderr.
The NetBSD shell outputs them after set -x.
|
|
|
|
|
|
|
| |
This merges coreutils/tests/misc/help-version.sh into
gzip/tests/help-version; they're now identical except
for the initial init.sh configuration line. This
should port better to NetBSD.
|
|
|
|
|
| |
Problem reported by Nelson H. F. Beebe.
* tests/two-files: Skip test if /dev/urandom is not readable.
|
|
|
|
|
|
|
| |
Run "make update-copyright" and then...
* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
|
|
|
|
|
| |
It ensures that compression and decompression state of the first file
does not affect the second file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SUSE maintainers have found an issue related to building zlib in 31-bit
mode, which also applies to gzip: STFLE instruction can be used only in
z/Architecture mode: https://build.opensuse.org/request/show/708284 --
I have integrated the fix into this patch.
* configure.ac (AC_CHECK_HEADERS_ONCE): Add feature detection for
sys/sdt.h probes.
* dfltcc.c (dfltcc_cc): Minor formatting improvements.
(HB_BITS): Remove.
(HB_SIZE): Likewise.
(is_dfltcc_enabled): Fix buffer overrun on newer models and incomplete
initialization on older models.
Add machine mode hint.
(dfltcc): Use sys/sdt.h feature detection.
(bi_load): New function.
(bi_close_block): Use bi_load.
(close_stream): Fix overwriting the End-of-block Symbol.
(dfltcc_deflate): Fix losing partial byte on flush.
Fix setting Block-Continuation Flag when DFLTCC-CMPR outputs 0 bits and
requests a retry.
Minor formatting improvements.
(dfltcc_inflate): Retry immediately if requested.
Print the hardware error code and flush the output buffer on error.
Minor formatting improvements.
* tests/hufts: Ignore the hardware error code.
|
|
|
|
|
|
|
| |
Run "make update-copyright" and then...
* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Future versions of IBM Z mainframes will provide DFLTCC instruction,
which implements deflate algorithm in hardware with estimated
compression and decompression performance orders of magnitude faster
than the current gzip and ratio comparable with that of level 1.
This patch adds DFLTCC support to gzip. In order to enable it, the
following build commands should be used:
$ ./configure --enable-dfltcc
$ make
When built like this, gzip would compress in hardware on level 1, and in
software on all other levels. Decompression will always happen in
hardware. In order to enable DFLTCC compression for levels 1-6 (i.e. to
make it used by default) one could either add -DDFLTCC_LEVEL_MASK=0x7e
at compile time, or set the environment variable DFLTCC_LEVEL_MASK to
0x7e at run time.
Two DFLTCC compression calls produce the same results only when they
both are made on machines of the same generation, and when the
respective buffers have the same offset relative to the start of the
page. Therefore care should be taken when using hardware compression
when reproducible results are desired. One such use case - reproducible
software builds - is handled explicitly: when SOURCE_DATE_EPOCH
environment variable is set, the hardware compression is disabled.
This patch tries to add DFLTCC support in a least intrusive way.
All SystemZ-specific code was placed into a separate file, but
unfortunately there is still a noticeable amount of changes in the
main gzip code. Below is the summary of those changes.
DFLTCC will refuse to write an End-of-block Symbol if there is no input
data, thus in some cases it is necessary to do this manually. In order
to achieve this, bi_buf and bi_valid were promoted to extern variables.
lm_init() function moves the input buffer into the window, which is not
desirable for DFLTCC. Therefore, its invocation was moved to
software-only deflate(). In addition to initializing the window, this
function also used to convert compression level to flags, which is still
needed for DFLTCC. This responsibility was handed off to zip() function.
To achieve maximum performance with DFLTCC, inbuf and outbuf must be
256k big and page-aligned. Additionally, for DFLTCC to work at all, the
window must be page-aligned.
In addition to compression, DFLTCC computes CRC-32 checksum, therefore,
whenever it's used, software checksumming needs to be suppressed and its
results replaced by those of dfltcc. This is achieved by introducing the
new getcrc() and setcrc() functions.
Unlike the current software implementation, DFLTCC decompresses data
into the output buffer, and not the window. Therefore, just like
flushing the window, flushing the output buffer must honor the test
flag.
Finally, znew-k test assumes that "znew -K" would not convert the test
.Z file to .gz, which is not the case with DFLTCC. Since this is not the
main point of the test, this assumption was relaxed.
|
|
|
|
| |
* gnulib: Also update submodule for its copyright updates.
|
|
|
|
|
|
|
|
| |
Problem reported by Hanno Böck (Bug#33501).
* NEWS: Mention this.
* inflate.c (inflate_dynamic): Return if code is invalid.
Fix by Mark Adler.
* tests/hufts: Add test case for the bug.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Bernhard M. Wiedemann (Bug#32342).
* NEWS: Mention this.
* doc/gzip.texi (Overview, Invoking gzip): Document this.
* gzip.c (get_input_size_and_time): New function,
which implements the change.
(treat_stdin, treat_file): Use it.
* tests/reproducible: New test.
* tests/Makefile.am (TESTS): Add it.
|
| |
|
|
|
|
|
|
| |
* gnulib: Update to latest.
* bootstrap: Update from gnulib.
* all files: Run "make update-copyright".
|
|
|
|
|
|
|
| |
* tests/timestamp: We’ve had many false alarms about timestamps
that are not gzip problems, but instead are problems with ‘touch’.
Attempt to work around them by not trusting ‘touch’ so much.
Problems and parts of solutions proposed by Bruno Haible.
|
|
|
|
|
|
|
| |
* tests/unpack-invalid: There was a logic error that would have
caused this test to ignore a failure if first iteration of the
loop set fail=1 and the second one reset it to 0. Also, use
"returns_ 1 ...", to require an exit status of 1.
|
|
|
|
|
|
|
|
| |
Many versions of printf do not handle hexadecimal in a format string,
so this test would fail.
* tests/init.cfg (hex_printf_): Copied from grep's tests/init.cfg.
* tests/unpack-valid: Use hex_printf_.
Reported by Bruno Haible in https://bugs.gnu.org/29033#26
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Any user-specified suffix with an upper case
letter would fail to match desired file.
* gzip.c (get_suffix): First, arrange to have only one return
point rather than two. Put a lower-cased (just-malloc'd) copy
of z_suffix in the suffix vector, and free it before returning.
* tests/upper-suffix: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS: Mention it.
Reported by meo@xenialab.it in https://bugs.gnu.org/29006
|
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Vidar Holen (Bug#28861).
* NEWS: Mention fix.
* tests/unpack-valid: New test.
* tests/Makefile.am (TESTS): Add it.
* unpack.c (build_tree): Report an error if Huffman tree has
too few leaves.
* unpack.c (unpack): Fix check for EOB.
Remove now-unnecessary check for code out of range.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem reported by Denys Zagorui (Bug#26088).
* tests/zdiff: Check that diff uses POSIX-format output.
* zless.in (less_version): Don't exit merely because 'less -V'
fails; instead, assume 'less' is compatible with an old version of
the original 'less'. Busybox 'less -V' fails, but apparently its
'less' works anyway somehow.
|
|
|
|
|
| |
* tests/help-version (zcat_setup): Export TERM=dumb, to avoid zless
malfunction. Reported by Assaf Gordon in https://bugs.gnu.org/25636#8
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids a new syntax-check failure.
* ChangeLog-2007: Perform that change.
* NEWS: Likewise.
* algorithm.doc: Likewise.
* doc/gzip.texi: Likewise.
* gunzip.in: Likewise.
* gzip.1: Likewise.
* gzip.c: Likewise.
* gzip.h: Likewise.
* m4/.gitignore: Likewise.
* sample/ztouch: Likewise.
* tests/timestamp: Likewise.
* unzip.c: Likewise.
* zip.c: Likewise.
* znew.1: Likewise.
* cfg.mk: Update the old news hash accordingly.
|
|
|
|
|
| |
* gnulib: Update to latest.
* all files: Run "make update-copyright".
|
|
|
|
|
|
| |
* tests/zdiff: Use "returns_ 1" rather than testing $? = 1.
* tests/hufts: Likewise.
* tests/timestamp: Likewise, but s/1/2/.
|
|
|
|
|
|
| |
Problem reported by Jim Meyering (Bug#24826).
* tests/timestamp: Add a test from Jim Meyering to exercise the fix
* zip.c (zip): Treat unknown time stamps as 0.
|
|
|
|
|
| |
* tests/timestamp: Reorder "rm" arguments so the doubled-word
syntax-check rule does not detect a false positive "in in" here.
|
|
|
|
|
|
|
|
|
| |
* NEWS: Document this.
* gzip.c (get_method): Warn about out-of-range MTIME,
and ignore it instead of relying on possibly-undefined behavior.
* tests/Makefile.am (TESTS): Add timestamp.
* tests/timestamp: New test.
* zip.c (zip): Warn about out-of-range file time stamp.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Christian Franke via Eric Blake in:
http://bugs.gnu.org/23314
* NEWS: Mention this.
* gzip.c (main): Do not close stdout twice when given -l.
Instead, -l now just fflushes stdout, so that fdatasync
can synchronize it if --synchronize is also specified.
* tests/list: New test case.
* tests/Makefile.am (TESTS): Add it.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem reported by Fulvio Scapin in: http://bugs.gnu.org/22945
* NEWS: Document this.
* tests/zgrep-f: Add a test.
Adjust a test to cover the case of more than one line in -f's input.
* zgrep.in (with_filename): With -f FILE, if FILE is stdin or not
a regular file, copy it into a temporary and use the temporary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Document this.
* gzexe.in, gunzip.in, zcat.in, zcmp.in, zdiff.in, zegrep.in:
* zfgrep.in, zforce.in, zgrep.in, zless.in, zmore.in, znew.in:
Remove support for undocumented --__bindir option. Callers can
set PATH instead; that's less error-prone. This fixes some
'make check' failures on my Solaris 11 box, which occurred
because the test scripts were mistakenly testing the installed
gzip rather than the gzip in the working directory.
* Makefile.am (.in): Don't replace bindir.
(check-local): Set PATH instead of using --__bindir.
* tests/help-version (gunzip_setuphelp, gzexe_setuphelp)
(zcat_setuphelp, zcmp_setuphelp, zdiff_setuphelp)
(zegrep_setuphelp, zfgrep_setuphelp, zforce_setuphelp)
(zgrep_setuphelp, zless_setuphelp, zmore_setuphelp)
(znew_setuphelp): Remove. All uses removed.
(lbracket_setup): Default args to empty.
|
|
|
|
|
|
|
|
| |
* tests/Makefile.am (TESTS_ENVIRONMENT): Modernize:
remove unused shell_or_perl_ function, and use an
export_with_values function as grep does, to remove
a lot of duplication.
Reported by Assaf Gordon in http://debbugs.gnu.org/22900
|
|
|
|
|
|
|
|
|
| |
Run "make update-copyright" and then...
* gzip.c: Transform the copyright notice via s/2015/2016/.
* gnulib: Update to latest.
* tests/init.sh: Update from gnulib.
* bootstrap: Likewise.
|