2020-03-05 Pádraig Brady
version 8.32
* NEWS: Record release date.
2020-03-04 Pádraig Brady
tests: don't rely on system env(1) being present
* tests/misc/env-S.pl: `env -i env` will call the system env
due to the path being cleared, so pass the absolute path
of our env binary under test to avoid that. This was seen
to be an issue on Guix where /usr/bin/env was not available.
basenc: avoid undefined behaviour in z85 processing
* src/basenc.c (z85_decode_ctx_init): Ensure we're working
with unsigned, as otherwise ubsan triggers with:
src/basenc.c:767:18: runtime error: signed integer overflow:
43 * 52200625 cannot be represented in type 'int'
(z85_encode): Likewise to avoid the usban error:
src/basenc.c:630:26: runtime error:
left shift of 134 by 24 places cannot be represented in type 'int'
2020-03-01 Pádraig Brady
tests: avoid a false failure on OpenIndiana 11
* tests/misc/timeout-parameters.sh: Split the large timeout
handling to ...
* tests/misc/timeout-large-parameters.sh: ... here, so that
the 3 second delay is contained in its own test, and if
the test is skipped due invalid handling within timeout(1),
it will be more apparent.
Also adjust the check so we skip whenever the kernel timer
fires immediately, to handle the buggy OpenIndiana 11 kernel also.
Reported by Bruno Haible.
tests: avoid a hang on GNU/Hurd from 2019
* tests/du/8gb.sh: Add a timeout around:
`dd bs=1 seek=8G of=big < /dev/null`
tests: use bash in some scripts to avoid false failures
* init.cfg (require_bash_as_SHELL_): A new function to replace
SHELL for the current test, with bash if available.
This is useful on OpenIndiana 11 where /bin/sh was seen
to have races in handling of SIGPIPE.
* tests/misc/seq-epipe.sh: Use the new function to enforce bash.
* tests/misc/env-signal-handler.sh: Likewise.
Reported by Bruno Haible
tests: improve test coverage for ls stat checks
* tests/ls/stat-free-color.sh: Check for the availability
of various stat calls individually, and add statx() and fstatat64()
to the list to check. Fix the stat counting logic to
ignore lines like "+++ exited with 0 +++".
* tests/ls/stat-free-symlinks.sh: Check syscalls other than stat().
2020-03-01 Bruno Haible
tests: enable 4 more tests to be executed on FreeBSD
* init.cfg (gcc_shared_libs_): New variable.
(gcc_shared_): Use it, instead of hardcoding -ldl.
(require_gcc_shared_): Determine the suitable value
for gcc_shared_libs_.
2020-02-29 Pádraig Brady
tests: fix incorrect `|| fail` pattern in tests
* tests/ls/stat-free-symlinks.sh: s/|| fail/|| fail=1/.
* tests/misc/tee.sh: Likewise.
* tests/touch/relative.sh: Likewise.
* cfg.mk (sc_prohibit_or_fail): A new syntax-check to avoid this.
2020-02-29 Pádraig Brady
tests: avoid false failures on darwin 19.2.0
With these adjustments, all tests pass on macOS Catalina.
* tests/dd/sparse.sh: Adjust so that systems like apfs that
don't create holes < 16 MiB do not fail erroneously.
* tests/touch/trailing-slash.sh: Darwin was seen to dereference
symlinks to files when given a trailing slash, so avoid
that particular case.
2020-02-29 Bruno Haible
tests: fix test failure on FreeBSD 12
* tests/misc/csplit-io-err.sh: Limit the effect of the fwrite
override to streams != stderr, as fwrite is in the error() path there.
2020-02-27 Jan Nieuwenhuizen
build: once again distribute .tar.gz files
* configure.ac: Reenable distribution of gzip-compressed
tarballs, for Guix bootstrapping reasons as discussed at:
https://lists.gnu.org/r/coreutils/2020-02/msg00042.html
* THANKS.in: Remove me, as now a committer.
* NEWS (Build-related): Mention this.
2020-02-27 Pádraig Brady
maint: ensure .deps/ in the project root is ignored by git
* .gitignore: s|*/.deps/|.deps|
doc: remove older ChangeLog items
* Makefile.am: Update the oldest documented version
to 8.23 which is now about 5 years old.
2020-02-27 Colin Watson
ls: issue error message on removed directory
If the current directory has been removed, then "ls" confusingly
produced no output and no error message, indistinguishable from
running on an empty directory.
* src/ls.c (print_dir): Report ENOENT on GNU/Linux if readdir
finds no directory entries at all, not even "." or "..",
and a recheck with the getdents syscall returns ENOENT.
We recheck with getdents() as POSIX states that
"The directory entries for dot and dot-dot are optional".
* tests/ls/removed-directory.sh: New file.
* tests/local.mk (all_tests): Add new test.
* NEWS: Mention the change in behavior.
Reported by Owen Thomas.
2020-02-25 Pádraig Brady
build: update to latest gnulib
* bootstrap.conf: Adjust for changes to fchmodat and fchownat,
which are now separated from chmodat and chownat respectively.
b2sum: sync better with upstream
* src/blake2/blake2-impl.h: Sync load16() implementation,
which doesn't change code generation.
Also leverage (builtin) memcpy to more efficiently
move data on little endian systems,
giving a 2% win with GCC 9.2.1 on an i3-2310M.
factor: sync longlong.h adjustments from upstream
* src/longlong.h: Sync changes from:
https://gmplib.org/repo/gmp/log/tip/longlong.h
mips64: Provide r6 asm code as default expression yields.
arm32: Define sub_ddmmss separately for non-thumb (no rsc instruction).
powerpc: Add "CLOBBER" descriptions for some registers.
x86: Fix criterion for when to use mulx in umul_ppmm.
stat,tail: sync file system constants from the linux kernel
* src/stat.c: Add magic constants for "binderfs", "dma-buf-fs",
"erofs", "ppc-cmm-fs", and "z3fold".
* NEWS: Mention the improvement.
2020-02-24 Pádraig Brady
uniq: avoid strcoll() to improve performance and consistency
strcoll() is only significant to uniq(1) if it returns 0,
and it generally only does so with buggy locales or mismatched
locales and data. Some systems may have strcoll()
return 0 for equivalent normalized unicode forms,
but for consistency across platforms strcoll() is avoided.
The various cases are defined in the new test.
This is consistent with newer POSIX standards as discussed at:
https://www.austingroupbugs.net/view.php?id=963
* src/uniq.c: s/xstrcoll/memcmp/.
* tests/local.mk: Reference the new test.
* tests/misc/uniq-collate.sh: Add a new test.
* NEWS: Mention the change in behavior.
Fixes https://bugs.gnu.org/38627
2020-02-15 Pádraig Brady
doc: clarify that '%a' stat format outputs mode bits
* src/stat.c (usage): Mention permission bits rather than
"access" so there is no confusion with ACLs etc.
Also indicate we output the file type with '%A'.
* doc/coreutils.texi (stat invocation): Likewise.
Also indicate '%A' is similar to `ls -ld` output.
Addresses https://bugs.gnu.org/39613
2020-02-10 Pádraig Brady
tests: fix test for symlink
* tests/cp/preserve-gid.sh: s/-l/-L/.
Reported by Kamil Dudka
2020-02-09 Kamil Dudka
tests: ensure tests/cp/preserve-gid.sh works with single binary
* tests/cp/preserve-gid.sh: If configured with --enable-single-binary
copy the coreutils single binary, instead of the cp one-line launcher.
Discussed at https://bugzilla.redhat.com/1800597
Fixes https://bugs.gnu.org/39485
2020-02-09 Pádraig Brady
maint: avoid syntax-check failure in previous commit
* configure.ac: Restrict lines to 80 chars.
2020-02-09 Jim Meyering
build: suppress new FP warning from gcc-10.0.1
* configure.ac (GNULIB_WARN_CFLAGS): Add -Wno-return-local-addr
to avoid FP warning about careadlinkat.c. Discussed starting in
https://lists.gnu.org/r/coreutils/2020-02/msg00006.html
2020-02-04 Pádraig Brady
build: update to latest gnulib
Pick up recent build fixes to avoid sysctl.h inclusion on glibc systems,
restrict the max file size supported by read-file to PTRDIFF_MAX,
and to avoid a -Werror=unused failure in test-canonicalize.
tests: avoid false failure due to varying /proc/kallsyms
* tests/cp/proc-short-read.sh: Switch to using /proc/cpuinfo,
rather than /proc/kallsyms which was seen to vary in some cases.
Fixes https://bugs.gnu.org/39357
2020-02-04 Pádraig Brady
rmdir: fix --ignore-fail-on-non-empty with permissions errors
Since v6.10-21-ged5c4e7 `rmdir --ignore-fail-on-non-empty`
had reversed the failure status for directories that failed
to be removed for permissions reasons. I.E. it would have
returned a failure status for such non empty dirs, and vice versa.
* src/rmdir.c (errno_may_be_non_empty): Rename from the
more confusing errno_may_be_empty(), and remove the EEXIST
case (specific to Solaris), which is moot here since
handled in errno_rmdir_non_empty().
(ignorable_failure): Fix the logic error so that
_non_ empty dirs are deemed to have ignorable failures.
(main): Fix clobbering of errno by is_empty_dir().
(remove_parents): Likewise.
* tests/rmdir/ignore.sh: Add a test case.
* THANKS.in: Add reporter who fixed the errno handling.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/39364
2020-02-03 Pádraig Brady
build: avoid vector performance warnings in randperm
* configure.ac: Add -Wno-vector-operation-performance to suppress the
following gcc-9.2 error in gl/lib/randperm.c:
error: vector operation will be expanded piecewise
build: avoid including sysctl.h on glibc
* src/uname.c: Avoid unneeded header with GLIBC,
which has been deprecated since glibc-2.30.
* src/uptime.c: Likewise.
ls: support --time=creation to show/sort birth time
* src/ls.c (usage): Reorganize help for --time,
and add description for --time=birth.
(do_statx): Store btime in mtime if available.
(get_stat_btime): A new function to read the creation time
from the appropriate stat structure member.
(cmp_btime): A new function to compare birth time.
(print_long_format): Output '?' when birth time unavailable.
* doc/coreutils.texi: Document --time={birth,creation}.
* tests/local.mk: Reference the new test.
* tests/ls/birthtime.sh: Add a new test.
* NEWS: Mention the new feature.
2020-01-30 Chris Meyering
build: rearrange yes(1) code to prevent GCC 10 warning
* src/yes.c (main): Convert for loop to do-while in order to indicate
that the loop will be run at least once.
This avoids the following warning after the second loop:
src/yes.c:110:20: error: writing 1 byte into a region of size 0
2020-01-01 Emil Engler
maint: add lib/iconv_open-zos.h to .gitignore
* .gitignore: Add file newly generated by gnulib commit 49e78fc
2020-01-01 Pádraig Brady
build: auto enable use of openssl with >= version 3
* configure.ac: Set --with-openssl=auto-gpl-compat as the default,
so that openssl is used for md5sum etc., with openssl >= 3,
which is newly licensed under ASL v2.
* gnulib: Update to include "auto-gpl-compat" support.
maint: adjust to split out xstrtol-error gnulib module
* bootstrap.conf: Depend on the new module split from xstrtol.
* src/df.c: Include "xstrtol-error.h" for xstrtol_fatal.
* src/du.c: Likewise.
* src/ls.c: Likewise.
* src/od.c: Likewise.
* src/pr.c: Likewise.
* src/sort.c: Likewise.
2020-01-01 Pádraig Brady
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.
2019-12-08 Bernhard Voelker
doc: add example to demonstrate sub-second sleep times
* doc/coreutils.texi (sleep invocation): Add an example to demonstrate
how to use the floating-point and the scientific notation to sleep
for sub-second times, e.g. milli-, micro- and nanoseconds.
Inspired by Stephane Chazelas in:
https://lists.gnu.org/r/coreutils/2019-12/msg00005.html
2019-12-02 Pádraig Brady
maint: fix syntax-check failure from recent adjustment
* cfg.mk (old_NEWS_hash): Regenerate after commit v8.31-56-gc1e1965.
2019-12-02 Kamil Dudka
chcon: do not validate security context if SELinux is disabled
* src/chcon.c (main): Skip call of security_check_context()
in case SELinux is disabled to avoid unnecessary failure.
Bug: https://bugzilla.redhat.com/1777831
2019-11-12 Paul Eggert
doc: remove colon from node name
* doc/sort-version.texi (Minus/Hyphen and Colon characters):
Rename from “Minus/Hyphen @samp{-} and Colon @samp{:} characters”,
as texi2any 6.6 complains about colons in node names.
shred: modernize documentation
* doc/coreutils.texi (shred invocation):
Modernize discussion to today’s technology (Bug#38168).
* src/shred.c (usage): Omit lengthy duplication of the manual’s
discussion of file systems and storage devices, as that became out
of sync with the manual. Instead, just cite the manual.
2019-10-22 Paul Eggert
all: improve parsing of numeric arguments
This addresses a longstanding "update all callers" FIXME in
lib/xstrtol.c, by having programs check that numbers do not
have unknown suffixes. The problem was also reported for
'shuf' by my student Maggie Huang while reimplementing a shuf
subset in Python as an exercise in UCLA Computer Science 35L:
https://web.cs.ucla.edu/classes/fall19/cs35L/assign/assign3.html
This patch also improves the portability of the code to unusual
platforms where ULONG_MAX < SIZE_MAX.
* NEWS: Mention user-visible changes.
* src/chgrp.c (parse_group):
* src/chroot.c (parse_additional_groups):
* src/du.c (main):
* src/install.c (get_ids):
* src/join.c (string_to_join_field):
* src/ls.c (decode_switches):
* src/md5sum.c (split_3):
* src/shuf.c (main):
* src/sort.c (specify_nthreads):
* src/uniq.c (size_opt, main):
Use uintmax_t instead of unsigned long, for portability
to oddball platforms where unsigned long is not wide enough.
* src/du.c (main):
* src/expr.c (mpz_init_set_str) [!HAVE_GMP]:
* src/install.c (get_ids):
* src/ls.c (decode_switches):
* src/mknod.c (main):
* src/ptx.c (main):
* src/shuf.c (main):
* src/sort.c (specify_nmerge, specify_nthreads):
Reject numbers with suffixes.
* src/md5sum.c (split_3): Simplify.
stdbuf: improve size checking
* bootstrap.conf (gnulib_modules): Add minmax.
* src/libstdbuf.c: Include stdint.h, minmax.h.
(apply_mode): Don’t assume SIZE_MAX <= ULONG_MAX.
Improve checking for invalid sizes.
shuf: improve randperm overflow checking
* gl/lib/randperm.c: Include randperm.h first, since it’s the API.
Include stdint.h, count-leading-zeros.h, verify.h.
(floor_lg): Rename from ceil_log (which was not actually
implementing the ceiling!) and implement the floor using
count_leading_zeros.
(randperm_bound): Use floor_lg, not ceil_log. Use uintmax_t
instead of size_t in case the size gets large on a 32-bit host.
* gl/modules/randperm (Depends-on): Add count-leading-zeros, stdint.
build: don’t worry about logical-op checking
* configure.ac: Remove code tailoring --enable-gcc-warnings
to GCC 4.7 and earlier, as developers no longer need to worry
about GCCs that old.
build: re-enable type-limits checking
* configure.ac: When --enable-gcc-warnings is used, omit
-Wno-type-limits. The need for -Wno-type-limits has passed, now
that intprops.h uses builtin primitives for GCC 5 and later, given
that recent GCCs issue type-limits warnings only for non-constant
expressions. --enable-gcc-warnings is not intended for use with
old compilers, so we can drop -Wno-type-limits now.
2019-10-21 Paul Eggert
shuf: fix bug with ‘-r -n 0’
‘shuf -r -n 0 file’ would mistakenly read from standard input.
Problem reported by my student Jingnong Qu while reimplementing a
shuf subset in Python as an exercise in UCLA Computer Science 35L:
https://web.cs.ucla.edu/classes/fall19/cs35L/assign/assign3.html
* NEWS: Mention the fix. Also, ASCIIfy a previous item.
* src/shuf.c (main): Fix bug.
* tests/misc/shuf.sh: Add a test case for the bug.
2019-10-09 Jeff Layton
ls: use statx instead of stat when available
statx allows ls to indicate interest in only certain inode metadata.
This is potentially a win on networked/clustered/distributed
file systems. In cases where we'd have to do a full, heavyweight stat()
call we can now do a much lighter statx() call.
As a real-world example, consider a file system like CephFS where one
client is actively writing to a file and another client does an
ls --color in the same directory. --color means that we need to fetch
the mode of the file.
Doing that with a stat() call means that we have to fetch the size and
mtime in addition to the mode. The MDS in that situation will have to
revoke caps in order to ensure that it has up-to-date values to report,
which disrupts the writer.
This has a measurable affect on performance. I ran a fio sequential
write test on one cephfs client and had a second client do "ls --color"
in a tight loop on the directory that held the file:
Baseline -- no activity on the second client:
WRITE: bw=76.7MiB/s (80.4MB/s), 76.7MiB/s-76.7MiB/s (80.4MB/s-80.4MB/s),
io=4600MiB (4824MB), run=60016-60016msec
Without this patch series, we see a noticable performance hit:
WRITE: bw=70.4MiB/s (73.9MB/s), 70.4MiB/s-70.4MiB/s (73.9MB/s-73.9MB/s),
io=4228MiB (4433MB), run=60012-60012msec
With this patch series, we gain most of that ground back:
WRITE: bw=75.9MiB/s (79.6MB/s), 75.9MiB/s-75.9MiB/s (79.6MB/s-79.6MB/s),
io=4555MiB (4776MB), run=60019-60019msec
* src/stat.c: move statx to stat struct conversion to new header...
* src/statx.h: ...here.
* src/ls.c: Add wrapper functions for stat/lstat/fstat calls,
and add variants for when we are only interested in specific info.
Add statx-enabled functions and set the request mask based on the
output format and what values are needed.
* NEWS: Mention the Improvement.
2019-10-03 Paul Eggert
truncate: avoid integer-overflow assumptions
* src/truncate.c (do_ftruncate): Simplify overflow checking,
and don’t rely on theoretically-nonportable assumptions
like assuming that OFF_MAX < UINTMAX_MAX.
numfmt: avoid unlikely integer overflow
* src/numfmt.c (parse_format_string): Report overflow if
pad < -LONG_MAX, since that can’t be negated.
nl: fix integer-overflow bug
Problem reported by Roland Illig (Bug#37585)
* src/nl.c (print_lineno): Don’t rely on undefined behavior when
checking for integer overflow.
cp: simplify integer overflow checking
* src/copy.c (sparse_copy): Use INT_ADD_WRAPV instead
of doing overflow checking by hand.
2019-09-08 Pádraig Brady
seq: use faster processing for integer steps from 2 to 200
* src/seq.c: (seq_fast): Accept STEP as a parameter and use that
to skip the output of generated numbers.
(main): Relax to using seq_fast for integer steps between 1 and 200.
For larger steps the throughput was faster using the standard
incrementing procedure.
(cmp): Use the equivalent but faster memcmp for equal len strings.
* tests/misc/seq.pl: Update fast path cases.
Addresses https://bugs.gnu.org/37241
2019-09-08 Pádraig Brady
maint: use consistent header ordering and spacing in NEWS
* NEWS: Move "Changes in behavior" before "New features",
and ensure there is only a single blank line between sections.
2019-08-15 Paul Eggert
build: update gnulib submodule to latest
2019-08-15 Assaf Gordon
scripts: document how to build older versions on newer systems
Based on https://lists.gnu.org/r/coreutils/2019-08/msg00011.html .
* scripts/build-older-versions/README.older-versions: Documentation
* scripts/build-older-versions/build-older-versions.sh: Helper script.
* scripts/build-older-versions/.gitignore: Ignore build directory.
* scripts/build-older-versions/coreutils-5.0-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-5.97-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-6.10-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-6.11-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-6.12-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-7.2-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-8.13-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-8.17-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-8.18-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-8.24-on-glibc-2.28.diff,
scripts/build-older-versions/coreutils-8.4-on-glibc-2.28.diff: Patches.
2019-08-12 Bruno Haible
build: adjust for recent gnulib pthread changes
Discussed in https://lists.gnu.org/r/coreutils/2019-08/msg00030.html .
* bootstrap.conf (gnulib_modules): Replace 'pthread' with
pthread-* modules.
* src/sort.c: Remove GNULIB_defined_pthread_functions conditional.
2019-08-11 Assaf Gordon
date: mention military timezone changes from gnulib
Gnulib commits f1f10d47be8762e4ca17c8957a0520b08d28abfb and
0673d8ab42c9bb0cf618a21b537cdd8fb976fb73 negated the meaning of
military timezones parsed in gnu date.
See https://lists.gnu.org/r/bug-gnulib/2019-08/msg00005.html and
https://lists.gnu.org/r/coreutils/2019-08/msg00021.html
* NEWS: Mention this user-visible change.
* tests/misc/date.pl: Add tests for the new behavior.
2019-08-11 Bernhard Voelker
maint: add lib/argmatch.h to po/POTFILES.in
* po/POTFILES.in (lib/argmatch.h): Add to avoid sc_po_check error:
"maint.mk: you have changed the set of files with translatable \
diagnostics;"
2019-08-11 Assaf Gordon
gnulib: update to latest
2019-08-08 Pádraig Brady
doc: clarify that truncate creates sparse files
* src/truncate.c (usage): Explicitly mention "sparse".
* doc/coreutils.texi (truncate invocation): Likewise.
Addresses https://bugs.gnu.org/36963
2019-08-07 Mike Swanson
dircolors: recognize the WebP image format
* src/dircolors.hin: Add .webp for the WebP image format.
Fixes https://bugs.gnu.org/36899
2019-08-07 Bernhard Voelker
maint: fix error in syntax-check checking
The previous commit introduced a bug into the following syntax-check,
and thus effectively turned it off:
$ make sc_prohibit_test_calls_print_ver_with_irrelevant_argument; \
echo $?
prohibit_test_calls_print_ver_with_irrelevant_argument
fatal: cannot change to 'grep': No such file or directory
0
* cfg.mk (sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Remove changing directory, and pass $(srcdir) as argument to 'git -C'.
2019-08-04 Akim Demaille
maint: fix issues in syntax-check
* cfg.mk (sc_prohibit_colon_redirection): Don't expect `|` to denote
the pipe character in git grep.
(sc_tests_executable)
(sc_case_insensitive_file_names)
(sc_some_programs_must_avoid_exit_failure)
(sc_prohibit_test_background_without_cleanup_)
(sc_prohibit_test_calls_print_ver_with_irrelevant_argument)
(sc_prohibit_test_ulimit_without_require_)
(sc_prohibit_test_background_without_cleanup_)
(sc_THANKS_in_duplicates)
*sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Don't expect builddir to be a descendant of srcdir.
(sc_strftime_check): Don't check file size against 0 when "N\nq\n" was
already put in the file.
* THANKS.in: Remove me.
2019-08-03 Assaf Gordon
seq: fix superfluous output line
Under certain circumstances seq prints an extra line when the output
format has custom format with characters following the printed numbers:
$ seq -f "%g " 1000000 1000000
1e+06
1e+06
This is due to the "print_extra_number" logic using strings to determine
whether a 'extra number' is needed, but only one string was trimmed
when using a custom printf format.
Prompted by https://lists.gnu.org/r/coreutils/2019-08/msg00001.html
* NEWS: Mention fix.
* src/seq.c (print_numbers): Trim the 'x0_str' string before comparing
it to the previous 'x_str' string.
* tests/misc/seq-extra-number.sh: Add this scenario.
* tests/local.mk (all_tests): Add new test.
2019-07-22 Bernhard Voelker
doc: improve new version sort chapter
* doc/sort-version.texi: Fix some typos, avoid overly long lines in
the generated PDF, enclose some sample strings in @samp{...} for better
readability, etc. This also avoids an sc-avoid-builtin error:
s/builtin/built-in/
2019-07-15 Assaf Gordon
doc: add "version sort ordering" chapter
* doc/sort-version.texi: New file.
* doc/local.mk (doc_coreutils_TEXINFOS): Add new file.
* doc/coreutils.texi: @include new file, replace previous "Details about
version sort" section.
2019-07-12 Andreas Dilger
stat: don't explicitly request file size for filenames
When calling 'stat -c %N' to print the filename, don't explicitly
request the size of the file via statx(), as it may add overhead on
some filesystems. The size is only needed to optimize an allocation
for the relatively rare case of reading a symlink name, and the worst
effect is a somewhat-too-large temporary buffer may be allocated for
areadlink_with_size(), or internal retries if buffer is too small.
The file size will be returned by statx() on most filesystems, even
if not requested, unless the filesystem considers this to be too
expensive for that file, in which case the tradeoff is worthwhile.
* src/stat.c: Don't explicitly request STATX_SIZE for filenames.
2019-06-20 Paul Eggert
od: use fseek on non-regular files
Problem reported by Szőts Ákos (Bug#36291).
* NEWS: Mention this.
* src/od.c (skip): Try fseek even on files that do not have usable
sizes, falling back on fread if fseek fails.
2019-06-18 Paul Eggert
doc: mention ls -l user/group justification
* doc/coreutils.texi (What information is listed):
Document justification of user and group columns in ls -l output
(Bug#36220).
2019-06-14 Jeff Layton
stat: fix enabling of statx logic
* src/stat.c: STATX_INO isn't defined until stat.h is included.
Move the test down so it works properly.
2019-06-13 Assaf Gordon
tests: avoid false-positive in date-debug test
When debugging an invalid date due to DST switching, the intermediate
'normalized time' should not be checked - its value can differ between
systems (e.g. glibc vs musl).
Reported by Niklas Hambüchen in
https://lists.gnu.org/r/coreutils/2019-05/msg00031.html
Analyzed by Rich Felker in
https://lists.gnu.org/r/coreutils/2019-05/msg00039.html
* tests/misc/date-debug.sh: Replace the exact normalized time
with 'XX:XX:XX' so different values would not trigger test failure.
2019-06-10 Jeff Layton
stat: Use statx where available and support --cached
* src/stat.c: Drop statbuf argument from out_epoch_sec().
Use statx() rather than [lf]stat() where available,
so a separate call is not required to get birth time.
Set STATX_* mask bits only for things we want to print,
which can be more efficient on some file systems.
Add a new --cache= command-line option that sets the appropriate hint
flags in the statx call. These are primarily used with network
file systems to indicate what level of cache coherency is desired.
The new option is available unconditionally for better portability,
and ignored where not implemented.
* doc/coreutils.texi: Add documention for --cached.
* man/stat.x (SEE ALSO): Mention statx().
* NEWS: Mention the new feature.
2019-06-09 Pádraig Brady
doc: fix description of tail -f on truncated files
* doc/coreutils.texi (tail invocation): Update to match
the new behavior following commit v8.23-189-gb28ff6a
2019-06-08 Pádraig Brady
split: fix failure for certain number of specified files
* src/split.c (set_suffix_length): Use a more standard
zero based logN calculation for the number of units.
* tests/split/suffix-auto-length.sh: Add a test case.
* THANKS.in: Mention the reporter.
* NEWS: Mention the fix.
Fixes https://bugs.gnu.org/35291
2019-05-30 Paul Eggert
dd: be more careful about signal handling
Problem reported by Hans Henrik Bergan (Bug#36007).
* NEWS: Mention this.
* src/dd.c (iclose, ifdatasync, ifstat, ifsync):
New functions, which are more careful about SIGINT.
(cleanup): Use iclose instead of close.
(finish_up): Process signals first.
(skip, dd_copy, main): Use ifstat instead of fstat.
(dd_copy): Use ifdatasync and ifsync instead of fdatasync and fsync.
maint: fix version number in NEWS
2019-05-28 Paul Eggert
cp: fix /dev/stdin problem on Solaris
Problem reported by Jakub Kulik (Bug#35713).
* NEWS: Mention this.
* configure.ac (DEV_FD_MIGHT_BE_CHR): New macro.
* src/copy.c (DEV_FD_MIGHT_BE_CHR): Default to false.
(follow_fstatat): New function.
(copy_internal): Use it.
* src/copy.h (XSTAT): Remove; no longer used.
2019-05-26 Kevin Locke
doc: clarify dd sparse detection is by *output* block
The wording of the dd --help text suggests that output will be skipped
for sparse *input* blocks (i.e. that NUL-checking is done on input
blocks) while the code actually checks/skips all-NUL *output* blocks.[1]
* src/dd.c (usage): Update the --help text to clarify the above.
* tests/dd/sparse.sh: Ensure sparseness is controlled with obs.
[1]: https://superuser.com/a/1136358
2019-05-22 Martin Castillo
doc: fix typo in sort set operations example
* doc/coreutils.texi (sort invocation): Add a missing -u
option to uniq.
Addresses https://bugs.gnu.org/35849
2019-05-17 Paul Eggert
b2sum: port blake2b-ref.c to HP-UX aCC
Continue the fix for Bug#35650.
* src/blake2/blake2b-ref.c [HAVE_CONFIG_H]: Include .
2019-05-15 Paul Eggert
b2sum: sync better with upstream
* src/blake2/b2sum.c: Reorder source code to minimize diffs from:
https://github.com/BLAKE2/BLAKE2/blob/master/b2sum/b2sum.c
b2sum: port to HP-UX aCC
Its support for the -include option is flaky. Problem reported by
Michael Osipov (Bug#35650). Plus, we could run into other
compilers that don’t support any option like -include. Change the
code so that -include is not needed. Although this causes us to
depart from the upstream version, we’re already doing that for
other reasons.
* configure.ac (USE_XLC_INCLUDE): Remove, as there’s no
guarantee a compiler will support something like -include.
* src/blake2/b2sum.c [HAVE_CONFIG_H]: Include .
* src/local.mk (src_b2sum_CPPFLAGS): Add -DHAVE_CONFIG_H.
Do not use -include or a substitute.
2019-05-14 Paul Eggert
stdbuf: port configure-time checking to HP-UX aCC
Problem reported by Michael Osipov (Bug#35650).
* configure.ac: Use AC_LANG_WERROR to pay attention to compiler
and linker warnings when testing whether stdbuf will work.
2019-05-11 Paul Eggert
b2sum: port to HP-UX C
* src/blake2/blake2.h (BLAKE2_PACKED):
Don’t assume __attribute__ ((packed)) works on non-Microsoft
compilers. Instead, assume it works only if we have good
reason to assume so, and fall back on Microsoft (or not packing)
otherwise. In practice, not packing is good enough and the
BLAKE2_PACKED macro is mostly just for documentation.
cp: port fiemap.h to C99
* src/extent-scan.c (extent_scan_read): Adjust to change in
struct fiemap.
* src/fiemap.h (struct fiemap): Use FLEXIBLE_ARRAY_MEMBER
to port to C99.
basenc: port to C99
* src/basenc.c: Various minor style cleanups.
(struct base_decode_context): Do not use anonymous unions, as
they’re not in C99. Use a named union instead. All uses changed.
maint: adjust to recent verify_true removal
* src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE):
Use verify_expr instead of verify_true, which has been removed.
(DECIMAL_DIGIT_ACCUMULATE): Remove unnecessary size check.
build: update gnulib submodule to latest
2019-04-19 Bernhard Voelker
gnulib: update to the latest
* gnulib: Update to latest, mainly for:
> mountlist: make parsing /proc/self/mountinfo more robust
* NEWS: Mention the fix.
Fixes https://bugs.gnu.org/33468
2019-03-31 Shugo Maeda
factor: output immediately if stdout is a tty but stdin is not
* src/factor.c (lbuf_putc): Use line buffered mode if the standard
output is a terminal in the same way as the stdio library.
User programs might use pty only for the standard out
like the example of Ruby's PTY module:
https://docs.ruby-lang.org/en/2.6.0/PTY.html#module-PTY-label-Example
* NEWS: Mention the fix.
Fixes https://bugs.gnu.orv/35046
2019-03-30 Pádraig Brady
maint: fix syntax check failure
* src/ln.c: Remove leading TAB.
2019-03-30 Martin Castillo
maint: tee: use STDIN_FILENO rather than 0
* src/tee.c (tee_files): Use the name rather than the value.
Addresses https://bugs.gnu.org/35041
2019-03-20 Paul Eggert
dd: improve doc of stderr output
* doc/coreutils.texi (dd invocation):
Document stderr output more carefully.
Say that conv=block can lose input data.
2019-03-18 Kamil Dudka
md5sum,b2sum,sha*sum: --help: add note about binary/text mode
* src/md5sum.c (usage): Make it clear that there is no difference
between binary mode and text mode on GNU systems.
Bug: https://bugzilla.redhat.com/406981
Bug: https://bugzilla.redhat.com/1688740
2019-03-17 Paul Eggert
doc: add NEWS item for Solaris symlink fix
ln: port to symlink ("x", ".") failing with EINVAL
Problem reported by John Marino (Bug#34894).
* src/ln.c (main): Port ln -s to Solaris symlink function,
where symlink ("x", ".") fails with errno == EINVAL.
2019-03-16 Pádraig Brady
doc: add a NEWS entry for the ln O_DIRECTORY fix
* NEWS: Mention the bugfix.
2019-03-16 Paul Eggert
ln: port to platforms lacking O_DIRECTORY
* src/ln.c (main): Port to older platforms lacking
support for POSIX.1-2008’s O_DIRECTORY flag (Bug#34876).
2019-03-15 Kamil Dudka
doc: improve wording of the --kibibytes option description
Bug: https://bugzilla.redhat.com/1527391 , https://bugs.gnu.org/33646
* doc/coreutils.texi (General output formatting): Improve wording of
'--kibibytes' option.
2019-03-11 Bernhard Voelker
maint: sync extra files from gnulib
Some files are physically copied from gnulib, and should get sync'ed
after each update to latest gnulib. This was forgotten during recent
updates.
* COPYING: Merge from gnulib/doc/COPYINGv3.
* tests/init.sh: Merge from gnulib/tests/init.sh.
2019-03-11 Pádraig Brady
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2019-03-10 Pádraig Brady
version 8.31
* NEWS: Record release date.
tests: test-N: include subsecond values in gating check
* tests/misc/test-N.sh: The subsecond values for atime and mtime
were potentially seen to differ on newlyl created files.
So we include the subsecond portion when comparing stat values.
tests: wc-nbsp: fix false failures on various systems
* tests/misc/wc-nbsp.sh: Add gating checks for all characters,
as there are disparate classifications on various systems:
SunOS 5.10 treats \u202F, \u2060 as !iswprint()
SunOS 5.10 treats \u00A0, \u2007 as iswspace()
AIX 7.2, Darwin 17.4.0, NetBSD 7.1 treat \u2060 as !iswprint()
2019-03-07 Pádraig Brady
tests: tail-2/pipe-f: avoid false failure closing stdout
* tests/tail-2/pipe-f.sh: Check closing stdout with >&-
is effective, which avoids a false failure on NetBSD 7.1
Reported by Assaf Gordon
tests: tac-2-nonseekable: ensure we don't block indefinitely
* tests/misc/tac-2-nonseekable.sh: Add a timeout to both
protect and check whether we can close stdin correctly.
tests: id/zero: avoid false failure due to sed differences
* tests/id/zero.sh: sed on OSX will output a \n even
if the input doesn't have a \n on the last "line".
So ensure we always have a trailing '\n' to avoid the disparity.
2019-03-07 Pádraig Brady
tests: test-N: fix false positives on some systems
Testing by Assaf Gordon on OSX showed the atime wasn't
being updated when explicitly set back in time.
Also Debian 8.11 / mips64 was seen to not update the
mtime when truncating an empty file.
* tests/misc/test-N.sh: Isolate from different timestamping
behaviors of various (file) systems, by correlating
the timestamps with stat(1) before using `test -N`.
2019-03-07 Assaf Gordon
doc: replace @hashchar{} with actual hash character
Very old makeinfo-4.13 fails with:
./doc/coreutils.texi:2286: Unknown command `hashchar'.
./doc/coreutils.texi:2286: Misplaced {.
./doc/coreutils.texi:2286: Misplaced }.
Reported Bernhard Voelker in
https://lists.gnu.org/r/coreutils/2019-03/msg00016.html .
* doc/coreutils.texi (basenc invocation): Replace @hashchar{} with
actual hash character. The special syntax is only required
when referring to #line directives.
2019-03-06 Pádraig Brady
build: avoid statx related build failure on AIX
* src/stat.c (get_birthtime): Check also for STATX_BTIME define,
as a different statx is available on AIX 7.2.
tests: wc-nbsp.sh: avoid failure on FreeBSD
* tests/misc/wc-nbsp.sh: FreeBSD and OS X don't
treat non breaking space as printable characters.
So use wc -L to determine printability before
testing non breaking space functionality.
build: fix env build where SIGNUM_BOUND is not constant
* src/env.c (initialize_signals): A new function to initialize
the signals array on the heap, to avoid a build failure on
opensolaris, where SIGNUM_BOUND is not a constant.
2019-03-04 Pádraig Brady
doc: remove older ChangeLog items
* Makefile.am: Update the oldest documented version
to 8.22 which is now about 5 years old.
build: revert recent change with distributed man page handling
* man/local.mk: commit f114495e added an extra check to ensure
a binary was working before using it to generate the man page.
However this was not working for the false(1) command,
and also one can generally specify that one should not
be using generated commands on the current system by passing
'cross_compiling=yes' to the configure invocation.
env: add --list-signal-handling to output non default handling
* src/env.c (main): Output blocked or ignored signals
before a command is executed.
* doc/coreutils.texi (env invocation): Add the option.
* tests/misc/env-signal-handler.sh: Add a test case.
* NEWS: Mention the new feature.
2019-03-04 Assaf Gordon
env: new options --{default,ignore,block}-signal[=SIG]
New options to set signal handlers for the command being executed.
--block-signal suggested by Paul Eggert in http://bugs.gnu.org/34488#71
--default-signal is useful to overcome the POSIX limitation that shell
must not override inherited signal state, e.g. the second 'trap' here is
a no-op:
trap '' PIPE && sh -c 'trap - PIPE ; seq inf | head -n1'
Instead use:
trap '' PIPE && sh -c 'env --default-signal=PIPE seq inf | head -n1'
Similarly, the following will prevent CTRL-C from terminating the
program:
env --ignore-signal=INT seq inf > /dev/null
See https://bugs.gnu.org/34488#8
* NEWS: Mention new options.
* doc/coreutils.texi (env invocation): Document new options.
* man/env.x: Add example of --default-signal=SIG usage.
(SEE ALSO): Mention sigprocmask.
* src/env.c (signals): New global variable.
(longopts): Add new options.
(usage): Print new options.
(parse_signal_params): Parse comma-separated list of signals, store in
signals variable.
(reset_signal_handlers): Set each signal to SIG_DFL/SIG_IGN.
(parse_block_signal_params): Parse command-line options.
(set_signal_proc_mask): Call sigprocmask to block/unblock signals.
(main): Process new options.
* src/local.mk (src_env_SOURCES): Add operand2sig.c.
* tests/misc/env-signal-handler.sh: New test.
* tests/local.mk (all_tests): Add new test.
2019-03-04 Martin Bukatovic
stat: print birth time on systems supporting statx
* configure.ac: Check for statx(), available on glibc >= 2.28.
* src/stat.c (get_birthtime): Call statx() when available.
* NEWS: Mention the improvement.
2019-03-04 Pádraig Brady
df: support different file system encodings when not using tty
* src/df.c (replace_problematic_chars): A new wrapper to be
more conservative in our replacement when not connected to a tty.
* tests/df/problematic-chars.sh: Add a test case.
maint: tidy up recent additions to NEWS
* NEWS: Move date change to improvements and fix nohup grammar.
2019-02-27 Bernhard Voelker
doc: further clarify 'yes' alternative in seq invocation
* doc/coreutils.texi (node seq invocation): Clarify to use the tool
'yes'; otherwise the reader may interpret the sentence as if one
could pass 'yes' as the INCREMENT value.
2019-02-26 Pádraig Brady
wc: treat non breaking space as a word separator
* src/wc.c (iswnbspace): A new function to match
characters in this class.
(isnbspace): Likewise for single byte charsets.
(main): Initialize posixly_correct from the environment,
to allow disabling honoring NBSP in non C locales.
(wc): Call is[w]nbspace() along with is[w]space.
* bootstrap.conf: Ensure btowc is available.
* tests/misc/wc-nbsp.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the change in behavior.
2019-02-25 Paul Eggert
doc: more date +%F clarifications
* doc/coreutils.texi (Date conversion specifiers):
Plain %F is actually like %+4Y-%m-%d.
(Padding and other flags): Mention POSIX restrictions.
* src/date.c (usage): Document recent changes.
doc: give date +%+F example
* doc/coreutils.texi (Padding and other flags):
Give example for + conversion specification.
doc: fix typo in previous patch
date: ‘+’ conversion specification flag
The recent Gnulib update fixed Bug#34608; document and test this.
* NEWS: Mention the change.
* doc/coreutils.texi (Padding and other flags):
Update doc to cover new flag and other POSIX.1-2017 changes.
* tests/misc/date.pl (date-century-plus): New test.
build: update gnulib submodule to latest
2019-02-24 Bernhard Voelker
all: detect --help and --version more consistently
For select programs which accept only --help and --version options
(in addition to non-option arguments), process these options before
any other options.
Before:
$ dd bs=1 --help
dd: unrecognized option '--help'
Try 'dd --help' for more information.
$ yes me --help
me --help
me --help
...
After:
Any occurrence of '--help' in the arguments (prior to '--') will
show the help screen.
Discussed in https://bugs.gnu.org/33468 .
* NEWS: Mention change.
* src/cksum.c, src/dd.c, src/hostid.c, src/hostname.c, src/link.c,
src/logname.c, src/nohup.c, src/sleep.c, src/tsort.c, src/unlink.c,
src/uptime.c, src/users.c, src/whoami.c, src/yes.c (main): Replace
parse_long_options() + getopt_long() calls with
parse_gnu_standard_options_only(); Remove inclusion;
Remove empty 'struct long_options' variable;
* tests/misc/help-version-getopt.sh: Add test.
* tests/local.mk (all_tests): Reference it.
2019-02-24 Pádraig Brady
gnulib: update to the latest
update to a version with parse_gnu_standard_options_only()
2019-02-20 Martin Castillo
doc: fix join examples in texinfo
* doc/coreutils.texi (join invocation): Fix various errors.
Fixes https://bugs.gnu.org/34583
Fixes https://bugs.gnu.org/34584
2019-02-19 Daming Yang
ls: better align month abbreviations containing digits
* src/ls.c (abmon_init): Align numeric abbreviations right.
* NEWS: Mention the improvement.
2019-02-18 Pádraig Brady
sort: clarify in --debug; only text comparisons affected
* src/sort.c (main): Adjust the debug info regarding locales,
to clarify that only textual comparisons are affected.
* tests/misc/sort-debug-warn.sh: Adjust accordingly.
Fixes https://bugs.gnu.org/34490
2019-02-12 Pádraig Brady
comm,join: ensure warnings are apparent upon exit
* src/comm.c (main): Output a warning right before exit,
in case previous errors have scrolled from view.
* src/join.c (main): Likewise.
* tests/misc/comm.pl: Addjust accordingly.
* tests/misc/join.pl: Likewise.
Fixes https://bugs.gnu.org/34347
2019-02-12 Filipp Gunbin
doc: fix typo referencing RFC 2822
* doc/coreutils.texi (date invocation): s/822/2822/.
Fixes https://bugs.gnu.org/34438
2019-02-11 Pádraig Brady
gnulib: update to use new strtold module
* gnulib: Update to make the new strtold module available.
* bootstrap.conf: strtod is now a dependency of c-strtod,
which in turn is a dependency of cl-strtod. This treats
strtold and strtod similarly.
* gl/lib/cl-strtod.c: Adjust to assume strtold is available.
* tests/misc/sort-float.sh: Likewise.
* src/sort.c: Likewise.
(nan_compare): Adjust comment to indicate
we still have to init padding bits as per
https://sourceware.org/bugzilla/show_bug.cgi?id=13246
2019-02-04 Pádraig Brady
seq: output decimal points consistently with invalid locales
* src/seq.c (print_numbers): Only reset the locale if it
was successfully set originally.
* tests/misc/seq-locale.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the fix.
build: ensure sys/select.h is included
bootstrap.conf: Explicitly depend on select, rather than transitively.
* src/tail.c: Unconditionally include select.h as we use select()
outside inotify contexts now.
stat,tail: fix android build and support inotify
* src/extract-magic: Treat android like linux,
which fixes the build by ensuring the constants are defined.
* src/stat.c: Support all constants on android, including
the android specific "sdcardfs".
* src/tail.c: Fix inclusion of statfs headers to be independent
of inotify availability, as fremote() is used on linux even
if inotify has been disabled. Also enable fremote() on android.
* NEWS: Mention the improvment.
Fixes https://bugs.gnu.org/34239
2019-01-31 Pádraig Brady
tests: add test for locale decimal processing
* tests/misc/sleep.sh: Check locale processing of printf, sleep,
and timeout, when the french locale data is available.
2019-01-31 Pádraig Brady
build: fix recent build failure on systems without strtold
Recently introduced in commit v8.30-50-geb73e23
* gl/lib/cl-strtod.c: Fall back to strtod() on systems
without strtold() (like we already do in sort).
2019-01-28 Pádraig Brady
maint: fix new syntax-check failure from recent change
* cfg.mk: Exclude cl-strtold.c wrapper from requiring config.h
2019-01-27 Paul Eggert
printf,seq: remove c-strtod dependency
* gl/modules/cl-strtold (Files): Add lib/cl-strtod.c, lib/cl-strtod.h.
(Depends-on): Remove cl-strtod.
(configure.ac): Redquire AC_C_RESTRICT.
printf,seq: improve long double accuracy
This fixes a thinko in the previous patch.
* gl/lib/cl-strtod.c (STRTOD): New macro.
(CL_STRTOD): Use it.
printf,seq,sleep,tail,timeout: accept current-locale floats
These commands now accept floating-point numbers in the
current locale, as well as in the C locale.
Compatibility problem reported by Robert Elz.
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add cl-strtod, cl-strtold.
Remove c-strtold.
* doc/coreutils.texi (Floating point, tail invocation)
(printf invocation, timeout invocation, sleep invocation)
(seq invocation): Document this.
* gl/lib/cl-strtod.c, gl/lib/cl-strtod.h, gl/lib/cl-strtold.c:
* gl/modules/cl-strtod, gl/modules/cl-strtold: New files.
* src/printf.c, src/seq.c, src/sleep.c, src/tail.c, src/timeout.c:
Include cl-strtod.h instead of c-strtod.
* src/printf.c (vstrtold):
* src/seq.c (scan_arg, print_numbers):
* src/sleep.c (main):
* src/tail.c (parse_options):
* src/timeout.c (parse_duration):
Use cl_strtold instead of c_strtold.
2019-01-25 Paul Eggert
doc: update Goldberg URL
* doc/coreutils.texi (Floating point): Update URL.
sleep: improve doc
Problem reported by Robert Elz.
* doc/coreutils.texi (sleep invocation):
Say that arguments must be non-negative, which means they cannot
be arbitrary floating-point numbers. Mention POSIX, not
“historical implementations” that are no longer of practical
interest. List the extensions to POSIX.
* src/sleep.c (usage): Omit needless words, removing dubious
commentary about “most implementations” and incorrect commentary
about “arbitrary”. Details about exactly which numbers are
allowed can be found in the documentation.
2019-01-20 Pádraig Brady
tail: fix handling of broken pipes with SIGPIPE ignored
* init.cfg (trap_sigpipe_or_skip_): A new function refactored from...
* tests/misc/printf-surprise.sh: ...here.
* tests/misc/seq-epipe.sh. Likewise.
* src/tail.c (die_pipe): Ensure we exit upon sending SIGPIPE.
* tests/tail-2/pipe-f.sh: Ensure we exit even if SIGPIPE is ignored.
* NEWS: Mention the bug fix.
2019-01-20 Ayappan
tail: fix recent ineffective AIX change
* src/tail.c: Fix commit v8.30-40-gd5ab4cb which was ineffective.
Fixes http://bugs.gnu.org/33946
2019-01-20 Pádraig Brady
build: ensure VLAs are not used
Fail developer builds if VLAs are used,
as there are portability concerns to consider with them.
* configure.ac: Enable -Wvla which is implicit in the full list added.
* m4/jm-macros.m4: Define GNULIB_NO_VLA which disables use of
VLAs within gnulib code.
2019-01-20 Pádraig Brady
gnulib: update to the latest
* gnulib: Update to a version supporting GNULIB_NO_VLA
* bootstrap: Sync with latest
2019-01-16 Bernhard Voelker
build: use distributed man pages when running with --help fails
When building against an incompatible GLIBC version compared to that
on the build host, then running the just-built binary might fail
although it is the same platform - thus CROSS_COMPILING is false.
As a result, generating the man pages fails.
* man/local.mk (.x.1): Add a check to verify that running the utility
with --help succeeds, otherwise falling back to using 'dummy-man'.
2019-01-13 Pádraig Brady
ls: with --group-directories-first, also group symlinked dirs
* src/ls.c (is_linked_directory): A new function to
also consider symlinked directories.
(main): Rename check_symlink_color to check_symlink_mode,
and enable that with --group-directories-first.
(DIRFIRST_CHECK): Adjust to use is_linked_directory,
rather than just is_directory.
(gobble_file): Simplify to always update f->linkmode
if the stat() succeeds.
* tests/ls/group-dirs.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the change in behavior.
Suggested by Amin Bandali in
https://lists.gnu.org/r/coreutils/2018-12/msg00017.html
tail: don't exit immediately with filters on AIX
* src/tail.c: Fix the check_output_available check on AIX.
Note we don't use poll for all systems as the overhead
of adding the gnulib poll module wouldn't be worth it
just for this single use.
* tests/tail-2/pipe-f.sh: Fix the test which always passed
due to only the exit code of sleep being checked.
* NEWS: Mention the bug fix and rearrange alphabetically.
Fixes http://bugs.gnu.org/33946
2019-01-06 Assaf Gordon
basenc: allocate buffers on heap
Allocate the encoding/decoding buffers dynamically on the heap instead
of using variable-length-array (VLA) on the stack.
Discussed in https://lists.gnu.org/r/coreutils/2019-01/msg00004.html .
* src/basenc.c (do_encode,do_decode): Allocate inbuf/outbuf using
xmalloc, and free if using LINT.
2019-01-04 Pádraig Brady
doc: adjust URLs in help to avoid wrapping
* src/system.h: Adjust lines containing URLs so that
they don't wrap on 80 column terminals. One could also
use .UR macros, but these aren't universally available.
Note the adjustments here need to be compatible with
the pattern matching done in help2man.
Addresses https://bugs.gnu.org/33914
2019-01-01 Assaf Gordon
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.
2019-01-01 Bernhard Voelker
maint: mention base32 in the title line of common basenc.c
* src/basenc.c: Do the above, and remove a redundant comment.
2019-01-01 Assaf Gordon
base64,base32: fix 'extra operand' error message
In the following invocation, 'a' is the input file, and 'b' is the extra
operand:
$ base64 a b
Report 'b' in the error message instead of 'a':
$ base64 a b
base64: extra operand 'b'
Discussed in https://lists.gnu.org/r/coreutils/2018-12/msg00008.html .
* src/basenc.c (main): If there is more than one non-option operand,
report the second one (assuming the first is a the input file name).
* tests/misc/base64.pl: Add tests.
* tests/misc/basenc.pl: Adjust expectedc error message in tests.
* NEWS: Mention bugfix.
2018-12-31 Pádraig Brady
doc: mention that more than 8 colors are supported by ls
* src/dircolors.hin: Mention any codes supported by the terminal
are allowed.
Addresses https://bugs.gnu.org/33915
2018-12-28 Assaf Gordon
basenc: A new program complementary to base64/base32
Encodes/decodes data in various common formats:
base64,base64url,base32,base32,base16,base2,z85.
Discussed here:
https://lists.gnu.org/r/coreutils/2018-11/msg00014.html
https://lists.gnu.org/r/coreutils/2018-12/msg00019.html
* AUTHORS: Add basenc.
* README: Reference the new program.
* NEWS: Mention the new program.
* build-aux/gen-lists-of-programs.sh: Add basenc.
* doc/coreutils.texi: (basenc invocation): Document the new command.
* man/.gitignore: Ignore the generated man page.
* man/basenc.x: A new template, with few examples.
* man/local.mk: Reference the new man page.
* scripts/git-hooks/commit-msg: Allow basenc as program prefix.
* src/.gitignore: Ignore the new binary.
* src/basenc.c:
(usage): Mention new options.
(main): Handle new options.
(isbase*, base*_length, base*_encode, base*_decode_ctx): Implement new
encoding/decoding formats.
* src/local.mk: Add new program.
* tests/local.mk: Add new test.
* tests/misc/basenc.pl: New tests.
* tests/misc/help-version.sh (basenc_setup): use '--version' for default
invocation (basenc errors with no parameters).
2018-12-21 Assaf Gordon
maint: rename base64.c to basenc.c
In preparation for adding 'basenc' program.
Suggested in https://lists.gnu.org/r/coreutils/2018-11/msg00019.html .
* src/base64.c: Rename to src/basenc.c.
* src/local.mk: Update base*_SOURCES definitions.
* po/POTFILEs.in: Rename base64 to basenc.
2018-12-15 Paul Eggert
shred,sort,split: add NEWS item
shred,sort,split: fix ftruncate error reporting
Problem reported for split by Scott Worley (Bug#33761):
* src/shred.c (do_wipefd):
Also report an error if ftruncate fails on a shared memory object.
* src/sort.c (get_outstatus): New function.
(stream_open, avoid_trashing_input): Use it.
* src/sort.c (stream_open):
* src/split.c (create):
If ftruncate fails, do not report an error
unless it is a regular file or a shared memory object.
2018-11-07 Bernhard Voelker
sync: add NEWS and test for the fix in the previous commit
* NEWS (Bug fixes): Mention the fix in commit 94d364f157f0.
While at it, remove duplicate "Changes in behavior" heading.
* tests/misc/sync.sh: Add a test with a write-only file for the fix.
2018-11-06 Paul Eggert
sync: fix open fallback bug
Problem caught by Coverity Analysis
and reported by Kamil Dudka (Bug#33287).
* src/sync.c (sync_arg): Fix typo in fallback code.
2018-10-28 Paul Eggert
ln: use linkat and symlinkat
Open a target directory and use its file descriptor in linkat,
symlinkat, etc. syscalls, instead of constructing long file names
by concatenating the target directory name to a basename.
This avoids O(N²) behavior with ‘ln F1 F2 ... Fn DIR’ when DIR is
a long file name with many slashes. It also avoids some races if
DIR is renamed while ln is running.
* bootstrap.conf (gnulib_modules): Add openat-safer.
* src/ln.c: Include fcntl-safer.h.
(O_PATHSEARCH): New constant.
(errno_nonexisting, target_directory_operand): Remove; no longer used.
(atomic_link, do_link): New arg DESTDIR_FD. All uses changed.
(do_link): New arg DEST_BASE. All uses changed.
(main): Open target directory and use its file descriptor
as DESTDIR_FD.
build: update gnulib submodule to latest
* src/copy.c (copy_internal):
* src/cp.c (do_copy):
* src/ln.c (do_link):
Adjust to Gnulib API change.
2018-10-27 Bernhard Voelker
tests: provide 100% coverage for echo
* src/echo.c (usage): Assert that STATUS is always EXIT_SUCCESS.
* tests/misc/echo.sh: Add further tests for all hex and escape and
escape characters.
To get coverage statistics, run:
make coverage -j 4 TESTS=tests/misc/echo.sh SUBDIRS=.
xdg-open doc/coverage/src/echo.c.gcov.frameset.html
2018-10-27 Pádraig Brady
echo: always process escapes when POSIXLY_CORRECT is set
* src/echo.c (main): Always enable backslash processing if
POSIXLY_CORRECT is set.
* tests/misc/echo.sh: Add (the first) test for the echo command.
* tests/local.mk: Reference the new test.
* tests/misc/printf.sh: Update a stale comment.
* doc/coreutils.texi (echo invocation). Mention that POSIXLY_CORRECT
now always enables backslash processing.
* NEWS: Mention the change in behavior.
Fixes https://bugs.gnu.org/32703
Issue identified by Eric Blake.
2018-10-26 Bernhard Voelker
test: add -N unary operator
Bash knows 'test -N FILE'. Add it to GNU 'test' as well.
* src/test.c (unary_operator): Add a case for 'N'.
(usage): Document it.
* doc/coreutils.texi (node File characteristic tests): Likewise.
* NEWS (New features): Likewise.
* tests/misc/test-N.sh: Add a test.
* tests/local.mk (all_tests): Reference it.
2018-10-26 Bernhard Voelker
test: simplify redundant code
Remove the function 'test_unop', as the cases therein are redundant to
those handled by 'unary_operator'; exception: the cases 'o' and 'N':
they had been present in test_unop and handling the commands
test -N STR
test -o STR
and
test x = x -a -N STR
test x = x -a -o STR
which ran into an error later on anyway.
With this commit, the error diagnostic will change from ...
$ /usr/bin/test -N STR
/usr/bin/test: extra argument '-N'
$ /usr/bin/test -o STR
/usr/bin/test: extra argument '-o'
... to ...
$ src/test -N STR
src/test: '-N': unary operator expected
$ src/test -o STR
src/test: '-o': unary operator expected
* src/test.c (test_unop): Remove.
(unary_operator): Fail with test_syntax_error in the default case.
(term): Directly call unary_operator.
(two_arguments): Likewise.
* tests/misc/test-diag.pl: Adjust error diagnostic.
2018-10-26 Bernhard Voelker
test: remove support for the ambigous -a unary operator
* src/test.c (unary_operator): Remove case 'a'.
(test_unop): Likewise.
* NEWS (Changes in behavior): Document the change.
Discussed at https://bugs.gnu.org/33097
2018-10-21 Bernhard Voelker
test: avoid FP in chroot-credentials.sh for different group list order
On my openSUSE:Tumbleweed system, I get a false positive test failure
in the above 'check-root' test because the group lists inside and
outside the chroot have a different order:
++ chroot --userspec=berny / id -G
++ id -G berny
+ test '100 454 457 480 492' = '100 480 492 457 454'
+ fail=1
* tests/misc/chroot-credentials.sh (num_sort): Add function to sort
group lists, and use it in the test cases which test multiple groups.
2018-10-20 Paul Eggert
doc: tidy up setuid commentary
* doc/perm.texi (Mode Structure): Improve wording.
(Numeric Modes): Don’t say “on execution” (Bug#9594).
2018-10-19 Paul Eggert
ln: avoid directory hard-link races
Previously, 'ln A B' did 'stat("B"), lstat("A"), link("A","B")'
where the stat and lstat were necessary to avoid hard-linking
directories on systems that can hard-link directories.
Now, in situations that prohibit hard links to directories,
'ln A B' merely does 'link("A","B")'. The new behavior
avoids some races and should be more efficient.
This patch was inspired by Bug#10020, which was about 'ln'.
* bootstrap.conf (gnulib_modules): Add unlinkdir.
* src/force-link.c (force_linkat, force_symlinkat): New arg for
error number of previous try. Return error number, 0, or -1 if
error, success, or success after removal. All callers changed.
* src/ln.c: Include priv-set.h, unlinkdir.h.
(beware_hard_dir_link): New static var.
(errnoize, atomic_link): New functions.
(target_directory_operand): Use errnoize for simplicity.
(do_link): New arg for error number of previous try. All callers
changed. Do each link atomically if possible.
(main): Do -r check earlier. Remove linkdir privileges so we can
use a single linkat/symlinkat instead of a racy substitute for the
common case of 'ln A B' and 'ln -s A B'. Set beware_hard_dir_link
to disable this optimization.
cp: 'cp -il A B' no longer fails if user OKs it
* NEWS: Mention the change.
* src/copy.c (copy_internal): Replace the link if the
user has okayed it.
build: update gnulib submodule to latest
* gl/modules/tempname.diff: Update to match Gnulib.
2018-10-17 Paul Eggert
doc: add chmod examples
Discussed in https://bugs.gnu.org/11043 .
* doc/coreutils.texi (chmod invocation): Add examples.
2018-10-02 Bjarni Ingi Gislason
doc: fix minor mistakes in "env.x"
* man/env.x (OPTIONS): Fix a spelling mistake. Protect a period at the
beginning of a line.
2018-09-30 Achilles Gaikwad
id: support multiple specified users
$ id root nobody
uid=0(root) gid=0(root) groups=0(root)
uid=99(nobody) gid=99(nobody) groups=99(nobody)
* src/id.c (main): Make variables opt_zero, just_group_list,
just_group, use_real, just_user global to be used in a new
function.
(print_stuff): New function that will print user and group
information for the specified USER.
When using -G option delimit each record with two NULs.
Restructure the code in the file to have global variables
followed by functions.
* tests/id/zero.sh: Add test cases to check the usage
of -z option with multiple users.
* tests/id/uid.sh: Add a test case to ensure all users
are queried in the presence of errors.
* doc/coreutils.texi: Document the interface changes.
* NEWS: Mention the new feature.
2018-09-25 Stéphane Campinas
doc: csplit: clarify handling of regexps with negative offsets
* doc/coreutils.texi (csplit invocation): Detail the behavior
with regexp patterns and negative offsets, which differs from
line number patterns, to avoid looping on the input. For example:
$ seq 50 | csplit -s - /15/-5 /12/
csplit: ‘/12/’: match not found
2018-09-24 Pádraig Brady
doc: csplit: clarify input may not be reproducible from output
* doc/coreutils.texi (csplit invocation): Clarify that
portions of the input may be skipped and thus the input
may not be reproducible by just concatenating the output files.
Fixes https://bugs.gnu.org/32317
2018-07-27 Paul Eggert
df: omit redundant comparison
Trivial inefficiency reported by Bruno Haible in:
http://lists.gnu.org/r/bug-gnulib/2018-07/msg00109.html
* src/df.c (hide_problematic_chars): Omit redundant test.
df: tune slightly
* src/df.c (get_header, get_dev):
Avoid calling mbswidth twice when once will do.
df: avoid multibyte character corruption on macOS
This improves on the earlier fix for the problem reported by
Chih-Hsuan Yen (Bug#32236), by also looking for other control
characters and for encoding errors.
* src/df.c: Include wchar.h and wctype.h instead of c-ctype.h.
(hide_problematic_chars): Process the string as multibyte.
Use iswcntrl, not c_iscntrl.
2018-07-26 Chih-Hsuan Yen
df: avoid multibyte character corruption on macOS
* src/df.c (hide_problematic_chars): Use c_iscntrl() as
passing 8 bit characters to iscntrl() is not supported on macOS.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/32236
2018-07-22 Wodry (tiny change)
doc: improve documentation of binary prefixes
* doc/coreutils.texi (Common options):
* src/dd.c, src/head.c, src/od.c, src/stdbuf.c, src/tail.c (usage):
* src/system.h (emit_size_note):
Mention binary prefixes (Bug#32242).
2018-07-21 Pádraig Brady
tests: avoid false failure on sparc 32 bit
* tests/rm/rm-readdir-fail.sh: Skip the test entirely on 32 bit,
so we avoid conflating the 32bit and 64 bit types, as that
triggers alignment issues (SIGBUS) on Gentoo sparc.
Fixes https://bugs.gnu.org/29886
2018-07-05 Paul Eggert
build: update gnulib submodule to latest
* bootstrap.conf, src/copy.c, src/mv.c, src/shred.c:
Adjust to renaming of renameat2 to renameatu.
2018-07-05 Pádraig Brady
tests: fix skipping in some tests
* tests/cp/cp-a-selinux.sh: Use 'skip_' rather than the probably
undefined 'skip'.
* tests/du/2g.sh: Likewise.
* tests/install/install-Z-selinux.sh: Likewise.
* tests/misc/chcon.sh: Likewise.
* tests/misc/selinux.sh: Likewise.
* tests/mkdir/restorecon.sh: Likewise.
* cfg.mk (sc_prohibit-skip): A new syntax check to catch the issue.
2018-07-02 Jim Meyering
maint: init.cfg: fix a minor test-related quoting bug
* init.cfg (require_membership_in_two_groups_): This fixes a bug
introduced by me in v8.15-8-gdd0e4c562. Luckily, the consequence
of low-probability triggering the bug was the mere added backslash
in the diagnostic: "...but running id -G\ either...". It would be
triggered in a test failure for one who is a member of only one or
fewer groups.
2018-07-02 Pádraig Brady
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
version 8.30
* NEWS: Record release date.
2018-07-01 Pádraig Brady
tests: standardize perl usage in tests
* tests/cp/fiemap-FMR.sh: Ensure perl is parameterized to $PERL,
and ensure require_perl_ is used, so tests are skipped appropriately.
* tests/cp/preserve-gid.sh: Likewise.
* tests/du/long-from-unreadable.sh: Likewise.
* tests/misc/env-S-script.sh: Likewise.
* tests/misc/sort-benchmark-random.sh: Likewise.
* tests/rm/deep-2.sh: Likewise.
maint: copy: avoid new static analyzer warnings
* src/copy.c (copy_internal): Use the lint protected src_mode,
rather than accessing the src_sb again. Also unconditionally
populate src_sb when !x->move_mode and in lint mode.
Reported by Kamil Dudka with coverity and clang analyzer.
maint: fix recent stale comments and spelling mistakes
* doc/coreutils.texi: s/seperator/separator/.
* tests/misc/env-S.pl: Likewise.
* src/env.c: Fix stale comment.
2018-06-27 Pádraig Brady
maint: disable overly agressive sc_gitignore_redundant
* cfg.mk (sc_gitignore_redundant): Disabled for now as too
aggressive flagging entries like /lib/arg-nonnull.h in
a newly checked out repo.
env: adjust diagnostics provided for shebang usage
* src/env.c (main): Don't process '-' specially since
that causes an issue on the openbsd getopt implementation
where a lone '-' is now processed as an option, and anyway
it doesn't particuarly help diagnosing common shebang
usage issues. Also don't restrict the extra diagnostics
for shebang usage to the case with 3 arguments, as
further arguments can be passed to a script.
* tests/misc/env-S.pl: Adjust accordingly.
2018-06-27 Assaf Gordon
tests: accept getopt errors without single-quotes
On OpenBSD 6.2, invalid single options produce error messages
without single quotes:
$ ./src/chroot -/
chroot: unknown option -- /
As opposed to other systems:
./src/chroot: invalid option -- '/'
Modify the grep search to accept this.
* tests/misc/usage_vs_getopt.sh (checkprg): Change the grep pattern
to accomodate no-single-quotes cases.
2018-06-27 Pádraig Brady
tests: fix false failures when perl not available
* tests/local.mk: Reference the stub that skips perl tests,
with the correct path.
tests: fix false failure with limited shebang lines
* tests/misc/env-S-script.sh: Provide a wrapper to
emulate shebang processing, but without length limits,
which are 127 on Linux for example.
maint: update gnulib to latest
* gnulib: Update to latest, which incorporates
a thread linking fix from Bruno Haible,
which was seen on newer Ubuntu systems.
2018-06-27 Assaf Gordon
tests: remove unused Data::Dumper perl module
The module is not needed anymore (was used during development).
Despite being a Perl core module, platforms like CentOS don't install
it by default. Reported by Bruno Haible at
https://lists.gnu.org/r/coreutils/2018-06/msg00093.html.
* tests/misc/csplit-suppress-matched.pl: Remove Data::Dumper.
2018-06-25 Carlos Santos
maint: fix -Werror=suggest-attribute=malloc in expr.c
Add attribute 'malloc' to mpz_get_str to prevent
the following on GCC 8.1.1
src/expr.c:117:1: error: function might be candidate for attribute
'malloc' if it is known to return normally
[-Werror=suggest-attribute=malloc]
mpz_get_str (char const *str, int base, mpz_t z)
^~~~~~~~~~~
cc1: all warnings being treated as errors
* src/expr.c (mpz_get_str): Add _GL_ATTRIBUTE_MALLOC.
2018-06-25 Pádraig Brady
maint: update gnulib to latest
* gnulib: Update to latest.
* .gitignore: Add new entries.
* bootstrap.conf: Enable wchar-single, which will enable more
efficient replacements of wcwidth and mbrtowc, as we indicate
that the charset will no change between invocations of these functions.
maint: sync longlong.h from gmp repo
* src/longlong.h: Sync changes. No functional change.
maint: avoid false positive in src/fs-magic-compare
* src/local.mk (fs_normalize_perl_subst): `make src/fs-magic-compare`
was reporting incorrectly that AFS was not being handled.
Add a mapping to our KAFS identifier.
* .gitignore: Add intermediate files from `make src/fs-magic-compare`
2018-06-23 Bernhard Voelker
tests: initialize fail=0 to avoid "unary operator expected" errors
With an uninitialized variable 'fail', the unquoted use like
test $fail = 1
lead to the shell error
"unary operator expected".
The uninitialized 'fail' variable was a side effect of
https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=e91c0d4f9
which was pulled into coreutils-v8.26 with
https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=ef9650170
Coreutils test code relied and relies on 'fail' to be initialized,
so initialize that variable here.
* tests/local.mk (TESTS_ENVIRONMENT): Initialize fail=0.
2018-06-21 Jim Meyering
maint: do not depend directly on gnulib's now-unused ftello module
* bootstrap.conf (gnulib_modules): Remove ftello, since it is
no longer used directly, since v8.9-11-geab97b307.
2018-06-21 Pádraig Brady
tests: provide an option to relax the need for gdb
* tests/rm/r-root.sh: gdb provides extra protection,
but is not strictly necessary. So provide an option
for maintainers to relax the requirements.
rm: add --preserve-root=all to protect mounts
* src/remove.c (rm_fts): With the --preserve-root=all extension,
reject command line arguments that are mount points.
* src/remove.h (rm_options): Add preserve_all_root to store config.
* src/mv.c (rm_option_init): Init preserve_all_root to false.
* src/rm.c (main): Init preserve_all_root as per option.
(usage): Describe the new option.
* src/remove.c (rm_fts): Lookup the parent device id,
and reject the cli argument if a separate file system.
* tests/rm/one-file-system.sh: Add a test case.
* NEWS: Mention the new feature.
2018-06-21 Adam Borowski
cp: add --reflink=never to force standard copy mode
This mode is currently the default, but most if not all users of
reflink-capable filesystems want --reflink=auto, which is often
encapsulated into an alias. Adding --reflink=never allows overriding
such an alias.
* doc/coreutils.texi (cp invocation): Describe the new option.
* src/cp.c: Support --reflink=never.
* tests/cp/reflink-auto.sh: Add a test case.
* NEWS: Mention the new feature.
2018-06-21 Assaf Gordon
env: add -S/--split-string option
Adopted from FreeBSD's env(1), useful for specifing multiple
parameters on a shebang (#!) script line, e.g:
#!/usr/bin/env -S perl -w -T
Discussed in https://lists.gnu.org/r/coreutils/2018-04/msg00011.html
* src/env.c (valid_escape_sequence,escape_char,scan_varname,
extract_varname,validate_split_str,build_argv,
parse_split_string): New functions.
(main): Process new option and call parse_split_string.
(usage): Mention new option.
* tests/misc/env-S.pl: Test new option from the command line.
* tests/misc/env-S-script.sh: Test new option from shebang scripts.
* tests/local.mk (all_tests): Add new tests.
* man/env.x (OPTIONS): Show a brief example of -S usage and point to
the full documentation for more information.
* doc/coreutils.texi (env invocation): Detail usage of -S/--split-string
option.
* NEWS: Mention new option.
2018-06-21 Assaf Gordon
env: add -v/--debug option
Prints verbose information about each step:
$ env -v -uFOO -C /tmp BAR=BAZ date -u
env: unset: FOO
env: setenv: BAR=BAZ
env: chdir: '/tmp'
env: executing: date
env: arg[0]= ‘date’
env: arg[1]= ‘-u’
Sun Apr 22 08:52:30 UTC 2018
Inspired by FreeBSD's env(1).
* src/env.c (usage): Mention new option.
(main): Print debug information if requested.
* NEWS: Mention new option.
* doc/coreutils.texi (env invocation): Mention -v/--debug.
2018-06-21 Assaf Gordon
maint: refactor unsetenv call in env
Keep unset envvars (-uFOO) in an array for later deletion,
instead of reiterating over argv. Done in preparation for
'-S string' feature. Related to '-u' discussion in
https://lists.gnu.org/r/coreutils/2018-04/msg00013.html
* src/env.c (append_unset_var,unset_envvars): New functions.
(main): Use new functions.
2018-06-21 Kaxandra Labat
ls: ignore case when coloring file extensions
* src/ls.c (get_color_indicator): s/STREQ_LEN/c_strncasecmp/
* src/dircolors.hin: Remove a now redundant entry.
* tests/ls/color-ext.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the change in behavior.
2018-06-21 Pádraig Brady
md5sum,b2sum,sha*sum: support -z,--zero option
* doc/coreutils.texi (md5sum invocation): Describe the new option,
and how it's not supported by --check, and how it disables escaping.
* src/md5sum.c (delim): A new global to parmeterize the out delimiter.
(main): Don't enable file name escaping with -z, and output '\0'.
* tests/misc/md5sum-newline.pl: Add a test case.
* NEWS: Mention the new feature.
2018-06-21 Pádraig Brady
wc: optimize processing of ASCII in multi byte locales
===== Benchmark setup (on GNU/Linux) ====
$ yes áááááááááááááááááááá | head -n100000 > mbc.txt
$ yes 12345678901234567890 | head -n100000 > num.txt
===== Before ====
$ time src/wc -Lm < mbc.txt
real 0m0.186s
$ time src/wc -m < mbc.txt
real 0m0.186s
$ time src/wc -Lm < num.txt
real 0m0.055s
$ time src/wc -m < num.txt
real 0m0.056s
==== After ====
$ time src/wc -Lm < mbc.txt
real 0m0.196s
$ time src/wc -m < mbc.txt
real 0m0.173s
$ time src/wc -Lm < num.txt
real 0m0.031s
$ time src/wc -m < num.txt
real 0m0.028s
* src/wc.c (wc): Only call wide variant functions like
iswprint() and wcwidth() for non is_basic() characters.
I.E. non ISO C "basic character set" characters.
This is especially significant on OSX where wcwidth()
is very expensive (about 10x in tests).
* NEWS: Mention the improvement.
Suggested by Eric Fischer.
2018-06-14 Paul Eggert
doc: port test.1 to doclifter
* man/test.x: Use \& instead of quoting (Bug#31803).
doc: port man pages to doclifter
Problem reported by Eric S. Raymond (Bug#31803).
* man/test.x: Add SYNOPSIS section, since help2man
understandably gets confused by the square brackets.
* src/ln.c (usage): Omit parenthetical "(Nth form)" in usage,
as it confuses doclifter.
2018-06-04 Pádraig Brady
cp: preserve existing permissions with --no-preserve=mode
This issue was introduced in commit v8.19-145-g24ebca6
* src/copy.c (copy_internal): With --no-preserve=mode,
only reset permissions for newly created files.
(copy_reg): Likewise.
* NEWS: Mention the fix.
* tests/cp/preserve-mode.sh: Add a test case.
Fixes https://bugs.gnu.org/31675
2018-05-29 Pádraig Brady
tests: fix periodic false failure in month alignment
* tests/ls/abmon-align.sh: Base relative month adjustment
from the middle of the month, to avoid failures due
to months being repeated.
Fixes https://bugs.gnu.org/31644
2018-05-26 Bjarni Ingi Gislason
doc: formatting fixes in "du.x" and "rm.x"
Avoid warnings from: groff -b -e -mandoc -T utf8 -rF0 -t -w w -z
* man/du.x: Change ".BR" to ".B" if there is only one argument.
Protect an end-of-sentence indicator (.?!) with '\&'
if it does not mean an end of a sentence.
Change '--' to '\-\-' if it indicates an option.
* man/rm.x: Change '\=' to '='.
2018-05-18 Pádraig Brady
cp: with --force; replace self referential symlinks
* src/copy.c (copy_internal): Don't fail immediately upon
getting ELOOP when running stat() on the destination,
rather proceeding if -f specified, allowing the link
to be removed. If the loop is not in the final component
of the destination path, we still fail but at the
subsequent unlink() stage.
* doc/coreutils.texi (cp invocation): Adjust wording to say
that --force doesn't work with dangling links, rather than
all links that can't be traversed.
* tests/cp/thru-dangling.sh: Add a test case.
* NEWS: Mention the change in behavior.
Discussed in https://bugs.gnu.org/31335
2018-05-15 Pádraig Brady
cp: fix symlink checks when overwriting files
Ensure this _does_ recreate the symlink
Given "path1" and "path2" are on different devices.
$ touch "path1/file"
$ cd path2/; ln -s path1/file
$ cp -dsf path1/file .
Ensure this does _not_ overwrite file
$ touch file
$ ln -s file l1
$ cp -sf l1 file
* src/copy.c (same_file_ok): Remove device ids from consideration,
instead deferring to future EXDEV with --link or allowing
the first case above to work.
Also ensure that we do not exist this function too early,
when the destination file is not a symlink, which protects
against the second case.
* tests/cp/cross-dev-symlink.sh: Add a test for the first case.
* tests/cp/same-file.sh: Add a test for the second case above.
* NEWS: Mention the bug fixes.
* THANKS.in: Mention the reporters who also analyzed the code.
Fixes https://bugs.gnu.org/31364
2018-05-15 Pádraig Brady
cp: ensure --remove-destination doesn't traverse symlinks
* src/cp.c (target_directory_operand): Allow through inaccessible
arguments with -f or --remove.
* doc/coreutils.texi (cp invocation): Clarify that -f doesn't directly
impact the removal of non-traversable symlinks.
* tests/cp/dir-rm-dest.sh: Test the new behavior.
* tests/cp/thru-dangling.sh: Enforce -f behavior wrt symlinks.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/31335
maint: make chmod/chgrp/chown leak free under valgrind
* src/chmod.c: Deallocate the mode change array in dev mode.
* src/chown.c: Make chopt_free() actually deallocate, but
only call in dev mode.
* src/chgrp.c: Likewise.
doc: improve formatting of nl --help
* src/nl.c (usage): Better delineate the information.
2018-05-14 Paul Eggert
who: simplify port to GCC 8
* src/who.c (make_id_equals_comment): Use simpler workaround
for GCC bug 85602. Suggested by Martin Sebor in:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85602#c3
2018-05-04 Pádraig Brady
build: make GCC 8 adjustments more portable
* src/chown-core.h (chopt_free): Just define away this noop.
* src/chown-core.c (chopt_free): Remove the empty implementation.
2018-05-04 Paul Eggert
build: update gnulib submodule to latest
2018-05-03 Paul Eggert
maint: port to GCC 8
* src/chown-core.h (chopt_free, gid_to_name, uid_to_name):
No longer const.
* src/make-prime-list.c (xalloc): Add malloc attribute.
* src/who.c (make_id_equals_comment): Work around GCC bug 85602
by using mempcpy rather than strncat. Although the old code
was correct, strncat raises so many hackles that it’s not
worth maintaining its use here.
maint: remove strpbrk module
* bootstrap.conf (gnulib_modules): Remove obsolete module strpbrk.
build: update gnulib submodule to latest
2018-04-21 Pádraig Brady
doc: retroactively adjust info about tail and closed output
* NEWS: Expand on the 8.28 description of how tail more
responsively reacts to closed output, and move from "Improvements"
to "Changed behavior".
* cfg.mk (old_NEWS_hash): Regenerate.
Fixes https://bugs.gnu.org/31225
2018-04-19 Pádraig Brady
doc: timeout --help: mention 0 DURATION disables timeout
* src/timeout.c (usage): Mention that a duration of 0 disables
the associated timeout, which is both concise info and useful
functionality as timeouts are frequently configured.
2018-04-06 Eric Blake
doc: retroactively document -e/-u addition in NEWS
Prompted by https://bugs.gnu.org/31045
* NEWS: Update 8.8 blurb to mention other split additions.
* cfg.mk (old_NEWS_hash): Regenerate.
2018-04-03 Paul Eggert
doc: Clarify octal bits in permissions
* doc/perm.texi (Numeric Modes): Briefly explain octal.
Reorder description to make it more intuitive (Bug#29069).
2018-03-28 Tobias Stoeckmann
cut: improve large file support on 32 bit
Increase max range from SIZE_MAX to UINTMAX_MAX, which will
allow cut to support line lengths up to the max file size
on all systems. The inherent SIZE_MAX limitation in cut was
removed with the enhancements in https://bugs.gnu.org/13127.
Also numfmt gets similarly increased --field ranges due to
shared code.
* src/cut.c: s/size_t/uintmax_t/.
* src/numfmt.c: Likewise.
* src/set-fields.c: Likewise.
* src/set-fields.h: Likewise.
* tests/misc/cut-huge-range.sh: Adjust accordingly.
* tests/misc/numfmt.pl: Likewise.
* NEWS: Mention the improvement.
2018-03-28 Pádraig Brady
tests: avoid a recent syntax-check failure
* tests/ls/a-option.sh: s/framework_failure/&_/.
2018-03-27 Paul Eggert
ls: -A now overrides -a
Problem reported by Karl Berry (Bug#30963).
* NEWS: Mention this.
* src/ls.c (decode_switches): Implement this.
* tests/ls/a-option.sh: New file.
* tests/local.mk (all_tests): Add it.
2018-03-24 Roland Hieber
doc: fix two typos in github templates
* .github/ISSUE_TEMPLATE.txt: Fix typo "coreitils" in the URL to the bug
tracker.
* .github/PULL_REQUEST_TEMPLATE.txt: Likewise.
2018-03-16 Pádraig Brady
ls: increase the allowed abmon width from 5 to 12
This will impact relatively few languages,
and will make Arabic or Catalan etc.
output unambiguous abbreviated month names.
* src/ls.c (MAX_MON_WIDTH): Increase from 5 to 12.
* NEWS: Mention the bug fix.
* tests/ls/abmon-align.sh: Augment to check for ambiguous output.
Fixes https://bugs.gnu.org/30814
2018-03-14 Brent Petit
stat,tail: add support for the EXFS file system
Enhanced XFS (EXFS) is a version of XFS maintained by HPE.
EXFS uses a unique magic number to allow the use of community
XFS, and EXFS filesystems at the same time.
* src/stat.c (human_fstype): Add file system ID definition,
and use "exfs" as the name.
* NEWS: Mention the Improvement.
2018-03-06 Paul Eggert
build: update gnulib submodule to latest
2018-03-05 Paul Eggert
stat: work around IBM xlC bug
Problem reported by John Wiersba (Bug#30718)
* src/stat.c (human_time): Avoid giving an integer constant
expression a name, as it runs afoul of a bug in IBM XL C/C++ for
AIX 12.01.0000.0002.
2018-03-04 Bernhard Voelker
maint: adjust email address of Keith Thompson in THANKS.in
* THANKS.in (Keith Thompson): Update email address as requested by
himself at https://lists.gnu.org/r/coreutils/2018-03/msg00004.html
2018-02-25 Pádraig Brady
cp: set appropriate default permissions for special files
This issue was introduced in commit v8.19-145-g24ebca6
* src/copy.c (copy_internal): When setting default permissions
to use with --no-preserve=mode, only set executable bits for
directories or sockets.
* NEWS: Mention the fix.
* tests/cp/preserve-mode.sh: Add a test case.
Fixes https://bugs.gnu.org/30534
2018-01-21 Pádraig Brady
doc: use consistent example format in manual
* doc/coreutils.texi: Use @example consistently
as we don't need the smaller or fixed width representation.
This is especially true for the synopsis of commands.
@smallexample is rendered left aligned for HTML
which is awkward to read with the center aligned main content.
2018-01-10 Paul Eggert
mv: clarify ‘mv -n A A’ change
mv: fewer syscalls for ‘mv a b’
This builds on a previous patch for mv atomicity (Bug#29961).
It merely improves performance; it does not fix bugs.
* src/copy.h (struct cp_options): New members last_file, rename_errno.
* src/copy.c (copy_internal): Support new rename_errno member
for the copy options. Avoid calling stat when new members
suggest it’s not needed.
(cp_options_default): Initialize new members.
* src/mv.c: Include renameat2.h.
(main): With two arguments, first call ‘renamat2 (AT_FDCWD, "a",
AT_FDCWD, "b", RENAME_NOREPLACE)’. Use its results to skip
remaining processing if possible; for example, if it succeeds
there is no need to stat either "a" or "b". Also, set
x.last_file when it is the last file to rename.
mv: improve -n atomicity
Problem reported by Kamil Dudka (Bug#29961).
* NEWS: Mention this.
* src/copy.c: Include renameat2.h.
(copy_internal): If mv, try renameat2 first thing, with
RENAME_NOREPLACE. If this works, skip most of the remaining code.
Also, fail quickly if it fails with EEXIST, and we are using -n.
2018-01-10 Michael Orlitzky
doc: warn about following symlinks recursively in chown/chgrp
In both chown and chgrp (which shares its code with chown), operating
on symlinks recursively has a window of vulnerability where the
destination user or group can change the target of the operation.
Warn about combining the --dereference, --recursive, and -L flags.
* doc/coreutils.texi (warnOptDerefWithRec): Add macro.
(node chown invocation): Add it to --dereference and -L.
(node chgrp invocation): Likewise.
See also: CVE-2017-18018
2018-01-06 Paul Eggert
cp: remove ASSIGN_BASENAME_STRDUPA
* src/cp.c (do_copy): Just use ASSIGN_STRDUPA, as this simplifies
the code and uses less memory.
2018-01-04 Paul Eggert
mv: -n overrides -u
* NEWS: Mention these fixes.
* doc/coreutils.texi (cp invocation, mv invocation):
Mention that -n is silent, and that it overrides -u.
* src/cp.c, src/mv.c (main): -n overrides -u.
2018-01-03 Paul Eggert
tr: add -A, for compatibility with AIX tr
Problem reported by Michael (Bug#29946).
* src/tr.c (main): Add undocumented -A option.
2018-01-03 Michael Orlitzky
doc: clarify chown/chgrp --dereference defaults
* doc/coreutils.texi: the documentation for the --dereference
flag of chown/chgrp states that it is the default mode of
operation. Document that this is only the case when operating
non-recursively.
2018-01-02 Pádraig Brady
tests: avoid false failure with xargs on AIX
* tests/misc/shred-remove.sh: AIX xargs defaults to using
'_' to indicate end of input, thus ignoring it.
Rather than specifying -E to avoid this behavior, simplify
by removing sed and xargs usage.
2018-01-01 Pádraig Brady
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.
2017-12-27 Pádraig Brady
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
version 8.29
* NEWS: Record release date.
2017-12-23 Pádraig Brady
tests: avoid false failure on AIX 7.2
* tests/tail-2/pipe-f.sh: Close stdout in a subshell
to ensure the current shell isn't impacted. Subsequent
piped commands like `echo foo | blah` were seen to fail
due to the previous closing of stdout.
Reported by Assaf Gordon.
doc: describe recent build checks for 32 bit time_t
* README: Document the new handling of 32 bit time_t,
with examples of how to build in 64 bit mode on AIX.
Also mention that GNU make is desired on AIX
due to its mishandling of the "[" target.
Suggested by Assaf Gordon.
2017-12-21 Pádraig Brady
tests: fix recent portability issues on solaris 10
* tests/misc/ptx.pl: Escape the '^' character which is
otherwise considered as a line continuation character.
* tests/misc/shred-remove.sh: sed doesn't support \n.
maint: remove reference to excluded changelog item
* build-aux/git-log-fix: Remove old entry.
2017-12-20 Pádraig Brady
maint: add doc/coverage to .gitignore
* .gitignore: Ignore the generated coverage report.
doc: remove older ChangeLog items
* Makefile.am: Update the oldest documented version
to 8.20 which is now about 5 years old.
2017-12-18 Bernhard Voelker
doc: mention which privileges are needed to chmod
POSIX specification for chmod(1):
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/chmod.html
* doc/coreutils.texi (chmod invocation): Add a sentence about who can
change the file mode bits of a file - (almost) a copy from what POSIX
requires.
Fixes https://bugs.gnu.org/29207.
2017-12-16 Pádraig Brady
tests: fix recent regressions with dash
* tests/misc/timeout.sh: dash outputs the "Killed"
message to stderr rather than the terminal.
* tests/misc/usage_vs_getopt.sh: dash doesn't yet
support the POSIX proposed $'...' shell quoting syntax.
build: avoid a signed overflow warning in ptx
* src/ptx.c (fix_output_parameters): GCC 6.3.1 with
./configure --enable-single-binary would give:
error: assuming signed overflow does not occur
when simplifying conditional to constant [-Werror=strict-overflow]
if (file_index > 0)
So change the type of file_index to signed (size_t).
2017-12-11 Bernhard Voelker
maint: adjust for the renamed nstrfime gnulib module
* bootstrap.conf: s/strftime/nstrfrime/.
2017-12-11 Pádraig Brady
build: update gnulib submodule to latest
* gnulib: Update with various build/test fixes.
tests: fix false failure in new dd/nocache_eof test
* test/dd/nocache_eof.sh: Also handle fadvise64_64 which is
used on 32 bit x86. Note strace internally maps fadvise64_64
to {arm,xtensa}_fadvise64_64.
tail: fix tailing non seekable files on certain systems
* src/tail.c (tail_bytes): On systems were blksize_t is unsigned
and the same size or wider than off_t (android for example),
our initialized (off_t) -1 would be promoted to unsigned before
comparison, and thus fail to follow the appropriate path.
* tests/tail-2/tail-c.sh: Add a test case.
* NEWS: Mention the fix.
This issue was introduced in commit v8.23-47-g2662702
Reported at https://github.com/termux/termux-app/issues/233
build: avoid build failure without sys/mtio.h
* m4/jm-macros.m4: Check for the header.
* src/dd.c: Avoid the workaround where the header
is not available (on non glibc systems).
* src/shred.c: Likewise.
doc: reorganize ls -k and --time-style help
* src/ls.c (usage): Clarify -k only applies to -s usage
and directory 'total' lines. Move the description
of TIME_STYLE out of the option section as it was awkward
to read and write there within 80 columns.
2017-12-10 Pádraig Brady
doc: clarify numeric setuid handling in chmod man page
* man/chmod.x: Update the information to state one can
clear the setuid and setgid bits for directories numerically
using an additional leading '0' or a leading '='.
That has been supported since v8.15-64-g8931cdb.
Fixes https://bugs.gnu.org/29390
doc: shred: change 'truncate' to the more descriptive 'deallocate'
* doc/coreutils.texi (shred invocation): s/truncate/deallocate/.
* src/shred.c (usage): Likewise.
Fixes https://bugs.gnu.org/29317
doc: clarify that cp --force may recreate files
* doc/coreutils.texi (cp invocation): The language used
to describe recreating the file was a little confusing
as it mentioned opening a removed file.
Fixes https://bugs.gnu.org/29315
2017-12-04 Kamil Dudka
doc: fix default QUOTING_STYLE for %N format of stat(1)
* doc/coreutils.texi (stat invocation): The default value
of QUOTING_STYLE for the %N format of 'stat --printf' is
'shell-escape-always'.
Fixes https://bugs.gnu.org/29563
Reported by Christian Groessler at
https://bugzilla.redhat.com/1520399#c3
2017-12-02 Jean Delvare
tests: make ls/block-size more readable
* tests/ls/block-size.sh: The output of the test was hard to read. Add
comments saying what we are testing to make it easier to understand.
2017-11-29 Bernhard Voelker
Pádraig Brady
tests: verify usage vs. getopt
Verify that all options mentioned in usage are actually recognized
by the program.
* tests/misc/usage_vs_getopt.sh: Add test.
* tests/local.mk (all_tests): Reference it.
2017-11-29 Pádraig Brady
readlink: remove superfluous comma from usage output
* src/readlink.c (usage): Remove ',' after --quiet option.
2017-11-29 Bernhard Voelker
all: use consistent diagnostics for unknown long options
Previously, e.g. cksum failed to output the offending unknown long
option:
$ cksum --unknown-opt
cksum: invalid option -- '-'
Try 'cksum --help' for more information.
i.e., it tried to diagnose '-' as short option.
Instead, it should diagnose the unknown long option:
$ cksum --unknown-opt
cksum: unrecognized option '--unknown-opt'
Try 'cksum --help' for more information.
* src/cksum.c (long_options): Add struct with null entry only.
(main): Use it in the getopt_long call.
* src/dd.c: Likewise.
* src/hostid.c: Likewise.
* src/hostname.c: Likewise.
* src/link.c: Likewise.
* src/logname.c: Likewise.
* src/nohup.c: Likewise.
* src/sleep.c: Likewise.
* src/tsort.c: Likewise.
* src/unlink.c: Likewise.
* src/uptime.c: Likewise.
* src/users.c: Likewise.
* src/whoami.c: Likewise.
* src/yes.c: Likewise.
* NEWS (Improvements): Mention the fix.
2017-11-29 Pádraig Brady
test: fix issues with tests/cp/preserve-mode.sh
* tests/cp/preserve-mode.sh: This was the only use of awk,
which may not be available on the system resulting
in an ineffective test. Also the permissions bits for
directories were not being checked at all.
build: update gnulib submodule to latest
* gnulib: Update with various build/test fixes.
2017-11-28 Pádraig Brady
build: update gnulib submodule to latest
* gnulib: Update including various build fixes.
2017-11-27 Bernhard Voelker
timeout: also support short -v option
* src/timeout.c (main): Add short option character 'v' to getopt_long
call.
* tests/misc/timeout.sh: Run the test both for the long and the short
option.
2017-11-25 Pádraig Brady
dd: support iflag=direct with arbitrary sized files
* src/dd.c (iread): Handle read error with a non-aligned
file offset in the O_DIRECT case. This is not an issue
on XFS at least, but on EXT4 the final read will return
EINVAL rather than the expected 0 to indicate EOF.
* tests/dd/direct.sh: Test the iflag=direct case also.
* NEWS: Mention the improvement.
2017-11-24 Pádraig Brady
timeout: add --verbose to diagnose timeouts
This is useful as handling in shell is complicated
with the varying exit status in the --kill-after case.
* src/timeout.c (main): Handle '-v' and store
COMMAND for the diagnostic.
(cleanup): Diagnose the signal name before sending.
(usage): Document -v, --verbose.
* doc/coreutils.texi (timeout invocation): Likewise.
* tests/misc/timeout.sh: Add a test case.
* NEWS: Mention the new feature
Fixes https://bugs.gnu.org/21760
2017-11-19 Pádraig Brady
tail: seek to the end of block devices
* src/tail.c (tail_bytes): Try lseek(..., SEEK_END) when
we can't determine the file size.
* tests/tail-2/end-of-device.sh: Add a new root only test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.
Paul Eggert suggested using lseek() (rather than ioctl(BLKGETSIZE64)).
Fixes https://bugs.gnu.org/29259
2017-11-14 Bernhard Voelker
maint: include the module year2038 from gnulib
* bootstrap.conf (gnulib_modules): Add 'year2038' to ensure that time_t
is 64-bit (and thus works after 2038).
Suggested by Bruno Haible in
https://lists.gnu.org/r/bug-gnulib/2017-11/msg00022.html
2017-11-14 Bernhard Voelker
maint: update gnulib to latest
* gnulib: Update - mainly for the recent year2038 changes.
* tests/init.sh: Update from gnulib/tests/init.sh.
2017-11-09 Assaf Gordon
doc: add github issue/pull-request templates
These templates instruct contributors not to use github, and instead
use the upstream GNU development resources. Discussed in
http://lists.gnu.org/archive/html/coreutils/2017-11/msg00007.html .
* .github/ISSUE_TEMPLATE.txt,
.github/PULL_REQUEST_TEMPLATE.txt: New files.
2017-11-08 Jim Meyering
maint: make hook script reject "/archive/html" in lists.gnu.org URLS
* scripts/git-hooks/commit-msg: Require the abbreviated "/r/"
form in any log message URL.
maint: shorten https://lists.gnu.org/archive/html/... links
Each /archive/html/ part can be replace with /r/.
Run this to induce the change:
git grep -l archive/html|xargs perl -pi -e 's,/archive/html/,/r/,g'
* TODO: Perform that substitution.
* bootstrap: Likewise.
* src/sort.c (sequential_sort): Likewise.
* src/tail.c (tail_file): Likewise.
* tests/misc/sort-merge-fdlimit.sh: Likewise.
* tests/misc/stty-row-col.sh: Likewise.
* tests/misc/unexpand.pl: Likewise.
* tests/rm/readdir-bug.sh: Likewise.
* tests/tail-2/inotify-rotate.sh: Likewise.
2017-11-07 Thomas Deutschmann
tests: avoid false failure with inaccessible mount points
* tests/ls/readdir-mountpoint-inode.sh: Skip the test
if any mount points are inaccessible by the current user.
Fixes https://bugs.gnu.org/29167
Reported at: https://bugs.gentoo.org/353164
2017-11-06 Bernhard Voelker
doc: fix "Up" field of realpath usage examples
Older versions of 'makeinfo' choke on a missing reference:
./doc/coreutils.texi:14177: `Realpath usage examples' has no Up field\
(perhaps incorrect sectioning?).
makeinfo: Removing output file `doc/coreutils.info' due to errors; \
use --force to preserve.
* doc/coreutils.texi (realpath invocation): Add a menu referencing
the usage examples - introduced in v8.27-91-g7449f0d.
2017-11-06 Pádraig Brady
maint: ensure https:// URLs are used in --help and man pages
* configure.ac(AC_INIT): Specify the URL explicitly, so we're
not dependent on unreleased autoconf.
2017-10-31 Assaf Gordon
stat: output default formats for --terse in usage
Suggested by L A Walsh in https://bugs.gnu.org/28763 .
* src/stat.c (fmt_terse_fs): Define format for --terse -f here.
(fmt_terse_regular): Define format for --terse here.
(fmt_terse_selinux): Likewise for when SELinux is enabled.
(default_format): Use the above constants.
(usage): Output the formats for the terse modes.
2017-10-30 Pádraig Brady
df: fix hang with fifo argument
* src/df.c (main): stat() before open(), and avoid
the optional open when given a fifo argument.
* tests/df/unreadable.sh: Add a test case.
* NEWS: Mention the fix.
Fixes https://bugs.gnu.org/29038
2017-10-28 Jim Meyering
build: ls.c: apply _GL_ATTRIBUTE_PURE to more functions
* src/ls.c (DEFINE_SORT_FUNCTIONS): Apply _GL_ATTRIBUTE_PURE
to each strcmp-derived function definition, since GCC8 with
-Wsuggest-attribute=pure now warns it is needed.
2017-10-26 Vincent Lefevre
doc: reference statfs(2) in the stat(1) man page
* man/stat.x (SEE ALSO): Mention statfs(2) in addition to stat(2).
Note statfs() is generally used rather than statvfs(),
so we'll defer that reference to the SEE ALSO section of statfs(2).
Fixes https://bugs.gnu.org/28989
2017-10-25 Pádraig Brady
tests: avoid false failure when O_DIRECT isn't supported
* tests/dd/nocache_eof.sh: Only run the O_DIRECT tests
when 512 byte alignment is supported. Otherwise with older
XFS on systems with > 1MiB pages, or on file systems not
supporting O_DIRECT, there would have been false failures.
* tests/dd/direct.sh: Clarify the skip message.
2017-10-25 Pádraig Brady
dd: fix nocache regions passed to posix_fadvise()
Previously with oflag=direct the call to invalidate_cache()
was not passed to the kernel, as it was less than a page size,
and a subsequent call was not made to invalidate the pending space.
Similarly with oflag=nocache the pending space at EOF was
not invalidated. Even though these amount to only a single page
in the page cache it can be significant. For example on
XFS before kernel patch v4.9-rc1-4-g0ee7a3f, O_DIRECT files
would have been read inefficiently if any pages were cached,
even if they were already synced to storage.
* src/dd.c (i_nocache_eof, o_nocache_eof): New bools used
to control when we want invalidate_cache(,0) to clear to EOF.
(cache_round): Use IO_BUFSIZE (currently 132KiB) to minimize
calls to the relatively expensive advise function, rather
than page_size. This also makes it clear that while the
kernel function operates on pages, this size is chosen for
performance reasons.
(invalidate_cache): Refactor to share more code between
input and output paths. Use i_nocache_eof and o_nocache_eof
rather than proxying off max_records. Ensure we
invalidate full pages when clearing to EOF as the kernel
will ignore any non complete pages. Fix the offset used
for the output path.
(dd_copy): Invalidate the cache of the input after the
offset is updated, for consistency and so we don't try to
invalidate before the start of the file. When we read
EOF on input, set flags so that we invalidate to EOF.
(main): Invalidate to EOF in more cases, by depending
on the i_nocache_eof and o_nocache_eof flags.
* doc/coreutils.texi (dd invocation): Clarify the alignment
and persisted caveats on the example applying "nocache"
to part of a file.
* tests/dd/nocache_eof.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Issue reported by Eric Bergen.
2017-10-24 Michael Stone
doc: mention QUOTING_STYLE env var in ls man page
* src/ls.c (usage): Mention QUOTING_STYLE with the --quoting-style
option, and indicate it has lower precedence than that option.
2017-10-24 Pádraig Brady
maint: apply suggested cleanup to recent stty.c change
This should have been part of commit v8.28-17-gf926f7c
* src/stty.c (check_argument): Align line continuation chars,
and ensure the function macro is immune to usage with if/else.
Suggested by Jim Meyering and Paul Eggert.
b2sum: fix crash with --check and truncated input
* src/md5sum.c (split_3): Ensure we don't walk off
the end of the string.
* tests/misc/b2sum.sh: Add test cases.
Fixes https://bugs.gnu.org/28860
2017-10-24 Pádraig Brady
stty: fix processing of options when -F is specified
This was a latent issue that became significant with
the addition of the -F option in FILEUTILS-3_16n-56-ge46a424
* src/stty.c (apply_settings): Refactor argument checking
to a function macro. Augment the argument check to ignore
NULLed out arguments (already processed -F).
* NEWS: Mention the fix.
* tests/misc/stty-invalid.sh: Add a test case.
Fixes https://bugs.gnu.org/28859
2017-10-24 Pádraig Brady
timeout: fix a small race that would ignore command exit
This fixes a regression from commit v8.26-39-g2f69dba
* src/timeout.c (block_cleanup_and_chld): Rename from block_cleanup
to indicate we also block SIGCHLD to avoid the race where SIGCHLD
fires between waitpid() polling and sigsuspend() waiting for a signal.
* NEWS: Mention the fix.
2017-10-24 Thomas Jarosch
timeout: fix regression when invoked with blocked SIGCHLD
We inherit the signal mask from our parent process,
therefore ensure SIGCHLD is not blocked.
If SIGCHLD is blocked, sigsuspend() won't be interrupted
when the child process exits and we hang until the timeout (SIGALRM).
This fixes a regression from commit v8.26-39-g2f69dba
* src/timeout.c (install_sigchld): Ensure SIGCHLD is unblocked.
* NEWS: Mention the issue.
2017-10-02 Pádraig Brady
build: reinstate distribution of man pages
man pages change little between systems,
so falling back to distributed pages make sense
when cross compiling or lacking perl.
* man/local.mk: Add all man pages to EXTRA_DIST
so that they're distributed in the generated tarball.
Use the dummy-man page generator if cross compiling.
Set TZ to avoid a distcheck failure where man pages
used a diffent month than those rebuilt (with a .timestamp).
* man/dummy-man: Only fall back to generating a stub
if copying an existing man page fails.
* man/help2man: Sync portable TZ=UTC0 specification
from upstream help2man.
* NEWS: Mention the build-related change.
Fixes https://bugs.gnu.org/28574
2017-10-02 Pádraig Brady
maint: remove a duplicate entry from THANKS
* .mailmap: Prefer Colin Watson's last used email address.
2017-09-25 Paul Eggert
copy: revert recent patch for vulnerable dirs
I plan to propose a better patch to catch vulnerable parent
directories.
* NEWS, doc/coreutils.texi (Target directory): Document this.
* src/cp.c, src/install.c, src/ln.c, src/mv.c:
Do not include targetdir.h.
(target_directory_operand): Remove test for vulnerable parents.
* src/cp.c (stat_target_operand): Remove. All uses removed.
* src/local.mk (noinst_HEADERS): Remove src/targetdir.h.
(src_ginstall_SOURCES, src_cp_SOURCES, src_ln_SOURCES)
(src_mv_SOURCES): Remove src/targetdir.c.
* src/targetdir.c, src/targetdir.h: Remove.
* tests/mv/vulnerable-target.sh: Remove.
* tests/local.mk (all_root_tests): Remove it.
2017-09-24 Pádraig Brady
tests: fix test hang on case insenitive file systems
* tests/split/filter.sh: Due to an invalid 'FILE = zero.in'
construct trying to initialize a FILE variable, it would
instead try to run the FILE command which is present on
macOS 10.13 with APFS.
We also remove a redundant duplicate test clause introduced
during a rebase, and simplify the piped timeout command,
to avoid requiring a subshell and associated quoting.
* THANKS.in: Add the reporter Jack Howarth.
Fixes https://bugs.gnu.org/28506
2017-09-21 Pádraig Brady
tests: avoid a false failure in expr test with UTF8
* tests/misc/expr.pl: Skip the quote varying tests in
the multi-byte locales as these tests aren't that interesting
in those locales. Also ERR_SUBST is already defined for
some tests so awkward to redefine to munge UTF8 quotes to ASCII.
2017-09-20 Assaf Gordon
expr: add detailed syntax error messages
Show offending argument instead of a generic 'syntax error' message.
Suggested by Bernhard Voelker in https://bugs.gnu.org/28461#13 .
* src/expr.c (syntax_error): Remove.
(required_more_args): New function.
(eval7, main): Replace syntax_error call with detailed die message.
* tests/misc/expr.pl: Add tests for new messages.
2017-09-20 Pádraig Brady
maint: fix new syntax-check failures from HTTPS adjustments
* cfg.mk [old_NEWS_hash]: update with `make update-NEWS-hash`.
[sc_long_lines]: Avoid flagging (long) URLs in NEWS.
* src/sort.c: Tweak to a shorter line.
* src/tail.c: Likewise.
Introduced in v8.28-4-gbe87d61
maint: fix new syntax check failures from copy restrictions
* doc/coreutils.texi: Remove doubled word.
* src/targetdir.c: Explicitly mark exported function.
* tests/local.mk: This is not a root only test.
* tests/mv/vulnerable-target.sh: Use returns_.
Introduced in v8.28-3-g44ccd1c
shred: reinstate --remove file name length obfuscation
This was unintentionally removed in v8.27-60-g2ae1460
* src/shred.c (wipename): Interate through all name lengths.
* tests/misc/shred-remove.sh: Add test cases.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/28507
2017-09-19 Paul Eggert
maint: copy bootstrap from Gnulib
all: prefer HTTPS in URLs
copy: check for vulnerable target dirs
* NEWS, doc/coreutils.texi (Target directory): Document this.
* src/cp.c, src/install.c, src/ln.c, src/mv.c: Include targetdir.h.
(target_directory_operand): Use the new targetdir_operand_type
function to check for vulnerable target directories.
* src/cp.c (stat_target_operand): New function.
(target_directory_operand, do_copy): Use it.
* src/local.mk (noinst_HEADERS): Add src/targetdir.h.
(src_ginstall_SOURCES, src_cp_SOURCES, src_ln_SOURCES)
(src_mv_SOURCES): Add src/targetdir.c.
* src/targetdir.c, src/targetdir.h: New files.
* tests/mv/vulnerable-target.sh: New test.
* tests/local.mk (all_root_tests): Add it.
2017-09-14 Bernhard Voelker
ptx: avoid infloop due to zero-length matches with -S regex
* src/ptx.c (find_occurs_in_text): Die with an appropriate error
diagnostic when the given regular expression returns a match of
length 0.
* tests/misc/ptx.pl (S-infloop): Add a test.
* NEWS (Bug fixes): Mention the fix.
Fixes https://bugs.gnu.org/28417 which was detected using
Symbolic Execution techniques developed in the course of the
SYMBIOSYS research project at COMSYS, RWTH Aachen University.
2017-09-02 Pádraig Brady
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
version 8.28
* NEWS: Record release date.
2017-09-01 Pádraig Brady
tests: fix false failure in recent ls --hyperlink test
* tests/ls/hyperlink.sh: If the hostname or any part of
the absolute path would be changed due to URL encoding,
the test would fail. Therefore simplify to remove
these components of the URL from consideration.
maint: avoid a syntax-check failure
* .gitignore: Remove lines indicated by sc_gitignore_redundant
in a freshly checked out repo.
2017-08-31 Pádraig Brady
tests: exclude the expensive gnulib fts-tests
* gnulib: The only change in this gnulib update
is the tagging of the fts-tests module as longrunning,
which gnulib-tool currently implicitly excludes.
This test was seen to take about 20s and 285MB.
Reported by Assaf Gordon on space restricted VMs.
tty: don't distinguish input errors
* src/tty.c (main): Don't distinguish ENOTTY from other errors,
because isatty() doesn't portably distinguish errors.
Solaris returns ENOENT for all input errors for example.
Musl also returns ENOENT, and ENODEV may be returned as disscussed at:
http://openwall.com/lists/musl/2017/04/06/6
* tests/misc/tty.sh: Adjust accordingly.
tests: avoid printf '0*d' construct unsupported by ash
* tests/ln/sf-1.sh: Generate specific length with space padding
which is supported.
Reported by Assaf Gordon on Alpine Linux.
2017-08-31 Pádraig Brady
tests: skip tests upon failure to set SELinux context
On some setups the root:object_r:tmp_t context is invalid.
This does indicate a limitation in the test framework,
but for now we'll relax this to skipping the tests.
The tests still run on a Fedora 25 system for example.
* tests/cp/cp-a-selinux.sh: Upon chcon error, skip rather than ERROR.
* tests/install/install-Z-selinux.sh: Likewise.
* tests/misc/chcon.sh: Likewise.
* tests/misc/runcon-no-reorder.sh: Likewise.
* tests/misc/selinux.sh: Likewise.
* tests/mkdir/restorecon.sh: Likewise.
2017-08-30 Kamil Dudka
expr: fix a recently introduced memory leak
* src/expr.c (eval6): Free memory allocated by mbs_logical_substr().
Introduced in v8.27-47-ga9f2be5. Detected by Coverity Analysis:
Error: RESOURCE_LEAK:
src/expr.c:851: leaked_storage: Variable "s" going out of scope
leaks the storage it points to.
849| char *s = mbs_logical_substr (l->u.s, pos, len);
850| v = str_value (s);
851|-> }
852| freev (l);
853| freev (i1);
2017-08-30 Pádraig Brady
build: fix build of renameat2 on Alpine Linux
* gnulib: The only change included in this update
it the added check for the presence of
which is not present on Alpine Linux by default.
tty: fix exit code with EINVAL
* src/tty.c (main): All systems mention that isatty()
man return EINVAL as well as (the POSIX compliant) ENOTTY.
Also Centos 6 was seen to return EINVAL from ttyname().
* tests/misc/tty.sh: Fix a test issue where we assume
standard input is always a valid tty.
Reported by Assaf Gordon on OpenSolaris 5.10 and 5.11,
and Centos 6.5
2017-08-30 Pádraig Brady
runcon: revert "disable use of the TIOCSTI ioctl"
This reverts commit v8.27-97-g8cb06d4 because
the setsid() fallback was not implemented correctly
and disabling the ioctl was not a complete solution
to the security issue of the child being passed
the tty of the parent.
Given runcon is not really a sandbox command,
the advice is to use `runcon ... setsid ...`
to avoid this particular issue.
2017-08-30 Pádraig Brady
stat: fix determination of max name length on BSD systems
We only use one of statfs or statvfs for `stat -f`
and on the BSDs we use statfs which doesn't have the
f_namelen member. However on OpenBSD and later FreeBSD
systems statfs does provide f_namemax, so use that.
* NEWS: Mention the improvement for OpenBSD and FreeBSD.
* m4/stat-prog.m4: Check for f_namemax in the statfs struct.
* src/stat.c: Return '?' rather than '*' when we can't
determine the max length of the file system.
* tests/ln/sf-1.sh: This test was failing on all BSDs
due to '*' being returned for the max length which
caused the test to attempt to create 1Mi+1 names.
The test now uses a short name when we can't determine
the max name length to use.
Reported by Assaf Gordon on various BSD based systems.
2017-08-29 Pádraig Brady
stat,tail: support "AAFS" AppArmor file system
* src/stat.c (human_fstype): This file system is used
to manage AppArmor policy in the Linux kernel.
all: update gnulib submodule to latest
* bootstrap: Sync timestamp update.
2017-08-29 Pádraig Brady
runcon: disable use of the TIOCSTI ioctl
Similar to the issue with SELinux sandbox (CVE-2016-7545),
children of runcon can inject arbitrary input to the terminal
that would be run at the originating terminal privileges.
The new libseccomp dependency is widely available and used
on modern SELinux systems, but is not available by default
on older systems like RHEL6 etc.
* m4/jm-macros.m4: Check for libseccomp and
warn if unavailable on selinux supporting systems.
* src/local.mk: Link runcon with -lseccomp.
* src/runcon.c (disable_tty_inject): A new function to
disable use of the TIOCSTI using libseccomp, or with setsid()
where libseccomp is unavailable.
* tests/misc/runcon-no-inject.sh: A new test that uses
python to make the TIOCSTI call, and ensure that doesn't succeed.
* tests/local.mk: Reference the new test
* NEWS: Mention the fix.
Addresses http://bugs.gnu.org/24541
2017-08-29 Pádraig Brady
ls: support --hyperlink to output file:// URIs
Terminals such as iTerm2 and VTE based terminals
(as of version 0.49.1), support hyperlinks when
passed terminals codes as described at:
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
* src/ls.c (gobble_file): Allocate an absolute file name to output.
(quote_name): Output the absolute name with the appropriate codes.
(file_escape): A new function to encode file names as per rfc8089.
(main): Handle the new option and call the file_escape_init() helper.
Disable --dired when --hyperlink is specified.
(print_dir): Get the absolute file name here too, so that the
directory name can be linkified.
* NEWS: Mention the new feature.
* tests/ls/hyperlink.sh: Add a new test.
* tests/local.mk: Reference the new test.
* doc/coreutils.texi (ls invocation): Describe --hyperlink.
2017-08-29 Pádraig Brady
doc: remove older ChangeLog items
This saves about 0.5MB uncompressed from the tarball.
* Makefile.am: Following on from v8.26-34-g2c64bc8
update the oldest documented version to 8.18 which
is now about 5 years old. Also remove older ChangeLogs
that were previously thought to be for changes not
in the git history, but are adequately recorded upon review.
* build-aux/ChangeLog-2007: Remove file.
* lib/ChangeLog-2007: Likewise.
* m4/ChangeLog-2007: Likewise.
2017-08-29 Colin Watson
env: add --chdir option
This is useful when chaining with other commands that run commands in a
different context, while avoiding using the shell to cd, and thus
having to consider shell quoting the chained command.
* NEWS (New features): Document the new option.
* doc/coreutils.texi (env invocation): Likewise.
* src/env.c (usage): Likewise.
(main): Implement the new option.
* tests/misc/env.sh: Test the new option.
2017-08-29 Pádraig Brady
tests: don't fail tests when failing to write files
* tests/sample-test: Use framework_error_ rather than fail=1
* tests/chown/deref.sh: Likewise.
* tests/chown/preserve-root.sh: Likewise.
* tests/cp/src-base-dot.sh: Likewise.
* tests/dd/unblock-sync.sh: Likewise.
* tests/du/2g.sh: Likewise.
* tests/du/inacc-dest.sh: Likewise.
* tests/du/one-file-system.sh: Likewise.
* tests/fmt/goal-option.sh: Likewise.
* tests/ln/hard-backup.sh: Likewise.
* tests/ls/color-dtype-dir.sh: Likewise.
* tests/ls/m-option.sh: Likewise.
* tests/ls/stat-dtype.sh: Likewise.
* tests/ls/time-style-diag.sh: Likewise.
* tests/ls/x-option.sh: Likewise.
* tests/misc/chcon.sh: Likewise.
* tests/misc/nohup.sh: Likewise.
* tests/misc/od-N.sh: Likewise.
* tests/misc/sort-compress.sh: Likewise.
* tests/misc/tac-continue.sh: Likewise.
* tests/misc/time-style.sh: Likewise.
* tests/mv/backup-dir.sh: Likewise.
* tests/mv/dir2dir.sh: Likewise.
* tests/rm/dir-no-w.sh: Likewise.
* tests/rm/dir-nonrecur.sh: Likewise.
* tests/rm/inaccessible.sh: Likewise.
* tests/rm/interactive-always.sh: Likewise.
* tests/rm/interactive-once.sh: Likewise.
* tests/rm/rm3.sh: Likewise.
* tests/rm/v-slash.sh: Likewise.
* tests/touch/relative.sh: Likewise.
2017-08-29 Josef Cejka
Bernhard Voelker
df: avoid stat() for dummy file systems with -l
When systemd is configured to automount a remote file system - see
'man systemd.automount(5)', then the mount point is initially
mounted by systemd with the file system type "autofs".
When the resource is used later on, then the wanted file system is
mounted over that mount point on demand.
'df -l' triggered systemd to mount the file system because it called
stat() on the mount point.
Instead of single-casing "autofs" targets, we can avoid stat()ing
all dummy file systems (which includes "autofs"), because those are
skipped later on in get_dev() anyway.
*src/df.c (filter_mount_list): Also skip dummy file systems unless
the -a option or a specific target are given.
* NEWS: Mention the fix.
Fixes http://bugzilla.suse.com/show_bug.cgi?id=1043059
2017-08-29 Assaf Gordon
doc: add 'realpath usage examples' section
* doc/coreutils.texi (Realpath usage examples): New section.
2017-08-29 Assaf Gordon
doc: fix realpath index entry
The 'readlink' node has '@findex realpath' in it. This results in
info doc/coreutils.info realpath
incorrectly jumping to the 'readlink' node (instead of the 'realpath'
node). Change it to @cindex instead.
* doc/coreutils.texi (readlink): Change '@findex realpath' to @cindex.
2017-08-29 Assaf Gordon
realpath: improve usage description for --relative-{to,base}
* src/realpath.c (usage): Explicitly say 'DIR' instead of 'FILE' for
--relative-{to,base} parameters, to avoid giving the impression
that regular files can be used as relative base.
* doc/coreutils.texi (realpath): Same.
2017-08-25 Pádraig Brady
ls: consistently quote symlink targets
* src/ls.c (gobble_file): Disable the optimization to avoid quoting
if the symlink target itself needs quoting. This was introduced
with the quoting alignment adjustments in v8.25-106-g01971c0
* tests/ls/symlink-quote.sh: Add a test.
* tests/local.mk: Reference the test.
* NEWS: Mention the fix.
2017-08-25 Pádraig Brady
tail: reinstate inotify use with FIFOs
commit v8.27-44-g18f6b22 was too aggressive in
only allowing inotify use with regular files. This will
support responsive processing of `tail -f fifo | ...`
* src/tail.c (any_non_regular): Adjust to allow FIFOs
since inotify supports these well.
* tests/tail-2/inotify-only-regular.sh: Adjust comment.
2017-08-19 Pádraig Brady
maint: avoid a syntax check failure
* src/sort.c: Don't include stdio--.h as fopen() is no longer used.
tests: fix issues on alpine linux
* tests/misc/seq-epipe.sh: Remove stale comment.
* tests/misc/sort-debug-warn.sh: musl doesn't indicate a set_locale()
failure with missing locales, so avoid a test portion in that case.
* tests/misc/wc-files0.sh: Avoid a bug on older ash implementations.
Addresses http://bugs.gnu.org/28054
2017-08-17 Paul Eggert
ptx: fix some integer overflow bugs
Problem reported by Lukas Zachar at:
http://bugzilla.redhat.com/1482445
* src/ptx.c (line_width, gap_size, maximum_word_length)
(reference_max_width, half_line_width, before_max_width)
(keyafter_max_width, truncation_string_length, compare_words)
(compare_occurs, search_table, find_occurs_in_text, print_spaces)
(fix_output_parameters, define_all_fields):
Use ptrdiff_t, not int, for object offsets and sizes.
(WORD, OCCURS): Use ptrdiff_t, not short int.
(WORD_TABLE, number_of_occurs, generate_all_output):
Prefer ptrdiff_t to size_t where either will do.
(total_line_count, file_line_count, OCCURS, fix_output_parameters)
(define_all_fields):
Use intmax_t, not int, for line counts.
(DELTA): Remove. All uses changed.
(OCCURS, find_occurs_in_text, fix_output_parameters):
Use int, not size_t, for file indexes.
(tail_truncation, before_truncation, keyafter_truncation)
(head_truncation, search_table, define_all_fields)
(generate_all_output):
Use bool for booleans.
(digest_word_file, find_occurs_in_text):
Use x2nrealloc instead of checking for overflow by hand.
(find_occurs_in_text, fix_output_parameters, define_all_fields):
Omit unnecessary cast.
(fix_output_parameters): Don’t assume integers fit in 11 digits.
(fix_output_parameters, define_all_fields):
Use sprintf return value rather than calling strlen.
(define_all_fields): Do not rely on sprintf to generate a string
that may contain more than INT_MAX bytes.
(main): Use xstrtoimax, not xstrtoul.
Use xnmalloc to catch integer overflow.
nohup: simplify by using fcntl
* src/nohup.c: Do not include cloexec.h.
(main): Use fcntl rather than dup + set_cloexec_flag.
sort: use pthread_sigmask, not sigprocmask
POSIX says sigprocmask has unspecified behavior in a multithreaded
program like ‘sort’.
* src/sort.c (pthread_sigmask) [GNULIB_defined_pthread_functions]:
New macro, for use when ‘sort’ is not multithreaded.
(cs_enter, cs_leave): Use it. Pass address, not value, as
this is typically a tad faster. All callers changed.
sort: minor cleanups
* src/sort.c (move_fd): Rename from move_fd_or_die,
since it no longer can die.
sort: file descriptor discipline
Use O_CLOEXEC when creating file descriptors, so that subsidiary
processes do not inherit file descriptors that they do not need.
This is helpful for ‘sort’, as it is a multithreaded program that
forks and execs.
* bootstrap.conf (gnulib_modules): Add mkostemp, open, pipe2.
* src/sort.c (create_temp_file): Open temporary file with O_CLOEXEC.
(stream_open): Open the stream with O_CLOEXEC.
(pipe_fork): Create the pipe with O_CLOEXEC.
(check_output): Open the output file with O_CLOEXEC.
(main): Use xfopen/xfclose to handle --files0-from, so that
O_CLOEXEC is used properly. This is simpler anyway.
* tests/misc/sort-files0-from.pl: Adjust to change in diagnostic
wording.
build: update gnulib submodule to latest
2017-08-14 Pádraig Brady
kill: fix signal number to name lookup on AIX
* src/operand2sig.c (operand2sig): AIX uses a different bit pattern
in the returned status from the wait() functions and from shells.
Therefore hardcode the selection of the lower bits of the number.
* NEWS: Mention the fix.
build: use the appropriate single file include option with xlc
* configure.ac: Set USE_XLC_INCLUDE when __xlc__ is defined.
* src/local.mk: Use it to select the appropriate include option.
Reported by Michael Felt.
tests: avoid false failures on AIX
* tests/ln/sf-1.sh: Limit the symlink size to 1MiB
to avoid memory exhaustion seen on NFS on AIX, giving:
+ printf '%0*d' 4294967296 0
+ ./tests/ln/sf-1.sh: line 38: printf: warning: 0: Result too large
* tests/id/setgid.sh: Skip the test when the adjusted gid
would equal 4294967295, as that's reserved on AIX.
Reported by Michael Felt.
sort: handle musl locale differences in --debug reporting
* src/sort.c (main): Don't assume hard_LC_COLLATE implies
a successful setting of the locale as musl defaults to
UTF8 when failing to set the specified locale.
* tests/misc/sort-debug-warn.sh: Adjust for the now
separated locale debug info and map the musl specific
message back to the common case.
Addresses https://bugs.gnu.org/28054
seq: produce consistent error messages upon write error
* src/seq.c (io_error): Use the same error message as would
be generated at exit time when closing the stdout stream.
The inconsistency was added with commit v8.25-26-gc92585b.
This was noticed due to an inconsistency in the expected
error message generated by seq on musl libc.
Addresses https://bugs.gnu.org/28054
tests: fix false failure with large printf formats
* tests/misc/printf-surprise.sh: With musl libc the
large printf format does succeed, outputting data.
To avoid SIGPIPE being generated we ignore that signal
and then handle the subsequent EPIPE error.
Addresses https://bugs.gnu.org/28054
2017-08-12 Jim Meyering
build: adjust warning options to work with latest GCC
* configure.ac: Disable some new warnings to avoid false positives.
Building with warnings enabled and latest gcc would evoke build
failure without these changes. Disable the following in coreutils
proper: -Wformat-overflow=2 -Wformat-truncation=2, and
disable these for gnulib: -Wformat-truncation=2 -Wduplicated-branches
gnulib: update to latest and adjust gl/modules/tempname.diff
* gnulib: Update to latest.
* gl/modules/tempname.diff: This patch failed to apply.
Adjust it to reflect removal of the secure_getenv dependency.
chroot: fix typo in preceding change: didn't compile
* src/chroot.c (usage): Add backslashes.
2017-08-10 Jim Meyering
doc: correct technicality in chroot's --help output
* src/chroot.c (usage): Use correct quoting in descriptive diagnostic.
We would run `"$SHELL" -i`, not `${SHELL} -i`.
2017-08-09 Assaf Gordon
doc: fix join example
* doc/coreutils.texi (join invocation): Fix incorrect output in example.
Reported by Phlosioneer in https://bugs.gnu.org/28014 .
2017-08-04 Paul Eggert
build: update gnulib submodule to latest
2017-08-03 Paul Eggert
copy: more-accurate warning about destruction
* src/copy.c (copy_internal):
* tests/cp/backup-is-src.sh, tests/mv/backup-is-src.sh:
Say "might destroy", not "would destroy".
2017-08-03 Pádraig Brady
maint: avoid a syntax-check failure
* src/shred.c (wipename): As per the comment, the arguments
to error() are sufficiently quoted, so split the call over
multiple lines to avoid the syntax-check.
2017-08-02 Paul Eggert
build: update gnulib submodule to latest
2017-08-01 Paul Eggert
copy: go back to failing 'cp --backup a~ a'
Suggested by Kamil Dudka in:
http://lists.gnu.org/archive/html/coreutils/2017-07/msg00072.html
* NEWS: Document the changed nature of the fix.
* doc/coreutils.texi, tests/cp/backup-is-src.sh:
* tests/mv/backup-is-src.sh: Revert previous change.
* src/copy.c (source_is_dst_backup): New function.
(copy_internal): Use it. Fail instead of falling back on numbered
backups when it looks like the backup will overwrite the source.
Although this reintroduces a race, it's more compatible with
previous behavior.
2017-07-31 Paul Eggert
copy: sanity-check --suffix
* src/cp.c, src/install.c, src/ln.c, src/mv.c (main):
Use set_simple_backup_suffix, to sanity-check the user-supplied
backup suffix.
copy: make backup files more reliably
* NEWS, doc/coreutils.texi (Backup options): Document the change.
* bootstrap.conf (gnulib_modules): Add backup-rename.
* src/copy.c (copy_internal): Silently switch to numbered backups
if a simple backup might lose data. Use backup_file_rename
to avoid races with numbered backups.
* tests/cp/backup-is-src.sh, tests/mv/backup-is-src.sh:
Adjust to match new behavior.
shred: avoid rename race
Use renameat2 to avoid a rename race condition, on recent-enough
GNU/Linux.
* bootstrap.conf (gnulib_modules): Add renameat2.
* src/shred.c: Include renameat2.h.
(wipename): Use renameat2 instead of rename.
build: update gnulib submodule to latest
2017-07-25 Jim Meyering
maint: fix grammar in a shred.c comment
* src/shred.c: Remove spurious "to" in an old comment.
2017-07-23 Pádraig Brady
maint: fix recent syntax-check failures
* .gitignore: Add /lib/utime.h from the recent gnulib update.
* src/nproc.c (usage): Adjust spacing to placate help2man.
shred: remove redundant zeroing of freed memory
* src/shred.c (dopass): shred used to read the input file,
and so needed to ensure internal memory was cleared.
This is no longer the case since SH-UTILS-1_16f-260-gf381610
so avoid this redundant clearing.
(do_wipefd): Likewise.
* NEWS: Remove the recent mention of this issue.
maint: resync with blake2 upstream
* src/blake2/blake2-impl.h: Don't use the equivalent explicit_bzero().
tests: avoid a false failure on AIX
* tests/misc/sync.sh: Normalize the error messages
when syncing a non read/write directory, as AIX
gives the "Is a directory" error.
Also ensure that sync(1) returns an error for this
case on all systems.
2017-07-20 Paul Eggert
shred: use explicit_bzero
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add explicit_bzero.
* gl/lib/randint.c (randint_free):
* gl/lib/randread.c (randread_free):
* src/blake2/blake2-impl.h (secure_zero_memory):
* src/shred.c (dopass, do_wipefd):
Prefer explicit_bzero to memset when erasing secrets.
build: update gnulib submodule to latest
2017-07-10 Andreas Schwab
nproc: fix indentation of usage output
* src/nproc.c (usage): Align output.
2017-07-10 Jim Meyering
groups: do not exit early
Most programs take care to operate on all command-line-specified
operands before exiting. That is an important feature that allows
to identify all problems with the first run. However, groups would
exit upon the first problematic user name.
Bug introduced via commit v6.10-56-g167b8025ac.
* src/groups.c (main): Do not exit immediately upon error.
* tests/misc/groups-process-all.sh: New file. Test for this.
* tests/local.mk (all_tests): Add it.
* NEWS (Bug fixes): Mention this.
2017-07-08 Jim Meyering
tests: groups-dash.sh: avoid false failure
* tests/misc/groups-dash.sh: Avoid false failure on a system for which
"none" is a valid user name. The first invocation would succeed, and
the second would fail with "groups: ‘--’: no such user".
Use a user name that cannot exist.
doc: tweak wording
* NEWS (Bug fixes): Tweak wording of the mv/cp-vs-symlink-ownership
entry and the one about df.
2017-06-28 Assaf Gordon
expr: add multibyte support
Discussed in https://bugs.gnu.org/26779 .
* NEWS: Mention the improvement.
* bootstrap.conf: Add gnulib modules mbslen,mbschr.
* src/expr.c (mbs_logical_substr): New function to return a substring
based on logical character positions (instead of bytes).
(mbs_logical_cspn): Similar to strcspn/mbscspn, but returns number of
logical characters instead of byte offset.
(mbs_offset_to_chars): New function to return number of logical
characters fitting in a given byte offset.
(docolon): Report matched logical characters instead of bytes.
(eval6): For length/substr/index operations, use logical characters
instead of bytes by calling the above new functions.
* tests/misc/expr.pl: Repeat all tests with non-C locale to detect any
regressions.
* tests/misc/expr-multibyte.pl: New tests with multibyte input.
* tests/local.mk: Add new test file.
2017-06-21 Jim Meyering
maint: avoid spurious "make distcheck" failure
When the generated file, doc/constants.texi, happens to be older than
doc/coreutils.info, it will not be updated until/unless its generated
contents change. This is due to way that rule is careful to update
the file, to avoid provoking a pointless rerunning of makeinfo.
Note that this does not happen when one first runs "make distclean",
as recommended in README-release. However, I sometimes run it as
a more-rigorous "make check", and shouldn't have to manually run
"make distclean" first, in that case.
Before this change, one could reproduce the failure by running
`touch -dyesterday doc/constants.texi && make distcheck`. It would
fail with "makeinfo: could not open ../../doc/coreutils.info-t
for writing: Permission denied"
* Makefile.am (dist-hook): Touch the two generated files, so that
they cannot be out of date wrt doc/coreutils.texi.
2017-06-17 Pádraig Brady
maint: use C99 for loop initial declarations where possible
This results in a net reduction of about 120 lines.
tail: only use inotify with regular files
* src/tail.c (any_non_regular): A new function to check passed files.
(main): Use the above to skip inotify if any non regular files passed
like /dev/tty or /dev/ttyUSB0 etc.
* tests/tail-2/inotify-only-regular.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Fixes http://bugs.gnu.org/21265 and http://bugs.gnu.org/27368
tail: with -f don't warn if doing a blocking read of a tty
* src/tail.c: (main): Only issue the warning about -f being
ineffective when we're not going into simple blocking mode.
* tests/tail-2/follow-stdin.sh: Ensure the warning is output correctly.
Fixes http://bugs.gnu.org/27368
2017-06-11 Pádraig Brady
tail: exit promptly when output no longer writable
This will support use cases like:
tail -f file.log | grep -q trigger &&
process_immediately
* src/tail.c (check_output_alive): A new function that
uses select on fifos or pipes to detect if they're broken.
(tail_forever): Call check_output_alive() periodically.
(tail_forever_inotify): Merge the select() call from
check_output_alive() into the select() originally present
for the --pid case, and adjust accordingly.
* tests/tail-2/pipe-f.sh: Add test cases.
* NEWS: Mention the improvement.
2017-06-11 Jim Meyering
maint: update to work with GCC7's -Werror=implicit-fallthrough=5
* src/system.h (FALLTHROUGH): Define.
* src/cp.c (main): Use new FALLTHROUGH macro in place of comments.
* src/basename.c (main): Likewise.
* src/dircolors.c (append_quoted): Likewise.
* src/echo.c (main): Likewise.
* src/fold.c (main): Likewise.
* src/join.c (main): Likewise.
* src/kill.c (main): Likewise.
* src/ls.c (get_funky_string, gobble_file): Likewise.
* src/sort.c (parse_field_count, main): Likewise.
* src/stat.c (print_it): Likewise.
* src/tail.c (parse_obsolete_option): Likewise.
* src/test.c (posixtest): Likewise.
* src/wc.c (wc): Likewise.
* src/who.c (main): Likewise.
2017-06-07 Pádraig Brady
tail: with --pid, ensure all inotify events are processed
* NEWS: Mention the bug fix.
* src/tail.c (tail_forever_inotify): With --pid, avoid waiting
for new events if there are still events to process.
* tests/tail-2/inotify-dir-recreate.sh: Adjust to trigger.
tests: fix issues with recently added tail test
* tests/tail-2/inotify-dir-recreate.sh: Skip when
inotify is not usable. Also remove a bash specific &> construct.
2017-06-03 Pádraig Brady
copy: don't fail when unable to chown symlinks
* src/copy.c (copy_internal): Honor the x->require_preserve flag
for symlinks as we do for ordinary files, so we don't exit with
failure upon failure to chown a symbolic link.
* NEWS: Mention the bug fix.
2017-05-29 Sebastian Kisela
doc: mention `setpriv --no-new-privs` feature in runcon info
* doc/coreutils.texi (runcon invocation): Mention setpriv usage.
Discussed at https://bugzilla.redhat.com/1360903
2017-05-18 Pádraig Brady
mv: distinguish copy and rename operations with --verbose
* src/copy.c (copy_internal): In x->move_mode distinguish
whether we're copying, creating directory, or renaming.
* tests/mv/backup-dir.sh: Adjust to new output.
* tests/mv/mv-n.sh: Likewise.
* tests/mv/mv-special-1.sh: Likewise.
* NEWS: Mention the improvement.
Fixes http://bugs.gnu.org/26971
2017-05-11 Prateek saxena
uptime: remove inconsistent AM/PM from current time
* src/uptime.c (main): 00-23 was always used for the hour component
of the current time, so remove the AM/PM output (which was only
present in some locales anyway). Also add seconds to the time
to be more consistent with the usual procps-ng uptime implementation
on GNU/Linux.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/26783
2017-05-04 Pádraig Brady
maint: fix various typos in recent commits
* NEWS: Grammar fixes.
* HACKING: Likewise.
2017-05-04 Jaak Ristioja
doc: Fixed typo in timeout man page
* man/timeout.x: Correct spelling of "currently".
Fixes http://bugs.gnu.org/26762
2017-04-30 Pádraig Brady
doc: update the instructions for generating a coverage report
* HACKING: Change from explicit instructions to using gnulib
provided coverage testing targets. Also include instructions
for adding root only tests to the report.
Fixes http://bugs.gnu.org/26709
2017-04-27 Paul Eggert
dd: simplify translator’s jobs
* src/dd.c (print_xfer_stats): Format the SI units directly,
without translating them, to simplify the translators’ jobs.
See Bug#26621.
2017-04-27 Pádraig Brady
date,touch: test and document large TZ security issue
Add a test for CVE-2017-7476 which was fixed in gnulib at:
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=94e01571
* tests/misc/date-tz.sh: Add a new test which overwrites enough
of the heap to trigger a segfault, even without ASAN enabled.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
2017-04-27 Pádraig Brady
build: update gnulib submodule to latest
* .gitignore: Add new entry as indicated by `make syntax-check`.
2017-04-24 Paul Eggert
dd: status=progress outputs "6 s", not "6.00001 s"
Problem reported by Benno Schulenberg (Bug#26621).
* NEWS: Document this.
* src/dd.c (print_xfer_stats): With status=progress,
format times with %.0f rather than %g. Improve
translator comments.
2017-04-22 Paul Eggert
build: update gnulib submodule to latest
maint: remove unused functions and constants
These were found by clang.
* gl/lib/rand-isaac.c (min):
* gl/lib/randint.c (shift_right):
* src/md5sum.c (algorithm):
Remove; unused.
date: adjust to gnulib parse-datetime changes
* doc/coreutils.texi (Options for date): Capitalize a sentence.
* tests/misc/date-debug.sh: Adjust --debug output to match
recent changes to Gnulib’s parse-datetime module.
build: update gnulib submodule to latest
* gl/modules/tempname.diff: Update to match current Gnulib.
2017-04-18 Bogdan Drozdowski
shred: fix invalid pattern generation for certain sizes
* src/shred.c (fillpattern): Fix the "off by one" issue when
testing whether we have enough space to copy the already
written portion of the buffer to the remainder of the buffer.
Specifically for buffer sizes that are (3*(2^x))+1, i.e. 7,13,...
we both use an uninitialized byte and invoke undefined
behavior in memcpy() operation on overlapping memory regions.
* tests/misc/shred-passes.sh: Add an invocation that will
trigger either valgrind UMR, or ASAN like:
ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges
#1 0x403065 in fillpattern src/shred.c:293
A direct test is awkward due to the random writes surrounding
the problematic pattern writes.
Fixes http://bugs.gnu.org/26545
2017-04-17 Bo Rydberg
doc: fix awk example for getting penultimate field
* doc/coreutils.texi (cut invocation): Add required brackets.
Fixes http://bugs.gnu.org/26519
2017-04-06 Sebastian Kisela
tail: revert to polling if a followed directory is replaced
* src/tail.c (tail_forever_inotify): Add the IN_DELETE_SELF flag when
creating watch for the parent directory. After the parent directory
is removed, an event is caught and then we switch from inotify to
polling mode. Till now, inotify has always frozen because it waited for
an event from a watched dir, which has been already deleted and was not
added again.
* tests/tail-2/inotify-dir-recreate.sh: Add a test case.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Fixes http://bugs.gnu.org/26363
Reported at https://bugzilla.redhat.com/1283760
2017-04-06 Pádraig Brady
maint: fix syntax-check issues in previous tty commit
* src/tty.c: Avoid EXIT_FAILURE to be more descriptive
and to placate sc_some_programs_must_avoid_exit_failure.
2017-04-05 Paul Eggert
tty: handle misconfigured namespaces
On some platforms, isatty succeeds but ttyname fails.
POSIX does not seem to allow this, but there it is.
Problem reported by Christian Brauner (Bug#26371).
While we’re at it, check for errors more carefully and return a
new exit status 4 if stdin is closed or a similar error occurs.
* doc/coreutils.texi (tty invocation): Document new behavior.
* init.cfg (stderr_fileno_):
Don't assume have_input_tty is not in the environment.
* src/tty.c (TTY_STDIN_ERROR): New constant.
(main): Exit with nonzero status if there is a usage error,
like other coreutils programs.
Check for error in getting stdin type.
* tests/misc/tty.sh: New file.
* tests/local.mk (all_tests): Add it.
2017-04-03 Pádraig Brady
doc: refactor and update expand and unexpand --help
* src/expand-common.c (emit_tab_list_info): A new function to
output the extended info on --tab=LIST, including the new
'+' and '/' prefixes.
* src/expand-common.h: Declare the above.
* src/expand.c (usage:): Call emit_tab_list_info and
match alignment with that used in unexpand --help.
* src/unexpand.c (usage): Likewise.
2017-04-03 Jacob Keller
expand,unexpand: add support for incremental tab stops
Support --tabs="1,+8" which is equivalent to --tabs="1,9,17,..."
useful for viewing unified diff output with its 1 character
gutter for example.
* doc/coreutils.texi ({expand,unexpand} invocation): Document,
using diff processing as the example.
* src/expand-common.c (set_increment_size): Update the new
increment_size global.
(parse_tab_stops): Handle the new '+' prefix.
(finalize_tab_stops): Verify both '+' and '/' prefixes
are not used together.
* tests/misc/expand.pl: Add test cases.
* NEWS: Mention the new feature.
2017-03-30 Paul Eggert
sort: update comment
* src/sort.c: Update identifiers in comment.
2017-03-30 Chris Davies
doc: clarify in dd man page that bs= overrides [io]bs=
* src/dd.c (usage): Add the extra info.
Reported in https://bugs.debian.org/859021
2017-03-28 Ludovic Courtès