Paul Eggert [Thu, 27 Jan 2022 20:06:21 +0000 (12:06 -0800)]
csplit: improve integer overflow checking
* src/csplit.c: Prefer signed integers to unsigned for sizes
when either will do. Check for some unlikely overflows.
(INCR_SIZE): Remove; no longer used.
(free_buffer): Also free the arg, simplifying callers.
(get_new_buffer): Use xpalloc instead of computing new
size by hand. Add ATTRIBUTE_DEALLOC.
(delete_all_files, close_output_file):
If unlink fails with ENOENT, treat it as success.
(close_output_file): If unlink fails, decrement count anyway.
(parse_repeat_count, parse_patterns): Check for int overflow.
(check_format_conv_type): Use signed format.
Paul Eggert [Thu, 27 Jan 2022 20:06:21 +0000 (12:06 -0800)]
maint: simplify memory alignment
Use the new Gnulib modules alignalloc and xalignalloc
to simplify some memory allocation.
Also, fix some unlikely integer overflow problems.
* bootstrap.conf (gnulib_modules): Add alignalloc, xalignalloc.
* src/cat.c, src/copy.c, src/dd.c, src/shred.c, src/split.c:
Include alignalloc.h.
* src/cat.c (main):
* src/copy.c (copy_reg):
* src/dd.c (alloc_ibuf, alloc_obuf):
* src/shred.c (dopass):
* src/split.c (main):
Use alignalloc/xalignalloc/alignfree instead of doing page
alignment by hand.
* src/cat.c (main):
Check for integer overflow in page size calculations.
* src/dd.c (INPUT_BLOCK_SLOP, OUTPUT_BLOCK_SLOP, MAX_BLOCKSIZE):
(real_ibuf, real_obuf) [lint]:
Remove; no longer needed.
(cleanup) [lint]:
(scanargs): Simplify.
* src/ioblksize.h (io_blksize): Do not allow blocksizes largest
than the largest power of two that fits in idx_t and size_t.
* src/shred.c (PAGE_ALIGN_SLOP, PATTERNBUF_SIZE): Remove.
Paul Eggert [Sun, 23 Jan 2022 19:24:35 +0000 (11:24 -0800)]
copy: remove unnecessary ‘free’
* src/copy.c (copy_reg): Remove a ‘free’ call that does nothing
because its argument is always a null pointer, starting with
2007-11-1608:31:15Z!jim@meyering.net.
Paul Eggert [Wed, 19 Jan 2022 18:51:25 +0000 (10:51 -0800)]
dd: simplify conv=swab code
Simplify byte-swapping, so that the code no longer needs to
allocate a page before the input buffer.
* src/dd.c (SWAB_ALIGN_OFFSET, char_is_saved, saved_char): Remove.
All uses removed.
(INPUT_BLOCK_SLOP): Simplify to just page_size.
(alloc_ibuf, dd_copy): Adjust to new swab_buffer API.
(swab_buffer): New arg SAVED_BYTE, taking the place of the old
global variables. Do not access BUF[-1].
Paul Eggert [Tue, 18 Jan 2022 21:22:02 +0000 (13:22 -0800)]
dd: improve integer overflow checking
* src/dd.c: Prefer signed to unsigned types where either will do,
as this helps improve checking with gcc -fsanitize=undefined.
Limit the signed types to their intended ranges.
(MAX_BLOCKSIZE): Don’t exceed IDX_MAX - slop either.
(input_offset_overflow): Remove; overflow now denoted by negative.
(parse_integer): Return INTMAX_MAX on overflow, instead of unspecified.
Do not falsely report overflow for ‘00x99999999999999999999999999999’.
* tests/dd/misc.sh: New test for 00xBIG.
* tests/dd/skip-seek-past-file.sh: Adjust to new diagnostic wording.
New test for BIGxBIG.
Paul Eggert [Mon, 17 Jan 2022 03:56:17 +0000 (19:56 -0800)]
shred: fix declaration typo
* gl/lib/randint.h (randint_all_new):
Do not declare with _GL_ATTRIBUTE_NONNULL (), as
the arg can be a null pointer. This fixes a typo added in
2021-11-01T05:30:28Z!eggert@cs.ucla.edu.
Paul Eggert [Sat, 15 Jan 2022 20:12:21 +0000 (12:12 -0800)]
build: allow readlinkat calls
Problem reported by Bernhard Voelker in:
https://lists.gnu.org/r/coreutils/2022-01/msg00026.html
* cfg.mk (sc_prohibit_readlink): Remove. It’s OK to call
readlinkat to determine whether a file is a symbolic link.
Paul Eggert [Sat, 15 Jan 2022 01:43:52 +0000 (17:43 -0800)]
cp: rely on Gnulib for copy_file_range workaround
Gnulib now replaces copy_file_range on buggy hosts
so there is no need for Coreutils to worry about the bug.
* src/copy.c: Do not include sys/utsname.h, xstrtol.h.
(functional_copy_file_range): Remove. All uses now
simply call copy_file_range.
Paul Eggert [Fri, 14 Jan 2022 23:17:17 +0000 (15:17 -0800)]
cp: fix two typos in previous change
Somehow ‘make check’ didn’t catch these the first few times.
* src/copy.c (copy_dir): Don’t pass null pointer to
copy_internal where it now expects non-null if move mode.
* src/cp.c (make_dir_parents_private): Initialize *attr_list
before recentely-added quick return.
Paul Eggert [Fri, 14 Jan 2022 16:51:13 +0000 (08:51 -0800)]
cp: omit unnecessary stat of destination
'cp A B' attempts to open B as a directory, to see whether to
write to B/A instead of to B. In the common case where the
open fails with ENOENT, do not bother to stat B afterwards
since the stat should also fail with ENOENT.
* src/copy.c (copy_internal, copy): Change bool arg about
nonexistent destination to a 3-way int argument. All callers changed.
(copy_internal): Do not bother to stat a destination already known
to not exist when following symlinks.
Paul Eggert [Wed, 12 Jan 2022 18:57:32 +0000 (10:57 -0800)]
cp: when copying to dir use dir-relative names
When copying to a directory, use functions like openat to access
the destination files, when such functions are available. This
should be more efficient and should avoid some race conditions.
* bootstrap.conf (gnulib_modules): Add areadlinkat-with-size,
fchmodat, fchownat, mkdirat, mkfifoat, utimensat.
* src/copy.c (lchown) [!HAVE_LCHOWN]:
* src/copy.c, src/system.h (rpl_mkfifo, mkfifo) [!HAVE_MKFIFO]:
Remove. All uses removed.
(utimens_symlink): Remove; we shouldn’t have to worry about
those obsolete systems any more. All uses replaced by utimensat.
* src/copy.c (copy_dir, set_owner, fchmod_or_lchmod, copy_reg)
(same_file_ok, writable_destination, overwrite_ok, abandon_move)
(create_hard_link, src_is_dst_backup, copy_internal, copy):
* src/cp.c (make_dir_parents_private, re_protect):
New args for directory-relative names. All uses changed.
Continue to pass full names as needed, for diagnostics and for
lower-level functions like qset_acl that do not support
directory-relative names.
* src/copy.c (copy_reg): Prefer readlinkat to lstatat for merely
checking whether a file is a symlink, to avoid EOVERFLOW issues.
(subst_suffix): New function.
(create_hard_link): Accept a null SRC_NAME as meaning that if it
is needed it needs to be constructed from SRC_RELNAME, DST_NAME,
and DST_RELNAME.
(source_is_dst_backup): Use subst_suffix instead of doing it by hand.
(copy_internal): Remember and use directory-relative names instead
of full names.
* src/cp.c (lchown) [!HAVE_LCHOWN]: Remove. All uses removed.
(must_be_working_directory): New function.
(target_directory_operand): Simply take file name as arg,
and return a file descriptor or negative number on failure;
open with O_DIRECTORY to obtain any file descriptor.
All uses changed.
(target_dirfd_valid): New function.
(do_copy): Use these new functions to obtain a file descriptor
for any target directory, and use directory-relative names
for that directory.
(main): Omit no-longer-needed stat when --target-directory,
as do_copy now does this.
* src/ln.c (O_PATHSEARCH): Move from here ...
* src/system.h: ... to here.
* tests/cp/fail-perm.sh: Adjust to change in diagnostic wording,
and add a test for --no-target-directory.
Commit 2f438fa9f53250fb3c8b39a95eedd627b5569ca4 (basenc: A new program
complementary to base64/base32) introduced a typo in the list of allowed
commit message prefixes, accidentally changing "basename" to
"nbasename". Revert it back to the correct "basename".
Pádraig Brady [Sun, 2 Jan 2022 15:42:45 +0000 (15:42 +0000)]
maint: update all copyright year number ranges
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.
* tests/sample-test: Adjust to use the single most recent year.
Paul Eggert [Fri, 31 Dec 2021 08:45:03 +0000 (00:45 -0800)]
date: new option --resolution
* NEWS, doc/coreutils.texi (Options for date): Mention this.
* src/date.c (RESOLUTION_OPTION): New constant.
(DEBUG_DATE_PARSING_OPTION): Rename from DEBUG_DATE_PARSING.
All uses changed.
(long_options, usage, main): Support --resolution.
Paul Eggert [Fri, 31 Dec 2021 08:45:03 +0000 (00:45 -0800)]
date: %-N now means suppress extra digits
* NEWS, doc/coreutils.texi: Mention this.
* bootstrap.conf (gnulib_modules): Add gettime-res.
* src/date.c (res_width, adjust_resolution): New functions.
(main): Adjust %-N to be %9N, or whatever, before using it.
Paul Eggert [Fri, 31 Dec 2021 08:45:03 +0000 (00:45 -0800)]
build: port to AIX 7.1
This fixes a porting bug introduced in
2019-08-12T03:29:00Z!bruno@clisp.org.
Problem discovered on AIX 7.1.
* src/local.mk (LDADD): Add $(LIB_MBRTOWC), since pretty much
every command uses quotearg or mbrtowc or whatever.
(src_sort_LDADD): Add $(LIBPMULTITHREAD) and
$(LIB_PTHREAD_SIGMASK) instead of $(LIBTHREAD).
PR_SET_MM_ARG_START is not a prctl 'option' parameter, it's 'arg2'
parameter for the option PR_SET_MM. It also has to have 'arg4' and
'arg5' set to 0 explicitly, otherwise the kernel also returns -EINVAL.
Paul Eggert [Fri, 24 Dec 2021 17:47:18 +0000 (09:47 -0800)]
doc: colorize -> color
Living so close to Hollywood I know that "colorize"
means adding color to something that was already monochrome,
whereas "color" means to give color to something.
Coreutils apps color text instead of colorizing it.
* scripts/git-hooks/commit-msg: Count UTF-8 characters rather
than bytes to avoid erroneously rejecting as "longer than 72" a
log message line like the UTF-8 one for id.c just prior. It has
77 bytes but only 67 characters.
(check_msg): Read in "utf8" mode. Also include actual length
in the diagnostic.
(main): Don't loop when stdout is redirected, as it is when
invoked via vc-dwim.
Paul Eggert reported privately both the error of counting bytes
rather than chars and the re_edit loop when failing via vc-dwim.
Bruno Haible [Thu, 16 Dec 2021 16:24:30 +0000 (08:24 -0800)]
build: non-recursive Automake in a less hacky way
* bootstrap.conf (gnulib_modules): Remove
non-recursive-gnulib-prefix-hack.
(gnulib_tool_option_extras): Add --automake-subdir.
(bootstrap_post_import_hook): No need to massage lib/gnulib.mk.
Paul Eggert [Mon, 6 Dec 2021 22:39:22 +0000 (14:39 -0800)]
uname: port to recent macOS
Problem reported by Jakub Sokołowski (bug #52330).
* src/uname.c [__APPLE__]: Don’t include sys/syctl.h,
mach/machine.h, mach-o/arch.h.
(print_element_env): New function. With __APPLE__, it defers to the
env var UNAME_MACHINE (if given) for uname -m, and similarly for -nrsv.
(main): Use it. For -p with __APPLE__, rely on predefined macros
and omit any 64-bit indication, for compatibility with macOS uname.
Paul Eggert [Sun, 21 Nov 2021 23:07:18 +0000 (15:07 -0800)]
cp: clone on macOS
* configure.ac: Check for fclonefileat.
* src/copy.c [HAVE_FCLONEFILEAT && !USE_XATTR]:
Include <sys/clonefile.h>.
(copy_reg): If possible, use fclonefileat to clone.
Paul Eggert [Sat, 20 Nov 2021 21:48:40 +0000 (13:48 -0800)]
cp: fix --preserve=ownership permissions bug
This fixes a bug that I introduced in
2006-12-06T19:44:08Z!eggert@cs.ucla.edu.
* src/copy.c (USE_XATTR): New macro.
(copy_reg): Use it to help the compiler. Prefer open u+w to a
later chmod u=rw; u+r isn’t needed for xattr. For the later u-r,
do only one (or zero) chmod calls instead of two (or one).
In the last chmod, respect the umask instead of ignoring it.
* tests/cp/preserve-mode.sh: Test for the bug.
Paul Eggert [Fri, 19 Nov 2021 05:36:47 +0000 (21:36 -0800)]
maint: prefer MAYBE_UNUSED
Prefer MAYBE_UNUSED to _GL_UNUSED, since the C2x syntax
will be [[maybe_unused]] at the start of the declaration,
and we want to look forward to that. All uses of _GL_UNUSED
either changed to MAYBE_UNUSED, or (when not needed) removed.
Paul Eggert [Wed, 17 Nov 2021 21:22:06 +0000 (13:22 -0800)]
cp: fix security context race
This fixes an issue introduced in the fix for Bug#11100.
* NEWS: Mention this.
* src/copy.c (copy_reg): Fix obscure bug where open-without-CREAT
failed with ENOENT and we forget to call set_process_security_ctx
before calling open-with-CREAT. Also, don’t bother to unlink
DST_NAME if open failed with ENOENT; and if unlink fails with
ENOENT, don’t consider that to be an error (someone else could
have removed the file for us, and that’s OK). Also, don’t worry
about move mode, since we use O_EXCL|O_CREAT and so won’t open
an existing file.
Pádraig Brady [Sat, 13 Nov 2021 12:15:17 +0000 (12:15 +0000)]
tests: avoid false failure in env-signal-handler.sh
* tests/misc/env-signal-handler.sh: Use retry_delay_ to
avoid a false failure under load, where env hasn't setup
the SIGINT handling before timeout(1) sends the SIGINT.
Fixes https://bugs.gnu.org/51793
Pádraig Brady [Mon, 1 Nov 2021 13:36:43 +0000 (13:36 +0000)]
maint: fix recent syntax-check failures
* cfg.mk (exclude_file_name_regexp--sc_system_h_headers):
Add chown-core.h to the regexp, to better decouple from system.h.
* src/env.c: Remove minmax.h include already included in system.h.
* src/libstdbuf.c: Likewise.
* src/prog-fprintf.h: Remove doubled semicolon.
Paul Eggert [Mon, 1 Nov 2021 05:30:38 +0000 (22:30 -0700)]
maint: add function attributes to .h files
Add _GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_MALLOC,
_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DALLOC_FREE,
_GL_ATTRIBUTE_RETURNS_NONNULL to .h files when appropriate.
* gl/lib/mbsalign.h, gl/lib/randperm.h, src/chown-core.h:
Include stdlib.h, for the benefit of _GL_ATTRIBUTE_DALLOC_FREE.
* gl/lib/randread.c (randread_free_body): New static function.
(randread_new, randread_free): Use it.
* src/copy.c (valid_options): Remove assert that is no longer
needed because it is now checked statically.
Paul Eggert [Mon, 1 Nov 2021 05:30:38 +0000 (22:30 -0700)]
maint: enable -Wsuggest-attribute=format
* configure.ac (WERROR_CFLAGS): Enable -Wsuggest-attribute=format
for lib/ and src/.
* src/copy.c (copy_attr_error, copy_attr_allerror):
Add ATTRIBUTE_FORMAT.
(copy_attr): Ignore -Wsuggest-attribute=format in the
small section of code that needs it ignored.
* src/test.c (test_syntax_error): Mark with ATTRIBUTE_FORMAT.
(binary_operator): Omit unnecessary NULL args, pacifying
-Wsuggest-attribute=format.
Paul Eggert [Mon, 1 Nov 2021 05:30:38 +0000 (22:30 -0700)]
maint: modernize attribute usage
* src/system.h (__attribute__): Remove. Replace all uses that
rely on this by _GL_ATTRIBUTE_xxx or ATTRIBUTE_xxx.
(ATTRIBUTE_WARN_UNUSED_RESULT): Remove. Replace all uses by
NODISCARD.
Paul Eggert [Mon, 1 Nov 2021 05:30:38 +0000 (22:30 -0700)]
maint: prefer attribute.h in .c files
This will help us make the transition to C2x, where some
attributes must come at the start of function decls.
Leave the attributes alone in .h files for now,
as the Gnulib tradition is to not expose attribute.h to users.
* bootstrap.conf (gnulib_modules): Add ‘attribute’.
* gl/lib/randperm.c, src/make-prime-list.c, src/system.h:
Include attribute.h.
* gl/lib/strnumcmp.c (strnumcmp): Remove _GL_ATTRIBUTE_PURE here,
as this belongs in the .h file.
* gl/lib/strnumcmp.h (strnumcmp): Add _GL_ATTRIBUTE_PURE here.
* src/sort.c (human_numcompare, numcompare): Now ATTRIBUTE_PURE;
discovered due to strnumcmp.h change.
* gl/lib/randperm.c, src/copy.c, src/dd.c, src/df.c, src/digest.c:
* src/env.c, src/expr.c, src/factor.c, src/ls.c:
* src/make-prime-list.c, src/numfmt.c, src/od.c, src/pathchk.c:
* src/pinky.c, src/pr.c, src/ptx.c, src/realpath.c, src/relpath.c:
* src/seq.c, src/sort.c, src/stat.c, src/stty.c, src/system.h:
* src/tr.c, src/uniq.c, src/wc.c:
In .c files, crefer ATTRIBUTE_CONST to _GL_ATTRIBUTE_CONST, and
similarly for ATTRIBUTE_FORMAT and ATTRIBUTE_PURE.
* src/system.h (FALLTHROUGH): Remove; attribute.h defines it.
Pádraig Brady [Sun, 10 Oct 2021 17:35:59 +0000 (18:35 +0100)]
sort: --debug: add warnings about sign, radix, and grouping chars
New warnings are added related to the handling
of thousands grouping characters, decimal points, and sign characters.
Examples now diagnosed are:
$ printf '0,9\n1,a\n' | sort -nk1 --debug -t, -s
sort: key 1 is numeric and spans multiple fields
sort: field separator ‘,’ is treated as a group separator in numbers
1,a
_
0,9
___
$ printf '1,a\n0,9\n' | LC_ALL=fr_FR.utf8 sort -gk1 --debug -t, -s
sort: key 1 is numeric and spans multiple fields
sort: field separator ‘,’ is treated as a decimal point in numbers
0,9
___
1,a
__
$ printf '1.0\n0.9\n' | LC_ALL=fr_FR.utf8 sort -s -k1,1g --debug
sort: note numbers use ‘,’ as a decimal point in this locale
0.9
_
1.0
_
$ LC_ALL=fr_FR.utf8 sort -n --debug /dev/null
sort: text ordering performed using ‘fr_FR.utf8’ sorting rules
sort: note numbers use ‘,’ as a decimal point in this locale
sort: the multi-byte number group separator in this locale \
is not supported
$ sort --debug -t- -k1n /dev/null
sort: key 1 is numeric and spans multiple fields
sort: field separator ‘-’ is treated as a minus sign in numbers
sort: note numbers use ‘.’ as a decimal point in this locale
$ sort --debug -t+ -k1g /dev/null
sort: key 1 is numeric and spans multiple fields
sort: field separator ‘+’ is treated as a plus sign in numbers
sort: note numbers use ‘.’ as a decimal point in this locale
* src/sort.c (key_warnings): Add the warnings above.
* tests/misc/sort-debug-warn.sh: Add test cases.
Also check that all sort invocations succeed.
* NEWS: Mention the improvement.
Addresses https://bugs.gnu.org/51011
Paul Eggert [Sat, 30 Oct 2021 17:00:10 +0000 (10:00 -0700)]
cp: revert unnecessary FreeBSD workaround
That was a false alarm due to a bug in FreeBSD 9.1 truss;
see Pádraig Brady’s report (Bug#51433#29).
* src/copy.c (lseek_copy, infer_scantype): Don’t bother checking
whether lseek returned -1. This doesn’t entirely revert the
previous change, as it keeps the code simplification of the
previous change while reverting the check for -1.
Paul Eggert [Sat, 30 Oct 2021 01:01:34 +0000 (18:01 -0700)]
cp: defend better against FreeBSD 9.1 zfs bug
Problem reported by Pádraig Brady (Bug#51433#14).
* src/copy.c (lseek_copy, infer_scantype): Report an error if
lseek with SEEK_DATA or SEEK_HOLE returns less than -1,
as this is an lseek bug.
Pádraig Brady [Thu, 21 Oct 2021 12:05:47 +0000 (13:05 +0100)]
doc: say that printf(1) is preferred over echo(1)
* src/echo.c (usage): Say printf(1) is preferred
due to being more standard and robust.
* man/echo.x [SEE ALSO]: Reference printf(1).
* doc/coreutils.texi (echo invocation): Mention in the
summary that echo is not robust when outputting
any string, and that printf is preferred.
Also expand on the examples showing how to
output a single '-n' string.
Addresses https://bugs.gnu.org/51311
* doc/coreutils.texi (timeout invocation): Clarify
that -k is ignored if either its duration or the
main timeout duration is 0.
Addresses https://bugs.gnu.org/51128
Pádraig Brady [Tue, 12 Oct 2021 13:32:57 +0000 (14:32 +0100)]
timeout: ensure --foreground -k exits with status 137
* src/timeout.c (main): Propagate the killed status from the child.
* doc/coreutils.texi (timeout invocation): Remove the
description of the --foreground specific handling of SIGKILL,
now that it's consistent with the default mode of operation.
* tests/misc/timeout.sh: Add a test case.
* NEWS: Mention the change in behavior.
Fixes https://bugs.gnu.org/51135
Pádraig Brady [Mon, 11 Oct 2021 21:04:38 +0000 (22:04 +0100)]
doc: timeout --foreground: add clarification on exit status
* doc/coreutils.texi (timeout invocation): Add detail on
how --foreground allows timeout(1) to use more standard
exit status as the uncatchable SIGKILL is not sent to itself.
Fixes https://bugs.gnu.org/51135
Paul Eggert [Sun, 10 Oct 2021 22:59:56 +0000 (15:59 -0700)]
sort: fix unlikely bug when '\377' < 0
* gl/lib/strintcmp.c (strintcmp): Don’t assume that the input
cannot contain ((char) -1), as this equals '\377' when char is
signed (assuming 8-bit char).
* src/sort.c (decimal_point): Now char, to make it clear
that it’s always in char range now.
(NON_CHAR): New constant.
(traverse_raw_number): Return char not unsigned char;
this is simpler and could be faster. All callers changed.
(main): Do not convert decimal_point and thousands_sep to
unsigned char, as this can mishandle comparisons on
machines where char is signed and the input data contains
((char) -1). Use NON_CHAR, not -1, as an out-of-range value for
thousands_sep.
Paul Eggert [Sun, 3 Oct 2021 01:41:10 +0000 (18:41 -0700)]
maint: switch to C11-style _Noreturn
Use C11-style _Noreturn instead of the old ATTRIBUTE_NORETURN
macro. This pacifies clang on OpenBSD 6.9, which otherwise
complains "'noreturn' function does return" in some places.
* gl/lib/randread.c, src/system.h (ATTRIBUTE_NORETURN):
Remove. All uses either removed as GCC no longer needs them, or
changed to C11-style _Noreturn since Gnulib arranges for _Noreturn
globally nowadays.
* doc/coreutils.texi (ls invocation - general output formatting):
The option ordering was not changed when the option was renamed
from --null to --zero.
tests: cp/sparse-perf: make more robust and add zfs comments
* init.cfg (seek_data_capable_): Add a timeout to ensure failure for
slow lseek(...SEEK_DATA) calls (even if that syscall isn't interrupted).
* tests/cp/sparse-perf.sh: Run the SEEK_DATA check on the
1TiB empty file to exclude both FreeBSD 9.1 which takes 35s,
and ZFS which requires a delay of about 5s between file creation
and use of SEEK_DATA to correctly determine it's empty (return ENXIO).
Also remove the stat size checks as they invalidate the test
due to cp never writing data due to it being always zeros,
and thus converted to holes in the output.
* src/chmod.c: Reorder enum so CH_NOT_APPLIED
can be treated as a non error.
* tests/chmod/ignore-symlink.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/50784
* 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.
* 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
* 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
cksum: support more transparent emulation of older utils
* 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.
* 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.
tests: fix rare false failure in tail-2/F-vs-rename
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").