summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-09-24version 9.0v9.0Pádraig Brady1-1/+1
* NEWS: Record release date.
2021-09-24tests: sparse-perf: avoid false failurePádraig Brady1-1/+10
* tests/cp/sparse-perf.sh: Avoid the case where we saw SEEK_DATA take 35s to return a result against a 1TB sparse file. This happened on a FreeBSD 9.1 VM at least. Reported by Nelson H. F. Beebe.
2021-09-24cksum: fix -a crc on 64 bit big endian systemsPádraig Brady1-1/+2
* src/cksum.c (crc_sum_stream): On sparc64 for example, a crc of 0 was printed due to mismatch in size of variable copied between generator and output functions. uint_fast32_t is generally 64 bits on 64 bit systems, so we copy through an int to ensure we don't use the wrong end of a 64 bit variable. Reported by Nelson H. F. Beebe
2021-09-21tail: fix detection of closed stdout on macOSPádraig Brady2-2/+25
* bootstrap.conf: We only need poll on Linux and AIX where poll is not replaced. Also resinstate dependence on select so we can use it unconditionally. * src/tail.c (check_output_alive): Reinstate use of select() by default as poll was seen to be ineffective for this application on macOS. Fixes https://bugs.gnu.org/50714
2021-09-21maint: clean up c++ style commentsPádraig Brady3-11/+2
* src/expand-common.h: Remove commented variables. * src/remove.h: Change to C style comment. * src/tail.c: Likewise.
2021-09-20tests: date-debug: avoid a false failure on solarisPádraig Brady1-5/+8
* tests/misc/date-debug.sh: Use a dynamic time format, as the C locale on solaris uses %T rather than %H:%M:%S for the time component.
2021-09-20doc: drop extraneous single quotes in helpJim Meyering2-15/+15
* src/digest.c (usage) [cksum --help]: Drop single quotes around each checksum name. * src/tee.c (usage) [tee --help]: Likewise.
2021-09-20cksum: list Pádraig as coauthorJim Meyering2-2/+4
* src/digest.c (AUTHORS) [HASH_ALGO_CKSUM]: Add Pádraig as cksum coauthor. * AUTHORS: Likewise.
2021-09-20tests: env-s.pl: avoid spurious failure on OS XJim Meyering1-0/+6
* tests/misc/env-S.pl: The __CF_USER_TEXT_ENCODING envvar would cause many of these sub-tests to fail. Ignore it.
2021-09-20build: update gnulib submodule to latestPádraig Brady1-0/+0
* gnulib: Update to latest. Fixes "extern inline" and "rpl_free" issues.
2021-09-20doc: fix --help formatting for checksum utilsPádraig Brady1-19/+22
* src/digest.c (usage): Indicate that --length and --algorithm require arguments. Emit corresponding emit_mandatory_arg_note(). Use consistent alignment.
2021-09-20cksum: support more transparent emulation of older utilsPádraig Brady3-16/+10
* src/digest.c: Allow using the --untagged option with --check, so that `cksum -a md5 --untagged` used to emulate md5sum for example, may be augmented with the --check option. Also support the --tag option with cksum, to allow overriding a previous --untagged setting. * doc/coreutils.texi: Adjust accordingly. * tests/misc/cksum-a.sh: Likewise.
2021-09-20tests: avoid rare race in tail-2/F-vs-rename.shPádraig Brady1-22/+24
* tests/tail-2/F-vs-rename.sh: Keep stdout and stderr separate, so that interspersion doesn't impact regex checks. Also wait for each file's data to be printed to avoid multiple writes to a file to be printed in a single iteration, which would impact the regex checks. Also we refactor the check function, rather than repeatedly redefining variations.
2021-09-17maint: remove duplicate from THANKS.inPádraig Brady1-1/+0
* THANKS.in: Now that Tianjia Zhang has a commit in the repo.
2021-09-17tests: fix typo in cksum-a.shTianjia Zhang1-1/+1
* tests/misc/cksum-a.sh: fix typo md5um to md5sum.
2021-09-17tests: fix rare false failure in tail-2/F-vs-renamePádraig Brady1-0/+5
This is wrong fix really, as only introducing delay I think. * tests/tail-2/F-vs-rename.sh: Avoid a rare false failure due to a race in the test. Now wait until tail has noticed that b is replaced before writing to a, so that the subsequent write of "y" to b will be displayed independently from current contents of b ("x").
2021-09-17tests: port removed-directory test to FreeBSDPádraig Brady1-1/+1
* tests/ls/removed-directory.sh: On FreeBSD 9.1 at least, one gets ENOENT when trying to traverse the current removed dir with ../, so instead reference the parent dir directly.
2021-09-16rmdir: fix uninitialized memory causing incorrect errorPádraig Brady1-1/+2
* src/rmdir.c (main): Only inspect the returned stat structure, when stat(2) returns success.
2021-09-16build: avoid new chmod.c warnings from upcoming GCC12Jim Meyering1-1/+1
Here are the warnings: src/chmod.c:175:3: error: 'ch.new_mode' may be used uninitialized in\ this function [-Werror=maybe-uninitialized] 175 | strmode (ch->new_mode, perms); src/chmod.c:178:3: error: 'ch.old_mode' may be used uninitialized in\ this function [-Werror=maybe-uninitialized] 178 | strmode (ch->old_mode, old_perms); * src/chmod.c (process_file): Initialize ch. Its new_mode and old_mode fields could indeed be used uninitialized to form mode strings, but those are used only when built from initialized members.
2021-09-16digest: ignore empty lines when checkingPádraig Brady2-6/+8
* src/digest.c (digest_check): Treat empty lines like comments, as commented checksum files very often have empty lines. * tests/misc/md5sum.pl: Adjust accordingly.
2021-09-16factor: sync longlong.h adjustments from upstreamPádraig Brady1-31/+28
* src/longlong.h: Sync changes from: https://gmplib.org/repo/gmp/log/tip/longlong.h
2021-09-16stat,tail: add support for the secretmem file systemPádraig Brady2-3/+5
* src/stat.c (human_fstype): Add case for the 'secretmem' file system type. * NEWS: Mention the Improvement.
2021-09-16maint: sync help2man to latest versionPádraig Brady1-6/+7
* man/help2man: sync to changes from version 1.48.5. Note this doesn't materially change the generated man pages.
2021-09-16doc: remove older ChangeLog itemsPádraig Brady1-1/+1
* Makefile.am: Update the oldest documented version to 8.25 which is now about 5 years old.
2021-09-16tests: ensure returns_ check failures are propagatedPádraig Brady3-4/+4
* tests/misc/cksum-a.sh: Set fail=1 if returns_ check fails. * tests/misc/sync.sh: Likewise. * tests/misc/yes.sh: Likewise.
2021-09-16cksum: fix --check with non tagged format checksumsPádraig Brady2-6/+17
* src/digest.c: Always set the digest_length, so that we check the correct number of hex digits when parsing non tagged format checksums. * tests/misc/cksum-a.sh: Add a test case. Also fix up this test which was ineffective due to fail=1 being set in a subshell and ignored.
2021-09-16cksum: fix off-by-1 bug with \r strippingPaul Eggert1-4/+3
Problem reported by Jim Meyering (Bug#50611). * src/digest.c (digest_check): When stripping trailing \r, avoid subscript error before start of line.
2021-09-15maint: prefer rawmemchr to memchr when easyPaul Eggert7-24/+27
* bootstrap.conf (gnulib_modules): Add rawmemchr. * src/csplit.c: Include idx.h. * src/csplit.c (record_line_starts): * src/head.c (elide_tail_lines_pipe): * src/shuf.c (next_line): * src/split.c (lines_split): * src/tail.c (pipe_lines): * src/wc.c (wc_lines): Prefer rawmemchr to memchr when rawmemchr is easy. * src/csplit.c (load_buffer): * src/head.c (struct linebuffer): Make room for a 1-byte sentinel.
2021-09-15split: avoid NULL + 1Paul Eggert1-2/+5
* src/split.c (lines_chunk_split): Don’t add to a null pointer. It’s undefined behavior, and it’s unnecessarily confusing regardless.
2021-09-15digest: support windows format checksum filesPádraig Brady5-24/+41
Support checksum files with CRLF line endings, which is a common gotcha for using --check on windows, or with checksum files generated on windows. Note we escape \r here to support the original coreutils format (with file name at EOL), and file names with literal \r characters as the last character of their name. * src/digest.c (filename_unescape): Convert \\r -> \r. (print_filename): Escape \r -> \\r. (output_file): Detect \r chars in file names. (digest_check): Ignore literal \r char at EOL. * tests/misc/md5sum.pl: Add a test case. * tests/misc/sha1sum.pl: Likewise. * NEWS: Mention the improvement.
2021-09-15doc: improve --help indenting in checksum utilsPádraig Brady1-2/+2
* src/digest.c (usage): Indent multi-line descriptions for clarity.
2021-09-15cksum: operate in binary mode onlyPádraig Brady3-17/+34
This only practically matters on windows. But given there are separate text handling options in cygwin, keep the interface simple, and avoid exposing the confusing binary/text difference here. * doc/coreutils.texi (md5sum invocation): Mention that --binary and --text are not supported by the cksum command. * src/digest.c: Set flag to use binary mode by default. (output_file): Don't distinguish text and binary modes with ' ' and '*', and just use ' ' always.
2021-09-15cksum: use --tag format by defaultPádraig Brady6-10/+51
This format is a better default, since it results in simpler usage, as you don't need to specify --tag on generation or -a on checking invocations. Also it's a more general format supporting mixed and length adjusted digests. * doc/coreutils.texi (cksum invocation): Document a new --untagged option, to use the older coreutils format. (md5sum invocation): Mention that cksum doesn't support --tag. * src/digest.c: Adjust cksum(1) to default to --tag, and accept the new --untagged option. * tests/misc/b2sum.sh: Adjust accordingly. * tests/misc/cksum-a.sh: Likewise. * tests/misc/cksum-c.sh: Likewise.
2021-09-15cksum: support --zero in default modePádraig Brady6-20/+24
* src/cksum.h: Thread DELIM through the output functions. * src/digest.c: Likewise. * src/sum.c: Likewise. * src/sum.h: Likewise. * src/cksum.c: Likewise. Also adjust check to allow -z with traditional output modes. Also ajust the global variable name to avoid shadowing warnings. * tests/misc/cksum-a.sh: Adjust accordingly.
2021-09-15digest: support -length specifiers on all digest tagsPádraig Brady1-41/+31
This will be generally useful going forward, for sha3-256 etc. * src/digest.c: Rename b2_length to digest_length, and adjust/simplify the code to operate on this for both b2sum and cksum -a blake2b.
2021-09-15cksum: support digest detection for tagged formatPádraig Brady7-10/+142
Support `cksum --check FILE` without having to specify a digest algorithm, allowing for more generic file check instructions. This also supports mixed digest checksum files, supporting more robust multi digest checks. * src/digest.c (algorithm_from_tag): A new function to identify the digest algorithm from a tagged format line. (split3): Set the algorithm depending on tag, and update the expected digest length accordingly. * tests/misc/cksum-c.sh: Add a new test. * tests/local.mk: Reference the new test. * tests/misc/md5sum.pl: Adjust to more generic error. * tests/misc/sha1sum.pl: Likewise. * doc/coreutils.texi (md5sum invocation): Mention the new -c feature. * NEWS: Mention the new feature.
2021-09-15maint: simplify b2sum to only handle BLAKE2bPádraig Brady1-41/+14
Any further variants will use the cksum -a table driven mechanism. * src/digest.c: Remove BLAKE2 specific table driven code.
2021-09-15digest: add support for sm3Pádraig Brady7-4/+79
Add message digest sm3, which uses the OSCCA SM3 secure hash (OSCCA GM/T 0004-2012 SM3) generic hash transformation. * bootstrap.conf: Add the sm3 module. * doc/coreutils.texi: Mention the cksum -a option. * src/digest.c: Provide support for --algorithm='sm3'. * tests/misc/sm3sum.pl: Add a new test (from Tianjia Zhang) * tests/local.mk: Reference the new test. * NEWS: Mention the new feature. Tested-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
2021-09-15cksum: add --algorithm option to select digest modePádraig Brady15-87/+395
* src/digest.c: Organize HASH_ALGO_CKSUM to be table driven, and amalgamate all digest algorithms. (main): Parse all options if HASH_ALGO_CKSUM, and disallow --tag, --zero, and --check with the traditional bsd, sysv, and crc checksums for now. * src/local.mk: Reorganize to include all digest modules in cksum. * tests/misc/cksum-a.sh: Add a new test. * tests/misc/b2sum.sh: Update to default to checking with cksum, as b2sum's implementation diverges a bit from the others. * tests/local.mk: Reference the new test. * doc/coreutils.texi (cksum invocation): Adjust the summary to identify the new mode, and document the new --algorithm option. * man/cksum.x: Adjust description to be more general. * man/*sum.x: Add [See Also] section referencing cksum(1). * NEWS: Mention the new feature.
2021-09-15digest: refactor cksum(1) into digest.cPádraig Brady8-630/+558
* cfg.mk: Adjust cksum.c to not require config.h and support a main (for crctab) without calling bindtextdomain(). * po/POTFILES.in: Remove cksum_pclmul.c since it no longer concerns itself with diagnostics. * src/cksum.c: Refactor to just providing stream digest, and digest printing functionality. * src/cksum.h: Adjust to the new interface. * src/cksum_pclmul.c: Remove diagnostics, and determine errors internally. * src/crctab.c: Separate from cksum.h since that's now included multiple times. * src/digest.c: Provide cksum(1) functionality if -DHASH_ALGO_CKSUM * src/local.mk: Adjust to new crctab.c and HASH_ALGO_CKSUM define.
2021-09-15cksum: document the --debug optionPádraig Brady2-2/+14
This should have been part of commit v8.32-113-gb73b9fcb1 * doc/coreutils.texi (cksum invocation): Add the --debug description. * src/cksum.c (usage): Likewise. (main): Also give explicit indication when using generic hardware.
2021-09-15sum: handle EOVERFLOW for too large inputsPádraig Brady1-0/+20
* src/sum.c (bsd_sum_stream): Detect overflow when updating length. (sysv_sum_stream): Likewise.
2021-09-15digest: refactor sum(1) into digest.cPádraig Brady5-254/+272
Since digest will be providing all digest functionality, refactor sum.c into it. * po/POTFILES.in: sum.c no longer has translatable strings so remove. * src/digest.c: Call out to new stream interfaces in sum.c * src/local.mk: Adjust sources for the sum binary. * src/sum.c: Provide a stream interface for BSD and SYSV digests. * src/sum.h: A new file to declare the exported functions in sum.c
2021-09-15digest: add LENGTH parameter to digest to support cksumPádraig Brady1-3/+3
* src/digest.c (digest_file): Add a LENGTH param, to support cksum(1), and sum(1) which output the length as part of their output.
2021-09-15maint: rename md5sum.c to more general digest.cPádraig Brady4-8/+9
md5sum.c will be the base for all digest functions, so rename accordingly. * src/md5sum.c: Rename to ... * src/digest.c: ... renamed from md5sum.c * scripts/git-hooks/commit-msg: Allow digest: commit prefix. * po.POTFILES.in: Adjust to new name. * src/local.mk: Likewise.
2021-09-15doc: fix ambiguities in logname(1) and whoami(1)Pádraig Brady4-4/+6
* doc/coreutils.texi (whoami invocation): Clarify it prints names, not numeric IDs. * man/whoami.x: Likewise. * man/logname.x: Reference getlogin(3). * src/logname.c: Clarify that it prints the login name, rather than the name of the effective user ID. Fixes https://bugs.gnu.org/48894
2021-09-15dircolors: add *direct* to TERM matchingnl67201-0/+1
Search for "direct color" at: https://invisible-island.net/xterm/terminfo.html * src/dircolors.hin: Add *direct* to match terminals that support direct colors (24-bit color / TrueColor). The trailing * will match entries like xterm-direct2. Addresses https://bugs.gnu.org/39827
2021-09-12tests: stat-vs-dirent.sh: avoid a false failurePádraig Brady1-1/+2
* tests/ls/stat-vs-dirent.sh: Skip the test if we can't stat(1), as the file may have been removed, or have a malformed name due to '\n' etc. in the file name.
2021-09-09tests: add new stdin reading programs to tty-eof testPádraig Brady1-1/+2
* tests/misc/tty-eof.pl: Add b2sum and basenc.
2021-09-09build: update gnulib submodule to latestPádraig Brady2-1/+2
* gnulib: Update to latest. This fixes a gnulib test failure in base64, among other fixes. * cfg.mk: Disable sc_indent as auto indent is too invasive for now.