]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
9 years agocopy: fix copying of extents beyond the apparent file size
Dmitry Monakhov [Fri, 30 Oct 2015 22:04:46 +0000 (22:04 +0000)] 
copy: fix copying of extents beyond the apparent file size

fallocate can allocate extents beyond EOF via FALLOC_FL_KEEP_SIZE.
Where there is a gap (hole) between the extents, and EOF is within
that gap, the final hole wasn't reproduced, resulting in silent
data corruption in the copied file (size too small).

* src/copy.c (extent_copy): Ensure we don't process extents
beyond the apparent file size, since processing and allocating
those is not currently supported.
* tests/cp/fiemap-extents.sh: Renamed from tests/cp/fiemap-empty.sh
and re-enable parts checking the extents at and beyond EOF.
* tests/local.mk: Reference the renamed test.
* NEWS: Mention the bug fix.
Fixes http://bugs.gnu.org/21790

9 years agomd5sum,sha*sum: ensure --ignore-missing fails when no file verified
Pádraig Brady [Mon, 23 Nov 2015 17:11:26 +0000 (17:11 +0000)] 
md5sum,sha*sum: ensure --ignore-missing fails when no file verified

* src/md5sum.c (digest_check): Update a matched_checksums bool upon
matched checksum, and fail (loudly unless --status is specified)
if there were no matches.  Also change properly_formatted_lines
to a bool while at it since we don't need to track the plurality.
* tests/misc/md5sum.pl: Add a test case.
Suggested by Jim Meyering.

9 years agomd5sum,sha*sum: add --ignore-missing for checking a subset of files
Luther Thompson [Sun, 22 Nov 2015 21:47:59 +0000 (21:47 +0000)] 
md5sum,sha*sum: add --ignore-missing for checking a subset of files

* doc/coreutils.texi (md5sum invocation): Document the new option.
* src/md5sum.c (digest_file): Return an empty digest to indicate
a missing file.
(digest_check): Don't fail or output status given an empty checksum.
(usage): Document the new option.
(main): Process and validate the new option.
* tests/misc/md5sum.pl: Add new test cases.
* NEWS: Mention the new feature.
Fixes http://bugs.gnu.org/15604

9 years agomaint: allow 'sha*sum:' tag in commit summaries
Pádraig Brady [Mon, 23 Nov 2015 11:10:31 +0000 (11:10 +0000)] 
maint: allow 'sha*sum:' tag in commit summaries

To support "md5sum,sha*sum:"
Suggested by Bernhard Voelker.

9 years agodoc: give a tee example for combining process substitution outputs
Pádraig Brady [Fri, 20 Nov 2015 11:54:00 +0000 (11:54 +0000)] 
doc: give a tee example for combining process substitution outputs

This can be useful if you want to further process data
from process substitutions. For example:
  datagen | tee >(md5sum --tag) > >(sha256sum --tag) | sort

* doc/coreutils.texi (tee invocation): Mention that -p is
useful with pipes that may not consume all data.
Add an example, similar to the one above.
* THANKS.in: Add Jirka Hladky.

9 years agotests: avoid false failure on older NFS implementations
Pádraig Brady [Sat, 21 Nov 2015 10:59:37 +0000 (10:59 +0000)] 
tests: avoid false failure on older NFS implementations

* tests/ls/stat-failed.sh: Skip the test if 'd' is returned as the type,
and document where this was seen.  Also flag failure to write small
temp files during the test as an error rather than a failure.
Fixes http://bugs.gnu.org/21130

9 years agobuild: fix VPATH build with --disable-dependency-tracking
Pádraig Brady [Wed, 18 Nov 2015 14:21:45 +0000 (14:21 +0000)] 
build: fix VPATH build with --disable-dependency-tracking

* src/local.mk: Run `mkdir -p src` in all our explicit rules,
as in a VPATH build the src/ dir is only created at configure time
as a side effect of dependency tracking generation.

9 years agoscripts: update versions of gettext and libtool
Jim Meyering [Thu, 20 Aug 2015 15:50:31 +0000 (08:50 -0700)] 
scripts: update versions of gettext and libtool

9 years agomaint: remove unmaintained file, c99-to-c89.diff
Jim Meyering [Thu, 30 Jul 2015 00:40:08 +0000 (17:40 -0700)] 
maint: remove unmaintained file, c99-to-c89.diff

* src/c99-to-c89.diff: Remove file.
* src/local.mk (EXTRA_DIST): Remove it from this list.
* README (Pre-C99 build failure): Update section.

9 years agocsplit: check and report fwrite errors with errno
Assaf Gordon [Thu, 12 Nov 2015 10:20:29 +0000 (05:20 -0500)] 
csplit: check and report fwrite errors with errno

discussed in:
http://lists.gnu.org/archive/html/coreutils/2015-10/msg00091.html

* src/csplit.c: (save_line_to_file): check fwrite failures, report
  and exit immediately instead of deferring to 'close_output'.
* tests/misc/csplit-io-err.sh: test fwrite failure using LD_PRELOAD.
* tests/local.mk: add new test.

9 years agostat: improve support for new Linux pseudo FS and ACFS
Pádraig Brady [Wed, 11 Nov 2015 14:39:32 +0000 (14:39 +0000)] 
stat: improve support for new Linux pseudo FS and ACFS

* src/stat.c (human_fstype): Add new file system ID definitions.
* NEWS: Mention the improvement.

9 years agotests: ensure programs are built before testing
Pádraig Brady [Tue, 10 Nov 2015 14:05:50 +0000 (14:05 +0000)] 
tests: ensure programs are built before testing

programs may not be built due to missing system dependencies,
or any program can be excluded at configure time with
--enable-no-install-program.  So ensure we're not testing the
system versions in these cases.

* init.cfg (print_ver_): Call require_built_ first.
* tests/misc/tty-eof.pl: Skip programs not built.
* tests/Coreutils.pm (run_tests): Likewise.
* tests/misc/ls-misc.pl: Use 'env test' rather than abs path.
* tests/misc/test-diag.pl: Likewise.
* tests/local.mk: Adjust include order for dependencies.
* tests/misc/arch.sh: Remove redundant calls to require_built_.
* tests/misc/chroot-fail.sh: Likewise.
* tests/misc/groups-dash.sh: Likewise.
* tests/misc/groups-version.sh: Likewise.
* tests/misc/stdbuf.sh: Likewise.
* tests/cp/acl.sh: Remove problematic call to print_ver_ [gs]etfacl.
* tests/mv/acl.sh: Likewise.
* cfg.mk (sc_env_test_dependencies): A new syntax check to enforce
specifying dependencies with print_ver_ for programs
specified through the env command.
* du/bigtime.sh: Add new print_ver_ dependencies.
* du/max-depth.sh: Likewise.
* dd/ascii.sh: Likewise.
* tests/ls/capability.sh: Likewise.
* tests/ls/root-rel-symlink-color.sh: Likewise.
* tests/misc/chroot-fail.sh: Likewise.
* tests/misc/readlink-fp-loop.sh: Likewise.
* tests/misc/sort-debug-keys.sh: Likewise.
* tests/readlink/can-e.sh: Likewise.
* tests/readlink/can-f.sh: Likewise.
* tests/readlink/can-m.sh: Likewise.
* tests/tail-2/inotify-race.sh: Likewise.
* tests/tail-2/inotify-race2.sh: Likewise.
* tests/touch/no-create-missing.sh: Likewise.
* tests/touch/no-dereference.sh: Likewise.
* tests/misc/printenv.sh: Tweak to avoid syntax check trigger.
* tests/misc/help-version.sh: Likewise.
* tests/misc/yes.sh: Likewise.
* tests/misc/printf-quote.sh: Use previously unused $prog.
* configure.ac (EXTRA_MANS): Add $gl_no_install_prog to the list
so that check-x-vs-1 syntax check is satisfied.

9 years agomaint: use standard spacing in shebang line in tests
Pádraig Brady [Tue, 10 Nov 2015 12:59:40 +0000 (12:59 +0000)] 
maint: use standard spacing in shebang line in tests

It's better to be consistent even though spacing is insignificant:
http://www.in-ulm.de/~mascheck/various/shebang/#blankrequired

9 years agotests: cleanup trapping of signal names
Pádraig Brady [Mon, 9 Nov 2015 18:50:21 +0000 (18:50 +0000)] 
tests: cleanup trapping of signal names

A side effect of this cleanup is we no longer
depend on our own kill command being built.

* init.cfg (require_trap_signame_): A new function to verify
that the shell supports specifying traps by signal name.
(require_kill_group_): A new function to ensure the shell
supports sending a signal to a group.
* tests/du/move-dir-while-traversing.sh: Ensure trap supports
signal names.
* tests/misc/stty-invalid.sh: Likewise.
* tests/misc/stty-pairs.sh: Likewise.
* tests/misc/stty-row-col.sh: Likewise.
* tests/misc/stty.sh: Likewise.
* tests/misc/sort-compress.sh: Likewise.  Also simplify trap call.
* tests/install/trap.sh: Likewise.
* tests/misc/timeout.sh: Likewise.
* tests/dd/stats.sh: Likewise.  Also use default kill command.
* tests/misc/timeout-group.sh: Likewise.

9 years agotests: fix dirent d_type support verification
Pádraig Brady [Fri, 6 Nov 2015 16:31:22 +0000 (16:31 +0000)] 
tests: fix dirent d_type support verification

* init.cfg (require_dirent_d_type_): Don't use df -x
to exclude XFS, since this depends on a correct mtab
which is brittle and often not correct within chroots.
* tests/d_type-check: Check also the d_type of files,
which excludes XFS appropriately.  Specify all argument
and return types to avoid truncated pointers being passed,
which skipped the test due to crashes on x86_64 at least.
Simplify the C library lookup by reusing the interpreter's.

chroot issue reported at https://bugzilla.redhat.com/1263341

9 years agomaint: add a syntax check to avoid unstyled quoting
Pádraig Brady [Wed, 4 Nov 2015 02:44:41 +0000 (02:44 +0000)] 
maint: add a syntax check to avoid unstyled quoting

* src/paste.c (main): Use our styled wrapper for quotearg_colon().
* cfg.mk (sc_prohibit-quotearg): A new syntax check to avoid
future uses of unstyled quotearg to one of the internal slots,
and thus destined for diagnostic output.

9 years agopaste: avoid confusing backslash quoting in diagnostic
Pádraig Brady [Wed, 4 Nov 2015 01:14:33 +0000 (01:14 +0000)] 
paste: avoid confusing backslash quoting in diagnostic

* src/paste.c (main): Setting the quoting style to "escape"
went against the intent of the comment about presenting
doubled backslashes to the user.  Instead use "c-maybe"
which is the only mode which avoids doubled backslashes,
and provides protection against arbitrary control characters.
* tests/misc/paste.pl: Adjust accordingly.

9 years agols: default to --quoting=shell-escape for output to terminal
Pádraig Brady [Tue, 3 Nov 2015 16:32:08 +0000 (16:32 +0000)] 
ls: default to --quoting=shell-escape for output to terminal

* src/ls.c (decode_switches): Set "shell-escape" if isatty().
* doc/coreutils.texi (ls invocation): Update the defaults description.
* NEWS: Mention the change in behavior.  It should not have
backwards compat issues, but mentioning here just in case.

9 years agoprintf: support the %q format to quote for shell
Pádraig Brady [Tue, 3 Nov 2015 12:56:22 +0000 (12:56 +0000)] 
printf: support the %q format to quote for shell

* src/printf.c (usage): Mention the new format.
(print_formatted): Handle the quoting by calling
out to the quotearg module with "shell-escape" mode.
* doc/coreutils.texi (printf invocation): Document %q.
* tests/misc/printf-quote.sh: New test.
* tests/local.mk: Reference new test.
* NEWS: Mention the new feature.

9 years agols: avoid redundant processing when already escaping
Pádraig Brady [Tue, 3 Nov 2015 11:07:06 +0000 (11:07 +0000)] 
ls: avoid redundant processing when already escaping

This is mainly noticeable when the multi-byte code
within ls.c is triggered by multi-byte quotes.

$ seq 200000 | xargs touch
$ time ls-old -U --quoting=locale --hide-control-chars >/dev/null
real    0m0.483s
$ time ls-new -U --quoting=locale --hide-control-chars >/dev/null
real    0m0.430s

* src/ls.c (quote_name): Avoid rescanning the output looking for
unprintable chars when we know the quoting mode already escapes them.
* tests/misc/ls-misc.pl: Add tests for all quoting modes, with and
without -q, to verify this assumption.

9 years agols: document and test new shell-escape quoting
Pádraig Brady [Tue, 3 Nov 2015 10:13:11 +0000 (10:13 +0000)] 
ls: document and test new shell-escape quoting

* doc/coreutils.texi (ls invocation): Describe the new
'shell-escape' and 'shell-escape-always' quoting options.
* src/ls.c (usage): Mention the new quoting options.
* tests/misc/ls-misc.pl: Add a test for 'shell-escape'

9 years agotest: use consistent quoting
Pádraig Brady [Tue, 3 Nov 2015 09:49:50 +0000 (09:49 +0000)] 
test: use consistent quoting

* src/test.c (test_syntax_error): Reuse verror() rather than
open coding the error output format.
(term): Don't hardcode '' quoting.
(main): Likewise.

9 years agoall: avoid quoting file names when possible
Pádraig Brady [Sun, 1 Nov 2015 18:53:26 +0000 (18:53 +0000)] 
all: avoid quoting file names when possible

Quote file names using the "shell-escape" or "shell-escape-always"
methods, which quote as appropriate for most shells,
and better support copy and paste of presented names.
The "always" variant is used when the file name is
embedded in an error message with surrounding spaces.

* cfg.mk (sc_error_shell_quotes): A new syntax check rule
to suggest quotef() where appropriate.
(sc_error_shell_always_quotes): Likewise for quoteaf().
* src/system.h (quotef): A new define to apply shell quoting
when needed.  I.E. when shell character or ':' is present.
(quoteaf): Likewise, but always quote.
* src/*.c: Use quotef() and quoteaf() rather than quote()
where appropriate.
* tests/: Adjust accordingly.

9 years agobuild: update gnulib submodule to latest
Pádraig Brady [Mon, 2 Nov 2015 12:43:33 +0000 (12:43 +0000)] 
build: update gnulib submodule to latest

Includes support for "shell-escape" from quotearg

9 years agomd5sum: ensure a single status line per file
Pádraig Brady [Sun, 1 Nov 2015 18:48:22 +0000 (18:48 +0000)] 
md5sum: ensure a single status line per file

* src/md5sum.c: Use the same file name escaping method used
when generating and checking checksums.  I.E. ensure a single line
per file by starting the line with '\' for any file name containing '\n'
and replacing those with "\\n".
* NEWS: Move the item from changes in behavior to improvements,
since this is no longer a backwards incompat change when
processing stdout status messages.
* tests/misc/md5sum.pl: Remove quotes from expected status output.
* tests/misc/sha1sum.pl: Likewise.

9 years agoall: replace most uses of quotearg_colon() with quote()
Pádraig Brady [Wed, 28 Oct 2015 13:02:31 +0000 (13:02 +0000)] 
all: replace most uses of quotearg_colon() with quote()

Related to commit v8.24-61-g6796698 this provides
more consistent quoting, as quotearg_colon() defaults
to "literal" quoting by default, while quote()
provides appropriate quoting for diagnostics by default.

* gl/modules/randread: Depend on quote module rather than quotearg.
* gl/lib/randread.c: Used quote() not quotearg_colon().
* src/: Likewise.
* src/shred.c: Likewise. Also avoid unnecessary quoting
introducing overhead when wiping names.
* cfg.mk: Relax the matching expression to allow
"qname" variables as used in shred.c to satisfy the check.
* tests/: Adjust accordingly.

9 years agodoc: fix texinfo for short options taking a parameter
Pádraig Brady [Sun, 1 Nov 2015 20:37:00 +0000 (20:37 +0000)] 
doc: fix texinfo for short options taking a parameter

* doc/coreutils.texi: (tail invocation): Add missing -s,
along with the existing --sleep-interval description.
(csplit invocation): s/--suffix/--suffix-format/.
(head invocation): Use same variable (COUNT) for -n and --head-count.
(seq invocation): Add opindex items for all options.
(ptx invocation): Likewise.
Fix typo s/--flac-truncation/--flag-truncation/.
(touch invocation): State explicitly that -d takes a parameter,
which also indicates that an '=' is not to be used
for the short option syntax.
(ls invocation): Likewise for the -w option.
Fixes http://bugs.gnu.org/21809

9 years agomaint: allow 'all:' tag in commit summaries
Pádraig Brady [Wed, 28 Oct 2015 10:56:56 +0000 (10:56 +0000)] 
maint: allow 'all:' tag in commit summaries

To tag changes that are user visible
and affect all (or many) commands.

9 years agodoc: clarify iso-8601 formats used by ls and du
Pádraig Brady [Wed, 28 Oct 2015 13:50:40 +0000 (13:50 +0000)] 
doc: clarify iso-8601 formats used by ls and du

* doc/coreutils.texi (du invocation): Remove 'like' from
mentions of ISO-8601 as the components are individually conformant.
(ls invocation): Likewise, except for --time-style=iso for recent
files, where the MM-DD component is not a valid ISO-8601 timestamp.

9 years agodate: use extended format timezone for --iso-8601
Pádraig Brady [Fri, 23 Oct 2015 02:19:18 +0000 (03:19 +0100)] 
date: use extended format timezone for --iso-8601

* src/date.c (main): Use %:z rather than %z with --iso-8601
as the standard states to consistently use extended format.
Note either format can be parsed by date.
* tests/misc/date.pl: Adjust accordingly.
* doc/coreutils.texi (du invocation): Clarify that "iso"
time styles are only similar to ISO-8601.
(ls invocation): Likewise.
(date invocation): Adjust the comment stating
that only --rfc-3339 output can be parsed by date(1).
* NEWS: Mention the change in behavior.
Reported at http://bugs.debian.org/799479

9 years agodoc: reference related commands from users(1) and groups(1)
Pádraig Brady [Thu, 22 Oct 2015 15:48:32 +0000 (16:48 +0100)] 
doc: reference related commands from users(1) and groups(1)

* man/users.x: See also getent, who
* man/groups.x: See also getent
Addresses http://bugs.gnu.org/21735

9 years agocopy,dd: simplify and optimize NUL bytes detection
Pádraig Brady [Thu, 22 Oct 2015 13:34:08 +0000 (14:34 +0100)] 
copy,dd: simplify and optimize NUL bytes detection

* src/factor.c: Move LIKELY() definition to...
* src/system.h: ...here.
(is_nul): Reimplement with a version that doesn't
require a sentinel after the buffer, and which calls
down to (the system optimized) memcmp.
Performance analyzed at http://rusty.ozlabs.org/?p=560
* src/dd.c (alloc_obuf): Simplify the is_nul() call by
not needing to write the sentinel.
* src/copy.c (sparse_copy): Likewise.
(copy_reg): Simplify the buffer allocation by avoiding
consideration of the sentinel in the buffer size calculation.

9 years agoall: quote string arguments in error messages
Pádraig Brady [Tue, 27 Oct 2015 13:13:59 +0000 (13:13 +0000)] 
all: quote string arguments in error messages

These strings are often file names or other user specified
parameters, which can give confusing errors in
the presence of unexpected characters for example.

* cfg.mk (sc_error_quotes): A new syntax check rule.
* src/*.c: Wrap error() string arguments with quote().
* tests/: Adjust accordingly.
* NEWS: Mention the improvement.

9 years agomd5sum: quote all printed file names
Pádraig Brady [Mon, 26 Oct 2015 01:26:04 +0000 (01:26 +0000)] 
md5sum: quote all printed file names

This is especially significant when using --check
with files generated on a windows system, where the \r
characters produce corrupted and confusing error messages.
This also ensures status messages are output on a single line.

* src/md5sum.c: Use quote() for printed file names.
* tests/misc/md5sum.pl: Adjust accordingly.
* NEWS: Mention the change in behavior.
Fixes http://bugs.gnu.org/21757

9 years agols: fix off by one error when determining max display columns
Pádraig Brady [Wed, 21 Oct 2015 12:57:41 +0000 (13:57 +0100)] 
ls: fix off by one error when determining max display columns

* src/ls.c (main): Account for the first column not including
a separator when calculating max_idx.
* tests/ls/w-option.sh: Add a test case.
* NEWS: Mention the bug fix.

9 years agols: allow -w0 to mean no limit on line length
Pádraig Brady [Tue, 20 Oct 2015 13:42:39 +0000 (14:42 +0100)] 
ls: allow -w0 to mean no limit on line length

* src/ls.c (print_with_separator): Renamed from print_with_commas,
and parameterized to accept the separator to print.
Also fix an edge case where '\n' not printed when
the POS variable overflows SIZE_MAX.
(print_current_files): Degenerate -x and -C to using the
cheaper print_with_separator() in the -w0 case.
* doc/coreutils.texi (ls invocation): Document the new feature.
* tests/ls/w-option.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.
Fixes http://bugs.gnu.org/21325

9 years agols: detect terminal color support using glob patterns
Pádraig Brady [Mon, 19 Oct 2015 11:48:49 +0000 (12:48 +0100)] 
ls: detect terminal color support using glob patterns

* src/ls.c (know_term_type): Corresponding to commit v8.24-48-gc249a5a,
use fnmatch to inspect the dircolors database.  Noticed due to
failing tests/ls/color-{dtype-dir,term}.sh tests.

9 years agotests: adjust recent change to csplit VM limit
Pádraig Brady [Mon, 19 Oct 2015 10:25:42 +0000 (11:25 +0100)] 
tests: adjust recent change to csplit VM limit

* tests/misc/csplit-heap.sh: A little more memory is required
for the full run case.  Noticed with --enable-single-binary.

9 years agomaint: fixes to support improved sc_tight_scope
Pádraig Brady [Sun, 18 Oct 2015 21:09:19 +0000 (22:09 +0100)] 
maint: fixes to support improved sc_tight_scope

The gnulib provided sc_tight_scope target was ineffective,
as it was checking against an invalid blank regular expression,
and thus ignoring any extern function issues.  This is now
fixed up in gnulib, and so we need to fix our scoping issues
before the next gnulib update.

* cfg.mk: Setup and document the tight_scope config variables
appropriately.
* src/selinux.h: Since declared in *_SOURCES, use the two line
form for the extern function declarations.
* src/set-fields.h: Add the extern declarations, and since declared
in noinst_HEADERS use the single line form.

9 years agotests: avoid failure when auto selecting factor tests
Pádraig Brady [Sun, 18 Oct 2015 01:27:22 +0000 (02:27 +0100)] 
tests: avoid failure when auto selecting factor tests

* tests/factor/run.sh: If this template is found through
`grep -El "print_ver_.* factor"` for example, then just skip it.

9 years agofactor: remove unreachable SQUFOF code at compile time
Pádraig Brady [Sat, 17 Oct 2015 10:38:20 +0000 (11:38 +0100)] 
factor: remove unreachable SQUFOF code at compile time

It was a little confusing as to whether the SQUFOF algorithm was
enabled, and in fact there were no options available to enable it.
Therefore clarify the 3 configurable behaviors for the code to
3 defines at the top of the program, and only include the SQUFOF
code if enabled at compile time.

$ size src/factor-before
   text    data     bss
  93997    1412    2504
$ size src/factor-after
   text    data     bss
  87885    1404    2504

* src/factor.c: Only include the SQUFOF factor code
when enabled via the USE_SQUFOF define.
* doc/coreutils.texi (factor invocation): Update note about
factor limits, as we can factor 128 bit numbers without GMP.

9 years agodoc: reference shuf(1) from the sort (-R) man page
Pádraig Brady [Sun, 18 Oct 2015 01:48:05 +0000 (02:48 +0100)] 
doc: reference shuf(1) from the sort (-R) man page

* man/sort.x: Cross reference with shuf(1).
* src/sort.c (usage): Mention shuf(1) with -R option.
Suggested in http://bugs.debian.org/641166

9 years agomaint: avoid duplicate test runs
Bernhard Voelker [Sun, 18 Oct 2015 10:46:05 +0000 (12:46 +0200)] 
maint: avoid duplicate test runs

* tests/local.mk (all_tests): Remove the tests 'tests/id/setgid.sh' and
'tests/mkdir/smack-root.sh' because they are mentioned in the
'all_root_tests' list; these tests are skipped anyway during a non-root
run because flagged with 'require_root_'.

9 years agodoc: remove obsolete performance comment
Paul Eggert [Fri, 16 Oct 2015 19:05:58 +0000 (12:05 -0700)] 
doc: remove obsolete performance comment

sha512sum can be faster than sha256sum.
E.g., ‘dd if=/dev/zero bs=1024k count=1024 | time sha256sum’
reports 8.16 user CPU seconds on my host, whereas sha512sum
consumes 5.45 seconds (Fedora x86-64 on an AMD Phenom II X4 910e).
Although sha512sum is still considerably slower on x86, a good
chunk of uses are on 64-bit hosts and anyway there’s little point
to scaring people away from sha512sum nowadays.
* doc/coreutils.texi (sha2 utilities): Remove obsolete comment.

9 years agomaint: avoid uniq.c warning from bleeding-edge gcc's -Wstrict-overflow
Jim Meyering [Thu, 15 Oct 2015 16:09:18 +0000 (09:09 -0700)] 
maint: avoid uniq.c warning from bleeding-edge gcc's -Wstrict-overflow

* src/uniq.c (main): Make the type of "nfiles" unsigned,
to avoid a brand new warning from a gcc I built from today's
sources (gcc version 6.0.0 20151015 (experimental) (GCC)):
src/uniq.c:523:14: error: assuming signed overflow does not occur \
  when simplifying conditional to constant [-Werror=strict-overflow]
           if (nfiles == 2)
              ^

9 years agodircolors: support globbing of TERM entries
Pádraig Brady [Tue, 13 Oct 2015 11:40:52 +0000 (12:40 +0100)] 
dircolors: support globbing of TERM entries

* src/dircolors.c (dc_parse_stream): Support globbing of
TERM entries, to allow entries like "TERM *256color*" for example.
* src/dircolors.hin: Reduce the internal list with globbing.
* tests/misc/dircolors.pl: New test cases.
* NEWS: Mention the improvement.

9 years agotests: avoid false failure in rm/r-root.sh with gdb warnings
Pádraig Brady [Thu, 15 Oct 2015 09:22:20 +0000 (10:22 +0100)] 
tests: avoid false failure in rm/r-root.sh with gdb warnings

* tests/rm/r-root.sh: Skip the test if there are gdb warnings
that will impact further stderr checks.  For example some
buggy gdb versions may report "Got object file from memory
but can't read symbols: File truncated".  Also fix an incorrect
stderr check from the previous change.
Reported by Bernhard Voelker.

9 years agotests: avoid false failure in rm/r-root.sh under load
Pádraig Brady [Wed, 14 Oct 2015 22:26:22 +0000 (23:26 +0100)] 
tests: avoid false failure in rm/r-root.sh under load

* tests/rm/r-root.sh: Use gdb rather than timeout(1) as the
last resort protection against unlinkat() calls.  The timeout
of 2s was susceptible to false positives under load, and
gdb is stronger protection in any case.  We remove the
"expensive" tag on this test also since it should be robust.
Reported by Jim Meyering.

9 years agotests: avoid false failure in a tail test under load
Pádraig Brady [Thu, 15 Oct 2015 02:16:50 +0000 (03:16 +0100)] 
tests: avoid false failure in a tail test under load

* tests/tail-2/follow-stdin.sh: Use the standard tail
testing framework to avoid the race seen under very high load,
and also test the non inotify case.
Reported by Jim Meyering

9 years agotests: avoid false failures with default ACLs
Pádraig Brady [Wed, 14 Oct 2015 14:18:34 +0000 (15:18 +0100)] 
tests: avoid false failures with default ACLs

To reproduce:
  setfacl -dm group::rx .
  setfacl -dm other::rx .
  make check

* init.cfg (require_no_default_acl_): A new function to skip
when default ACLs are detected, or if the getfacl utility is
not available then skip if any non LSM ACLs detected.
* tests/cp/existing-perm-race.sh: Call require_no_default_acl_.
* tests/mkdir/parents.sh: Likewise.
* tests/mkdir/perm.sh: Likewise.

9 years agotail: no longer warn about unrecognized file systems
Pádraig Brady [Mon, 12 Oct 2015 00:37:44 +0000 (01:37 +0100)] 
tail: no longer warn about unrecognized file systems

* src/tail.c (fremote): No longer prompt the user to email
with the unrecognized file system constant, since we have
process in place to sync periodically with the latest Linux
constants, and the fall back polling mode is still fully functional.

9 years agotests: avoid false failure when restorecon is ineffective
Pádraig Brady [Sat, 10 Oct 2015 15:55:20 +0000 (16:55 +0100)] 
tests: avoid false failure when restorecon is ineffective

* tests/cp/cp-a-selinux.sh: Ensure we skip the portion of the test
depending on restorecon to be effective.  I.E. also skip when restorecon
warns, as it doesn't exit with error status when matchpathcon fails to
find a match for a file.  This is the case in /tmp on Fedora for
example, in which case the new destination that cp creates will have the
default security context of the process, rather than the explicit
context we set on the source file.
Details at: http://bugzilla.redhat.com/1247641

9 years agotests: make a long running test responsive to Ctrl-C
Pádraig Brady [Sat, 10 Oct 2015 02:59:53 +0000 (03:59 +0100)] 
tests: make a long running test responsive to Ctrl-C

* tests/misc/sort-compress-hang.sh: Use --foreground with the
timeout(1) command (noting the caveats), to run the sort command
in the foreground program group, and thus be responsive to Ctrl-C.
This very_expensive_ test takes over a minute on a i3-2310M,
with RAM backed /tmp.

9 years agotests: adjust recent changes to virtual memory limits
Pádraig Brady [Thu, 8 Oct 2015 02:41:07 +0000 (03:41 +0100)] 
tests: adjust recent changes to virtual memory limits

* tests/dd/no-allocate.sh: Account for timeout(1) when
determining the required mem, as timeout has additional shared libs.
This avoids the need for the hardcoded 4M addition to the limit.
* tests/misc/head-c.sh: Increase the base limit, to account for
the fact that head(1) will allocate some additional mem in this case.
* tests/misc/cut-huge-range.sh: Remove mention of specific limits.
* tests/misc/printf-surprise.sh: Likewise.
Reported by Dmitry V. Levin

9 years agocsplit: remove erroneous mention of -m in --help
Pádraig Brady [Tue, 6 Oct 2015 10:22:33 +0000 (11:22 +0100)] 
csplit: remove erroneous mention of -m in --help

* src/csplit.c (usage): -m is not accepted, only --suppress-matched.
* tests/misc/csplit-suppress-matched.pl: Spelling fix.

Reported by Ondrej Oprala

9 years agotee: simplify argv handling
Paul Eggert [Sun, 4 Oct 2015 00:01:32 +0000 (17:01 -0700)] 
tee: simplify argv handling

* src/tee.c (tee_files): Last arg is now char ** instead of char
const **, as that is a bit simpler.  All callers changed.  Modify
files[-1], not files[nfiles], as that is a bit faster and simpler.
Latter problem pointed out by Rainer Deyke in:
http://bugs.gnu.org/21611

9 years agobuild: update gnulib submodule to latest
Paul Eggert [Sat, 3 Oct 2015 07:25:27 +0000 (00:25 -0700)] 
build: update gnulib submodule to latest

9 years agobuild: Pacify GCC 5 on 32-bit hosts
Paul Eggert [Sat, 3 Oct 2015 07:24:43 +0000 (00:24 -0700)] 
build: Pacify GCC 5 on 32-bit hosts

This pacifies GCC 5 in a better way, without disabling diagnostics.
* src/df.c (main): Tell compiler that optind is positive.
* src/shred.c (known): New function.
(dopass): Go back to off_t for file sizes.
Avoid integer overflow if we run off the end of the file.
Tell compiler that a write cannot write more bytes than requested.

9 years agotail: handle kernel dentry unlink race
Pádraig Brady [Thu, 2 Jul 2015 07:41:25 +0000 (08:41 +0100)] 
tail: handle kernel dentry unlink race

Avoid the intermittent loss of "... has become inaccessible" messages.
That would cause tests/tail-2/assert.sh to fail sometimes,
mainly on uniprocessor systems.

* src/tail.c (tail_forever_inotify): Also monitor IN_DELETE
events on the directory, to avoid a dentry unlink()..open() race,
where the open() on the deleted file was seen to succeed after an,
unlink() and a subsequent IN_ATTRIB, was sent to tail.  Note an
IN_ATTRIB is sent on the monitored file to indicate the change in
number of links, and we can't just use a decrease in the number of
links to determine the file being unlinked, due to the possibility
of the file having multiple links.

Reported by Assaf Gordon and Ludovic Courtès.
Fixes http://bugs.gnu.org/21460

9 years agobuild: avoid -Wstrict-overflow warnings with GCC 5.1 on 32 bit
Pádraig Brady [Fri, 2 Oct 2015 19:28:37 +0000 (20:28 +0100)] 
build: avoid -Wstrict-overflow warnings with GCC 5.1 on 32 bit

* src/shred.c (dopass): With -O2, GCC 5.1 gives "assuming signed
overflow does not occur when simplifying conditional to constant"
warnings, in regard to the signed (off_t) variables.  Therefore
use unsigned (uintmax_t) instead, and a separate boolean to cater
for the special meaning of the negative part of the integer range.
Noticed at http://hydra.nixos.org/build/24983447

9 years agobuild: update gnulib submodule to latest
Pádraig Brady [Sat, 3 Oct 2015 01:52:31 +0000 (02:52 +0100)] 
build: update gnulib submodule to latest

Includes a change to xalloc.h to avoid -Wstrict-overflow warnings
with GCC 5.1 on 32 bit with optimization enabled.  A subsequent
commit will fix similar issues in shred.

9 years agodircolors: add xterm-termite entry
Dario Giovannetti [Fri, 2 Oct 2015 15:56:49 +0000 (16:56 +0100)] 
dircolors: add xterm-termite entry

* src/dircolors.hin: Add "xterm-termite" as this VTE based terminal
emulator is quite different from xterm, despite the name.
For example "Termite supports italic text and it won't work if TERM
is set to xterm. Even the backspace key won't work properly anymore
for applications relying on terminfo".
Reported also by Lukas Sabota and Sven-Hendrik Haase.

9 years agodf: prioritize mounts nearer the device root
Dave Chiluk [Mon, 21 Sep 2015 20:04:11 +0000 (15:04 -0500)] 
df: prioritize mounts nearer the device root

In the presence of bind mounts of a device, the 4th "mount root" field
from /proc/self/mountinfo is now considered, so as to prefer mount
points closer to the root of the device.  Note on older systems with
an /etc/mtab file, the source device was listed as the originating
directory, and so this was not an issue.
Details at http://pad.lv/1432871

* src/df.c (filter_mount_list): When deduplicating mount entries,
only prefer sources nearer or at the root of the device, when the
target is nearer the root of the device.
* NEWS: Mention the change in behavior.

9 years agobuild: update gnulib submodule to latest
Pádraig Brady [Tue, 22 Sep 2015 21:26:40 +0000 (22:26 +0100)] 
build: update gnulib submodule to latest

This includes a change to propagate the 4th "mount root"
field from /proc/self/mountinfo from the mountlist module,
which is needed in a subsequent commit in df.

* gl/lib/regcomp.c.diff: Regenerate against latest gnulib.
* gl/lib/regex_internal.c.diff: Likewise.
* gl/lib/regex_internal.h.diff: Likewise.
* cfg.mk: Exclude diffs from trailing whitespace check,
which is generally correct, and now needed.

9 years agomaint: use adaptive approach for `ulimit -v` based tests
Bernhard Voelker [Tue, 22 Sep 2015 21:23:26 +0000 (23:23 +0200)] 
maint: use adaptive approach for `ulimit -v` based tests

When configured with either 'symlinks' or 'shebangs' as value for
the --enable-single-binary option, tests based on `ulimit -v` are
skipped.  The reason is that the multicall 'coreutils' binary requires
much more memory due to shared libraries being loaded, and the size of
the 'date' binary (~290KiB) compared to the multicall binary (~5MiB),
of course.  Finally, in the case of 'shebangs', the starting shell
requires more memory, too

Instead of using hard-coded values for the memory limit, use an
adaptive approach: first determine the amount of memory for a similar,
yet more trivial invocation of the command, and then do the real test
run using that limit (plus some buffer in some cases).

* init.cfg (require_ulimit_v_): Remove function.
(get_min_ulimit_v_): Add function to determine the minimum memory limit
required for a given command in an adaptive way.
* cfg.mk (sc_prohibit_test_ulimit_without_require_): Change the name
of the above function in the syntax-check rule.
* tests/cp/link-heap.sh: Use the above function to determine the
minimum memory required to run a command simpler than in the real test
run.  Use that limit plus a buffer there.  While at it, change to list
of commands in the subshell to fail also if the beginning `ulimit -v`
fails.
* tests/dd/no-allocate.sh: Likewise.
* tests/misc/csplit-heap.sh: Likewise.
* tests/misc/cut-huge-range.sh: Likewise.
* tests/misc/head-c.sh: Likewise.
* tests/misc/printf-surprise.sh: Likewise.
* tests/split/line-bytes.sh: Likewise.
* tests/rm/many-dir-entries-vs-OOM.sh: Likewise - doing it separately
for each program under test.

9 years agomaint: avoid deprecation warning with <selinux/flask.h>
Pádraig Brady [Tue, 22 Sep 2015 18:07:41 +0000 (19:07 +0100)] 
maint: avoid deprecation warning with <selinux/flask.h>

* src/runcon.c (main): As per the compile time warning from
libselinux-2.4-3, lookup the class with string_to_security_class(),
rather than using defines from flask.h.

9 years agosort,numfmt: with --debug, diagnose failure to set locale
Pádraig Brady [Tue, 22 Sep 2015 01:07:41 +0000 (02:07 +0100)] 
sort,numfmt: with --debug, diagnose failure to set locale

* src/sort.c (main): With --debug, warn upon setlocale() failure,
which can happen due to incorrectly specified environment variables,
or due to memory exhaustion (simulated with ulimit -v), etc.
* tests/misc/sort-debug-warn.sh: Add a test case.
See also http://savannah.gnu.org/bugs/11004

9 years agodu: avoid to stat all mount points if possible
Bernhard Voelker [Fri, 18 Sep 2015 11:29:17 +0000 (13:29 +0200)] 
du: avoid to stat all mount points if possible

du calls stat for each mount point at startup.  This would block or
even make du fail if stat for an unrelated mount point hangs.
The result is not needed in the normal case anyway and therefore
should be avoided.  Issue introduced in commit v8.19-2-gcf7e1b5.

* src/du.c (fill_mount_table): Move function up as it's not used ...
(mount_point_in_fts_cycle): ... here, i.e., the DI_MNT set is
initialized and filled only iff FTS has detected a directory cycle.
(main): Remove the initialization and filling of the DI_MNT set here,
and free the DI_MNT set only if it was used.

9 years agoshred: don’t document -NUMBER option
Paul Eggert [Thu, 17 Sep 2015 07:37:30 +0000 (00:37 -0700)] 
shred: don’t document -NUMBER option

The -NUMBER option was removed from ‘shred’ in 1999, but the
manual wasn’t updated to match.  Problem reported by Nick Rose in:
http://bugs.gnu.org/21502
* doc/coreutils.texi (shred invocation):
Remove documentation for -NUMBER option.

9 years agonumfmt: use new set-fields module to parse --field
Assaf Gordon [Sat, 18 Jul 2015 03:58:31 +0000 (23:58 -0400)] 
numfmt: use new set-fields module to parse --field

numfmt --field=LIST can accept the same options as cut.

* bootstrap.conf: remove xlist, linked-list
* src/local.mk: link numfmt with set-fields
* src/numfmt.c: use set-fields.c instead of custom field parsing code.
  (include_field): adapt to new code.
* tests/misc/numfmt.pl: add new tests, adapt current tests to new
  error message wording from set-fields.c

9 years agocut: refactor into set-fields module
Assaf Gordon [Sat, 18 Jul 2015 03:30:30 +0000 (23:30 -0400)] 
cut: refactor into set-fields module

Extract the functionality of parsing --field=LIST into a separate
module, to be used by other programs.

* src/cut.c: move field parsing code from here ...
* src/set-fields.{c,h}: ... to here.
  (set_fields): generalize by supporting multiple parsing/reporting
  options.
  (struct range_pair): rename to field_range_pair.
* src/local.mk: link cut with set-field.
* po/POTFILES.in: add set-field.c
* tests/misc/cut.pl: update wording of error messages

9 years agomaint: fix heap manipulations in previous commit
Pádraig Brady [Tue, 8 Sep 2015 11:53:11 +0000 (12:53 +0100)] 
maint: fix heap manipulations in previous commit

* src/sort.c (main): Ensure we don't free() and invalid
pointer when reading implicit stdin.  Also avoid
"definitely lost" valgrind warnings in the --files0-from case.

9 years agomaint: avoid "definitely lost" valgrind warnings
Pádraig Brady [Fri, 4 Sep 2015 13:38:06 +0000 (14:38 +0100)] 
maint: avoid "definitely lost" valgrind warnings

Since commit v8.23-19-g8defcee, main() will return,
rather than call exit(), this inducing "definitely lost"
warnings in valgrind's leak checker.  That precludes using
the following to flag memory leaks:

  valgrind --leak-check=full --error-exitcode=1 \
           --errors-for-leak-kinds=definite

* src/pr.c (main): In dev builds, explicitly free memory allocated.
* src/sort.c (main): Likewise.
* src/tail.c (main): Likewise.
* src/tsort.c (tsort): Likewise.

9 years agotests: test numfmt stdin behavior
Pádraig Brady [Wed, 2 Sep 2015 23:34:27 +0000 (00:34 +0100)] 
tests: test numfmt stdin behavior

* tests/misc/tty-eof.pl: Add numfmt to the list of programs
that accept input on stdin.

9 years agols,ptx: restrict quotearg use to file name output
Pádraig Brady [Sun, 16 Aug 2015 15:47:17 +0000 (16:47 +0100)] 
ls,ptx: restrict quotearg use to file name output

* src/ls.c (getenv_quoting_style, decode_switches, parse_ls_color):
Use quote() rather than quotearg(), as the latter defaults to
outputting the input unquoted.
* src/ptx.c (main): Likewise.

9 years agobase64: no longer support hex or oct --wrap params
Pádraig Brady [Mon, 17 Aug 2015 04:45:47 +0000 (21:45 -0700)] 
base64: no longer support hex or oct --wrap params

* src/base64.c (main): Support decimal numbers with leading zeros,
by disabling the auto detection of octal and hex.  It's not
envisaged that base conversion is needed for --wrap parameters,
and in the edge case it is, $((0x0)) shell constructs can be used.
* tests/misc/base64.pl: Adjust accordingly.
* NEWS: Mention the change in behavior.

9 years agobase64: use stricter validation on wrap column
Pádraig Brady [Sun, 16 Aug 2015 14:31:17 +0000 (15:31 +0100)] 
base64: use stricter validation on wrap column

* src/base64.c (main): Use the higher level xnumtoumax()
rather than xstrtoumax(), which is simpler and improves
validation of input.  Also pass the _empty_ rather than NULL
string as the suffixes parameter so that invalid trailing
characters are not allowed.  For example -w08 is now
flagged as an error, rather than being interpreted as 0.
A subsequent commit will further improve verification
of numbers with leading zeros by dropping backwards compatibility
wrt auto parsing oct and hex numbers.
* tests/misc/base64.pl: Add tests for invalid wrap values.

9 years agobase32: A new program similar to base64
Pádraig Brady [Wed, 5 Aug 2015 08:28:36 +0000 (10:28 +0200)] 
base32: A new program similar to base64

Suggested in https://bugzilla.redhat.com/1250113

* AUTHORS: Add base32.
* THANKS.in: Add suggester.
* README: Reference the new program.
* NEWS: Mention the new program.
* src/.gitignore: Ignore the new binary.
* bootstrap.conf: Reference the gnulib base32 module.
* build-aux/gen-lists-of-programs.sh: Add base32.
* man/base32.x: A new template.
* man/.gitignore: Ignore the new man page.
* man/local.mk: Reference the new man page.
* doc/coreutils.texi (base32 invocation): Document the new command.
* src/local.mk: Adjust to build base32 based on base64.c.
* src/base64.c: Parameterize to use the correct headers,
functions and buffer sizes, depending on which binary
is being built.
* tests/misc/base64.pl: Adjust to test both base32 and base64.
* tests/misc/tty-eof.pl: Add base32 as a program that
accepts input on stdin without any options specified.
* scripts/git-hooks/commit-msg: Add base32 to the template.

9 years agobuild: update gnulib submodule to latest
Pádraig Brady [Tue, 1 Sep 2015 16:42:33 +0000 (17:42 +0100)] 
build: update gnulib submodule to latest

This includes a tweak to support building
the gnulib base32 module with -Wsuggest-attribute=const

9 years agodoc: clarify in --help/man where short options take no param
Pádraig Brady [Mon, 31 Aug 2015 17:07:34 +0000 (18:07 +0100)] 
doc: clarify in --help/man where short options take no param

* src/shred.c (usage): For -u, separate the decscription
of the short and long option, to clarify that the short option
takes no parameter.
* src/split.c (usage): Likewise for -d.
* src/tee.c (usage): Likewise for -p.
* src/uniq.c (usage): Likewise for -D.

Suggested by Stephane Chazelas

9 years agotests: avoid FP of ls/stat-free-color.sh with newer glibc
Bernhard Voelker [Sun, 30 Aug 2015 20:49:35 +0000 (22:49 +0200)] 
tests: avoid FP of ls/stat-free-color.sh with newer glibc

Since glibc-2.22, specifically commit [0], the opendir() implementation
implicitly makes an additional stat call thus leading to a FP.
Seen on openSUSE:Tumbleweed since snapshot 20150821.

[0]
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=46f894d8c60a

* tests/ls/stat-free-color.sh: Change the test to verify that ls(1)
needs the same number of stat-like calls for a single, empty directory
argument as for one with a few directory entries (sub-directory,
regular file, symlink, etc.).

9 years agodoc: clarify where ambiguous if short options take no param
Pádraig Brady [Thu, 27 Aug 2015 14:50:07 +0000 (15:50 +0100)] 
doc: clarify where ambiguous if short options take no param

* doc/coreutils.texi (split invocation): Clarify that -d takes no param.
(uniq invocation): Likewise for -D.
(shred invocation): Likewise for -u.
(tee invocation): Likewise for -p.

9 years agols: allow -w18446744073709551616
Paul Eggert [Sun, 23 Aug 2015 01:30:36 +0000 (18:30 -0700)] 
ls: allow -w18446744073709551616

Problem reported by Beco in: http://bugs.gnu.org/21325
* src/ls.c (set_line_length): New function.
(decode_switches): Use it to decode COLUMNS and -w.

9 years agomaint: add syntax check to ensure larger man/*.x files have a Copyright
Bernhard Voelker [Tue, 18 Aug 2015 18:27:48 +0000 (20:27 +0200)] 
maint: add syntax check to ensure larger man/*.x files have a Copyright

* cfg.mk (sc_man_check_x_copyright): Add rule to ensure that non-trivial
.x files in the 'man/' subdirectory, i.e., files exceeding a line count
of 20 or a byte count of 1000, contain a proper Copyright notice.

10 years agobuild: fprintftime/nstrftime API changes
Paul Eggert [Fri, 24 Jul 2015 01:49:31 +0000 (18:49 -0700)] 
build: fprintftime/nstrftime API changes

* bootstrap.conf (gnulib_modules): Add time_rz,
since the main source code now uses timezone_t.
* src/date.c (batch_convert, main, show_date):
* src/ls.c (align_nstrftime, long_time_expected_width)
(print_long_format):
* src/stat.c (human_time):
Use timezone_t rather than boolean to specify which time zone
is wanted.
* src/ls.c (localtz): New static var.
(main): Initialize it.

10 years agobuild: update gnulib submodule to latest
Paul Eggert [Fri, 24 Jul 2015 01:33:59 +0000 (18:33 -0700)] 
build: update gnulib submodule to latest

10 years agodoc: discourage use of uname -i and -p options
Pádraig Brady [Tue, 21 Jul 2015 09:17:43 +0000 (10:17 +0100)] 
doc: discourage use of uname -i and -p options

* src/uname.c (usage): State that the non POSIX -i and -p options
are non-portable.
* doc/coreutils.texi (uname invocation): Mention the discrepancies
even across GNU/Linux distros, and that the results should
be used as informational only, rather than impacting any
logic decisions.
Fixes http://bugs.gnu.org/13001

10 years agodoc: improve man page for realpath -m
Pádraig Brady [Wed, 15 Jul 2015 13:32:31 +0000 (14:32 +0100)] 
doc: improve man page for realpath -m

* src/realpath.c (usage): Mention 'directory' in the --help
output, so that ENOTDIR errors may be more easily investigated,
by inspecting the man page.
Reported at http://pad.lv/1474519

10 years agotests: avoid test warning with perl >= 5.22
Peter Bray [Wed, 15 Jul 2015 10:37:20 +0000 (11:37 +0100)] 
tests: avoid test warning with perl >= 5.22

* doc/local.mk (sc-lower-case-var): Escape a literal
left curly bracket, needed with perl >= 5.22
Fixes http://bugs.gnu.org/21060

10 years agosync: fix build with separate $(LIB_FDATASYNC)
Peter Bray [Wed, 15 Jul 2015 07:31:21 +0000 (08:31 +0100)] 
sync: fix build with separate $(LIB_FDATASYNC)

* src/local.mk: Link with $(LIB_FDATASYNC) needed
on some Solaris 10 systems for example.
Fixes http://bugs.gnu.org/21059

10 years agodircolors: add tmux entries
Pádraig Brady [Thu, 9 Jul 2015 16:48:16 +0000 (17:48 +0100)] 
dircolors: add tmux entries

* src/dircolors.hin: tmux entries were added to ncurses in:
http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff;\
f=misc/terminfo.src;h=ce9bdc3b;hp=7e576ef1;hb=be512fa0;hpb=ee1bcda2

10 years agoshred: fix pattern selection for certain iteration counts
Pádraig Brady [Tue, 7 Jul 2015 00:46:54 +0000 (01:46 +0100)] 
shred: fix pattern selection for certain iteration counts

This was detected in about 25% of runs with gcc -fsanitize=address

  ERROR: AddressSanitizer: global-buffer-overflow on address ...
  READ of size 4 at 0x000000416628 thread T0
    #0 0x40479f in genpattern src/shred.c:782
    #1 0x4050d9 in do_wipefd src/shred.c:921
    #2 0x406203 in wipefile src/shred.c:1175
    #3 0x406b84 in main src/shred.c:1316
    #4 0x7f3454a1ef9f in __libc_start_main (/lib64/libc.so.6+0x1ff9f)
    #5 0x4025d8 (/tmp/coreutils-8.23/src/shred+0x4025d8)
  0x000000416628 is located 56 bytes to the left of
  global variable '*.LC49' from 'src/shred.c' (0x416660) of size 17
  0x000000416628 is located 12 bytes to the right of
  global variable 'patterns' from 'src/shred.c' (0x416540) of size 220
  SUMMARY: AddressSanitizer: global-buffer-overflow src/shred.c:782

* src/shred.c (gen_patterns): Restrict pattern selection
to the K available, which regressed due to v5.92-1462-g65533e1.
* tests/misc/shred-passes.sh: Add a deterministic test case.
* NEWS: Mention the bug fix.
Fixes http://bugs.gnu.org/20998

10 years agomaint: post-release administrivia
Pádraig Brady [Fri, 3 Jul 2015 21:23:56 +0000 (22:23 +0100)] 
maint: post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

10 years agoversion 8.24 v8.24
Pádraig Brady [Fri, 3 Jul 2015 20:58:50 +0000 (21:58 +0100)] 
version 8.24

* NEWS: Record release date.

10 years agomaint: fix distclean-check failure due to THANKS
Pádraig Brady [Fri, 3 Jul 2015 18:32:13 +0000 (19:32 +0100)] 
maint: fix distclean-check failure due to THANKS

* Makefile.am: Remove our dependence on src/sort which
induces awkward dependencies for `make dist` since
THANKS will be rebuilt once src/sort is newer.
Instead we remove the problematic -f option to sort
which actually doesn't change the order given
our current input.

10 years agomaint: avoid false syntax-check failure in distcheck
Pádraig Brady [Fri, 3 Jul 2015 16:20:36 +0000 (17:20 +0100)] 
maint: avoid false syntax-check failure in distcheck

* cfk.mk (sc_tests_executable): Restrict the check to git files,
so we don't flag any gnulib files added to test/ during
`make distcheck`.

10 years agotests: update gnulib submodule and tests/init.sh to latest
Pádraig Brady [Fri, 3 Jul 2015 14:50:56 +0000 (15:50 +0100)] 
tests: update gnulib submodule and tests/init.sh to latest

* gnulib: Update to latest, with fixes to tests edge cases.
* tests/init.sh: Update from gnulib.

10 years agotests: avoid side effects of $SHELL environment variable
Pádraig Brady [Fri, 3 Jul 2015 03:44:05 +0000 (04:44 +0100)] 
tests: avoid side effects of $SHELL environment variable

Since non interactive shells don't generally set $SHELL,
its value is propagated through the tests and may cause issues;
for example if $SHELL implicitly adjusts $PATH when run.
Instead we set $SHELL to that determined by the posix-shell module,
and use that consistently for all test sub scripts,
including those created thorugh the `split --filter` command.

* tests/local.mk: Explicitly set $SHELL to $(PREFERABLY_POSIX_SHELL)
which defaults to $CONFIG_SHELL and thus usually /bin/sh.
* tests/envvar-check: Remove bash environment variables with
side effects, in case /bin/bash was selected for $SHELL.
* tests/misc/help-version.sh: Remove redundant initialization of $SHELL.
* tests/install/strip-program.sh: Use $SHELL for sub script.
* tests/misc/sort-compress-hang.sh: Likewise.
* tests/misc/sort-compress-proc.sh: Likewise.
* tests/misc/sort-compress.sh: Likewise.
* tests/misc/timeout-group.sh: Likewise.
* tests/rm/fail-eperm.xpl: Remove redundant elision of bash env vars.
* tests/misc/pwd-long.sh: Likewise.

10 years agotests: avoid false failures on OpenBSD 5.7
Pádraig Brady [Thu, 2 Jul 2015 12:55:52 +0000 (13:55 +0100)] 
tests: avoid false failures on OpenBSD 5.7

* tests/du/threshold.sh: Homogenize getopt error messages.
* tests/misc/numfmt.pl: Likewise.
* tests/mv/i-3.sh: Skip on *BSD not just FreeBSD.

10 years agowc: fix reading of /proc files on aarch64
Pádraig Brady [Wed, 1 Jul 2015 21:37:26 +0000 (22:37 +0100)] 
wc: fix reading of /proc files on aarch64

tests/misc/wc-proc.sh fails when the page size is 64K

* src/wc.c (wc): The lseek adjustment should be based on st_blksize,
rather than on the internal buffer size.  This is significant on
aarch64 where st_blksize in /proc is the 64K (the page size) and
thus larger than the internal buffer.
* src/split.c (main): Even though the similar processing is done
on the internal buffer size, that's based on st_blksize and
so fine in this regard.  Add an assert to enforce this.
Avoid this path for the undocumented ---io-blksize option.