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.
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
* 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
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 '='.
* 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
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
* 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
* 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.
* 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.
* 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
* 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.
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.
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.
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
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.
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.
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
* 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.
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.
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.
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
* 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.
* 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.
* 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.
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.
* 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.
* 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.
* 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.