Problem reported by Sick Pigs (bug#81269).
Ordinarily we’d say “fix the kernel or the hardware”,
but this bug seems widespread and unlikely to be fixed any time soon,
and the workaround is not a lot of trouble.
* src/dd.c (real_start_time): New static var.
(getrealxtime): New static function.
(print_xfer_stats): Use the max of elapsed monotonic and elapsed
real time.
In legacy CJK locales a single input byte can decode to a wide character
above UCHAR_MAX, e.g. SHIFT-JIS bytes 0xA1..0xDF become U+FF61..U+FF9F.
wc then indexed its 256-entry wc_isprint/wc_isspace tables with that
value and read past their end.
* src/wc.c (wc): Take the byte-indexed fast path only when the decoded
character fits in a byte; wider values fall through to c32width and
c32isspace.
* tests/wc/wc-sjis.sh: New test.
* tests/local.mk (all_tests): Add it.
* NEWS: Mention the fix.
Link: https://github.com/coreutils/coreutils/pull/298
* tests/nproc/nproc-quota-systemd.sh: Explicitly set OMP_NUM_THREADS
to an ignorable value, to ensure scheduler processing is independent.
* tests/nproc/nproc-quota.sh: Likewise for the SCHED_FIFO check.
https://github.com/coreutils/coreutils/pull/290
This imports a xstrtol-error change from Gnulib that fixes some error
messages that were not properly escaped when given an invalid integer
argument.
* .gitignore: Add /lib/thread-creators.h which is generated by Gnulib.
* gnulib: Update to the latest commit.
* tests/od/od.pl (@Tests): Add some test cases.
* NEWS: Mention the improvement.
* src/cut.c (delim_bytes): Add a spare byte so a maximum-length
multi-byte delimiter stays NUL terminated for the strstr needle in
find_field_delim. Note in 9.11 this buffer was larger (16 bytes)
and so didn't not have a buffer over-read issue.
(main): Ensure DELIM_BYTES is NUL terminated after each --delimeter.
Also explicitly writing the NUL allows for better testing by
triggering overflow issues in default builds, if the buffer
is not sized correctly.
* NEWS: Mention the bug fix.
* tests/cut/cut.pl: Add test cases.
Reported at https://github.com/coreutils/coreutils/pull/286
* NEWS: Mention the bug fix.
* src/unexpand.c (unexpand): Check if the column is greater or equal to
the next_tab_column.
* tests/unexpand/mb.sh: Add a test case.
https://github.com/coreutils/coreutils/pull/285
Copyright-paperwork-exempt: Yes
* tests/sort/sort-locale.sh: In a UTF-8 locale '-' carries a minimal
(shifted) weight, so 'file1' sorts before 'file-2' even though '-'
precedes '1' in the C/byte order. This is the opposite of the C locale
result, so it also exercises the differs-from-C path.
Identified here: https://github.com/uutils/coreutils/pull/12677
Closes https://github.com/coreutils/coreutils/pull/283
* tests/date/date.pl: Add tests covering a leading day-of-week name,
out-of-range zone minutes, two timezone tokens, a bare sign operand,
a trailing token after an @epoch operand, operand quoting in
diagnostics, and a '+N unit' suffix following a complete time.
* tests/date/date-tz.sh: Add tests covering daylight-saving gap,
and overlap local times.
Closes https://github.com/coreutils/coreutils/pull/284
* bootstrap.conf (gnulib_modules): Add execvp which as a different
prototype on Windows along with other issues mentioned in the Gnulib
manual.
* src/nohup.c (main): Check if SIGHUP is defined.
This should not affect programatic parsing, because if you have to parse
the shell style, then the same logic will parse unescaped output.
This is a better default now that --terse uses quoted format by default,
and also the default output format quotes file names by default.
* src/stat.c (getenv_quoting_style): Change the default.
%N also outputs the target of a symlink
so support %Qn to give more control over quoted names.
* src/stat.c (print_it): Validate %Qn.
(print_stat): Output quoted file name with %Qn.
(usage): Add %Qn description.
* doc/coreutils.texi (stat invocation): Likewise.
* tests/stat/stat-fmt.sh: Add a test case.
This is safer to output to terminal with malicious file names,
with multiple lines or control characters etc.
* src/stat.c: Quote the file name in the default output format
in the default quoting style, or as selected with QUOTING_STYLE.
Reported by Michał Majchrowicz and Marcin Wyczechowski.
The previous commit is not sufficient to fix the race,
since I forgot shred now opens with O_NONBLOCK, and so cat may
not be even reading by the time shred's open() returns.
* tests/shred/fifo.sh: Put more robust synchronization in place
along the lines of what we did in commit v9.11-47-ga6ba6a23a,
using a separate fifo_writer_ to ensure the cat is reading,
before shred runs.
A fixed-offset keyword such as 'UTC' must anchor the instant before
relative items are applied, so that '1970-01-01 UTC N seconds' is
exactly N seconds past the epoch even when the local zone observes
DST between the epoch and the result.
* tests/date/date-tz.sh: Add a relative-seconds-across-DST case.
https://github.com/coreutils/coreutils/pull/275
With -L, a recursive chmod/chown follows symlinks while descending;
a symlink pointing back to an ancestor forms a cycle that must be
detected and not descended into forever.
* tests/chmod/symlinks.sh: Add a symlink-cycle case for chmod -RL.
* tests/chown/deref.sh: Likewise for chown -RL.
https://github.com/coreutils/coreutils/pull/274