summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix a test failure.HEADmasterBruno Haible2023-04-111-2/+6
| | | | * tests/write-error: Make executable. Skip the test if we're running as root.
* gzip: improve a write-failure diagnosticJim Meyering2023-04-073-1/+32
| | | | | | | | | | | * 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.
* build: update gnulib to latestJim Meyering2023-04-073-2/+8
|
* maint: prefer https: to git:Jim Meyering2023-02-042-2/+2
| | | | | | | | The idea is to defend against some adversary-in-the-middle attacks. Also prefer git.savannah.gnu.org over its shorter alias, git.sv.gnu.org to avoid a warning e.g., from git clone. Also, drop any final ".git" suffix on the resulting URIs. Inspired by Paul Eggert's nearly identical changes to coreutils.
* zless: improve gzip failure checkingPaul Eggert2023-02-032-1/+12
| | | | * zless.in: Use --show-preproc-error if available.
* gzip: fix exit status on broken pipePaul Eggert2023-02-037-18/+79
| | | | | | | | | | | | | | | | | | | | | | | 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.
* doc: document exit statusPaul Eggert2023-02-031-0/+3
| | | | * doc/gzip.texi: Document exit status.
* Don't require 'rsync' as a prerequisite. It is no longer needed since 2018.Bruno Haible2023-01-301-1/+0
| | | | * bootstrap.conf (buildreq): Remove rsync.
* Fix "make check" in a subdirectory (VPATH build).Bruno Haible2023-01-301-1/+1
| | | | | * Makefile.am (gzip.doc): Generate gzip.doc in the source directory, not in the build directory.
* maint: update --version copyright datesJim Meyering2023-01-1011-11/+11
| | | | | | | | * gunzip.in, gzexe.in, gzip.c, zcat.in, zcmp.in, zdiff.in, zforce.in, zgrep.in, zless.in, zmore.in, znew.in: Also update the --version copyright dates (those are not updated by update-copyright) by running this: grep -l ' 2022 Free'|xargs perl -pi -e 's/ 2022 Free/ 2023 Free/'
* build: update gnulib to latestJim Meyering2023-01-011-0/+0
|
* maint: update copyright datesJim Meyering2023-01-0170-70/+71
|
* maint: avoid new sc_tight_scope syntax-check failureJim Meyering2022-12-281-0/+2
| | | | | * cfg.mk (_gl_TS_extern): Allow a leading '_Noreturn ' on declarations like that of abort_gzip.
* maint: SPC-indent inflate.cJim Meyering2022-12-281-8/+8
| | | | * inflate.c: Indent with spaces, not TABs.
* maint: update THANKSPaul Eggert2022-12-271-7/+49
| | | | | | | Add lines for each bug reporter and fix contributor for which there is a Bug# in the commit messages. Fix some accents and email addresses and sorting issues while we’re in the neighborhood.
* gzip: use strerror, not perrorPaul Eggert2022-12-276-61/+20
| | | | | | | | | | | | * bootstrap.conf (gnulib_modules): Use strerror, not perror. This removes dependencies on Gnulib’s ‘threadlib’ and ‘lock’ modules, and simplifies the mainline code. Apparently the old code was written before strerror was universally supported; nowadays we can use Gnulib strerror instead. All uses of perror changed to use strerror+fprintf. * gzip.h (WARN): Since this expands to a statement, wrap within ‘do ... while (false)’ for the usual reasons. Helpful now that calls to WARN are now simplified.
* maint: link with $(LIB_FDATASYNC)Paul Eggert2022-12-271-1/+3
| | | | | | * Makefile.am (gzip_LDADD): Add LIB_FDATASYNC as gnulib-tool suggests. It’s not likely to make much difference nowadays (does anybody still run Solaris 10 x86?) but it shouldn’t hurt to add it.
* maint: go back to single-file bootstrapPaul Eggert2022-12-275-1377/+1320
| | | | | | | | | I recently added this option to Gnulib, and it seems a better match for gzip as it means just one bootstrap-related file. * README-hacking: Document this. * bootstrap: Sync from gnulib/build-aux/bootstrap, not from gnulib/top/bootstrap. * autogen.sh, autopull.sh, bootstrap-funclib.sh: Remove.
* build: update gnulib submodule to latestPaul Eggert2022-12-271-0/+0
|
* maint: more fallout from Gnulib syncPaul Eggert2022-12-265-3/+1360
| | | | | * README-hacking: Improve wording. * autogen.sh, autopull.sh, bootstrap-funclib.sh: New files.
* maint: do not include stdbool.h, stdalign.hPaul Eggert2022-12-263-5/+0
| | | | | They are not needed in C23, which Gnulib now emulates. (We no longer worry about C89, since Gnulib doesn’t.)
* maint: fix typo in previous patchPaul Eggert2022-12-251-1/+1
|
* maint: expand tabs in previous patchPaul Eggert2022-12-251-4/+4
|
* maint: sync to Gnulib bootstrapPaul Eggert2022-12-253-1010/+115
| | | | | | | | | | | Suggested by Bruno Haible (Bug#56749). * README-hacking: Document this. * bootstrap: Sync from Gnulib by running './bootstrap ./bootstrap --bootstrap-sync’. * bootstrap.conf: Do not mkdir build-aux, since bootstrap does that for us. (bootstrap_post_import_hook): Create the empty ChangeLog in this new function.
* maint: prefer https: to http:Paul Eggert2022-12-254-7/+7
| | | | This also syncs COPYING from Gnulib and README-hacking from Coreutils.
* maint: port to gcc -std=c99 -Wstrict-prototypesPaul Eggert2022-12-254-6/+6
| | | | | | | | | | | | | This doesn’t fix any bugs, since the code is correct as-is on all C versions. However, it pacifies gcc -std=c99 -Wstrict-prototypes, which complains about a function definition without arguments unless there’s a previous prototype with ‘(void)’. Most (but not all) of this patch merely reverts some recent changes to be more consistent when porting to C23. * dfltcc.c (is_dfltcc_enabled): * gzip.c (get_input_size_and_time): * inflate.c (inflate_stored, inflate_fixed, inflate_dynamic): * unpack.c (read_byte):
* gzip: port alignas usage to C23Paul Eggert2022-12-252-2/+2
| | | | | * gzip.c (BUFFER_ALIGNED): Do not depend on __alignas_is_defined as that has been removed from C23.
* gzip: local → staticPaul Eggert2022-12-257-135/+154
| | | | | | | * gzip.h (local): Remove. All uses replaced by ‘static’. Previously, the source code was inconsistent about using ‘local’ vs ‘static’ even before the recent changes, and ‘local’ was more trouble than it was worth.
* maint: port function definitions to C23Paul Eggert2022-12-2517-162/+158
| | | | | | | C23 does not allow K&R style function definitions. Use protyped definitions. However, don't bother with (void) in function definitions since C23 prefers (); so prefer () to (void) as this will work with older compilers anyway.
* maint: stop using obsolete dosname modulePaul Eggert2022-12-253-3/+2
| | | | | | * bootstrap.conf (gnulib_modules): Replace dosname with filename. * gzip.c: Include filename.h, not dosname.h. * lib/.gitignore: Remove name of dosname.h.
* maint: stop using obsolete stdnoreturn modulePaul Eggert2022-12-255-11/+7
| | | | | | | | | * bootstrap.conf (gnulib_modules): Remove stdnoreturn. * gzip.h: Do not include stdnoreturn.h. All uses of noreturn replaced by _Noreturn, at start of declaration for benefit of C23. * lib/.gitignore, m4/.gitignore: Remove names of stdnoreturn-related files.
* maint: stop using obsolete fdl modulePaul Eggert2022-12-253-2/+505
|
* maint: update .gitignore to match Gnulib changesPaul Eggert2022-12-252-4/+6
|
* build: update gnulib submodule to latestPaul Eggert2022-12-251-0/+0
|
* zgrep: tweak for sed failurePaul Eggert2022-07-201-1/+2
| | | | | * zgrep.in (icolon): Defend better against sed failure. Suggested by Lasse Collin.
* build: update gnulib submodule to latestPaul Eggert2022-06-291-0/+0
|
* maint: update from GnulibPaul Eggert2022-06-291-2/+2
| | | | * bootstrap: Copy from Gnulib.
* gzip: test invalid-input bugPaul Eggert2022-06-282-0/+7
| | | | | * NEWS: Mention the bug. * tests/unpack-invalid: Test for the bug.
* gzip: detect invalid inputPaul Eggert2022-06-281-1/+6
| | | | | | | | | Problem reported by Young Mo Kang and fix from Mark Adler (Bug#56247). * inflate.c: Include stdbool.h. (fresh): New static var. * inflate.c (flush_output): Clear it. (inflate): Set it. (inflate_codes): Fail if the offset is outside a fresh input window.
* gzip: match printf format to arg typePaul Eggert2022-06-284-9/+19
| | | | | | | | | This pacifies gcc -Wformat -DDEBUG. * bits.c (send_bits): * deflate.c (check_match): * inflate.c (huft_build, inflate_codes): * trees.c (send_code, gen_codes, flush_block): Use correct printf formats for signed vs unsigned integers.
* maint: reference CVE-2022-1271 in 1.12's NEWSJim Meyering2022-04-072-1/+2
| | | | | * NEWS: Reference newly-assigned CVE number. * cfg.mk (old_NEWS_hash)
* maint: update --version copyright datesPaul Eggert2022-04-0712-13/+19
| | | | | | | | | | * cfg.mk (srcdirslash): New macro. (in_vc_files): Use it to avoid problems when srcdir is '.'. Also look for copyright dates in shell script *.in files, so that ‘zgrep --version’ etc. outputs current dates. * gunzip.in, gzexe.in, gzip.c, zcat.in, zcmp.in, zdiff.in: * zforce.in, zgrep.in, zless.in, zmore.in, znew.in: Update copyright date in --version output to 2022.
* maint: post-release administriviaJim Meyering2022-04-073-2/+5
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 1.12v1.12Jim Meyering2022-04-071-1/+1
| | | | * NEWS: Record release date.
* zgrep: fix "binary file matches" mislabelingPaul Eggert2022-04-074-9/+53
| | | | | | | | | | | | | | | | | | 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'.
* maint: use C locale more oftenPaul Eggert2022-04-075-16/+27
| | | | | | | | * gzexe.in, zdiff.in, zgrep.in: Run expr and sed in the C locale when it might help to avoid undefined behavior on non-GNU platforms. * sample/zfile, znew.in: Run in the C locale, for simplicity and to avoid undefined behavior on non-GNU platforms.
* gzexe: optimize out a grepPaul Eggert2022-04-071-3/+4
| | | | | | * gzexe.in: Avoid an unnecessary invocation of ‘grep’, by using sed instead. Also, look only for at-most-3-digit numbers, for consistency with the rest of the script.
* gzip: mention when fixed bugs were introducedPaul Eggert2022-04-071-0/+2
|
* zgrep: port to POSIX sedPaul Eggert2022-04-071-11/+4
| | | | | | | * zgrep.in (res): When escaping the file name do not rely on GNU sed’s extension to POSIX with respect to s/.../\n/. Instead, use features that should also work with AIX and/or Solaris sed. This is simpler anyway, and would have prevented the recently-fixed bug.
* zgrep: add NEWS and tests for this exploitable bugJim Meyering2022-04-073-0/+45
| | | | | | | * 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.