Age | Commit message (Collapse) | Author |
|
In the recent factor rewrite, the GMP code
wasn't actually used; just an error was printed
on integer overflow. While fixing that it was noticed
that correct input validation wasn't done in all cases
when falling back to the GMP code.
* src/factor.c (print_factors) Fallback to GMP on overflow.
(strto2uintmax): Scan the string for invalid characters,
so that case can be detected independently of overflow.
Return an error when an empty string is passed.
Also allow leading spaces and '+' in input numbers.
* tests/misc/factor.pl: Ensure the GMP code is exercised
when compiled in. Also add a test to verify leading
spaces and '+' are allowed.
|
|
When listing a directory containing dangling symlinks,
and not outputting a long format listing, and orphaned links
are set to no coloring in LS_COLORS, then the symlinks
would get no color rather than reverting to the standard
symlink color. The issue was introduced in v8.13-19-g84457c4
* src/ls.c (print_color_indicator): Use the standard method
to check if coloring is specified for orphaned symlinks.
The existing method would consider 'or=00' or 'or=0' as significant
in LS_COLORS. Even 'or=' was significant as in that case the
string='or=' and the length=0. Also apply the same change
for missing symlinks for consistency.
(gobble_file): Remove the simulation of linkok, which is only
tested in print_color_indicator() which now handles this directly
by keying on the LS_COLORS values correctly.
* tests/misc/ls-misc.pl: Add a test case.
* THANKS: Add the reporter.
* NEWS: Mention the fix.
Reported-by: David Matei
|
|
Handle non-negative whole numbers robustly and efficiently when
the increment is 1 and when no format-changing option is specified.
On the correctness front, for very large numbers, seq now works fine:
$ b=1000000000000000000000000000
$ src/seq ${b}09 ${b}11
100000000000000000000000000009
100000000000000000000000000010
100000000000000000000000000011
while the old one would infloop, printing garbage:
$ seq ${b}09 ${b}11 | head -2
99999999999999999997315645440
99999999999999999997315645440
The new code is much more efficient, too:
Old vs new: 55.81s vs 0.82s
$ env time --f=%e seq $((10**8)) > /dev/null
55.81
$ env time --f=%e src/seq $((10**8)) > /dev/null
0.82
* seq.c (incr): New function, inspired by the one in cat.c.
(cmp, seq_fast): New functions, inspired by code in nt-factor
by Torbjörn Granlund and Niels Möller.
(trim_leading_zeros): New function, without which cmp would malfunction.
(all_digits_p): New function.
(main): Hoist the format_str-vs-equal_width check to precede first
treatment of operands, and insert code to call seq_fast when possible.
* NEWS (Bug fixes): Mention the correctness fix.
(Improvements): Mention the speed-up.
* tests/misc/seq.pl: Exercise the new code.
Improved by: Bernhard Voelker.
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/3340
|
|
* NEWS (Bug fixes): Mention it.
* tests/misc/factor.pl: Add five of Torbjörn's tests.
|
|
* Makefile.am (SUBDIRS): Remove 'tests'.
(include): The '$(top_srcdir)/tests/local.mk' file.
(check-root): Remove this convenience target, it's no longer needed
now that the "real" check-root target once in 'tests/Makefile' will
land in the top-level makefile.
* configure.ac (AC_CONFIG_FILES): Remove 'tests/Makefile'.
* tests/Makefile.am: Rename ...
* tests/local.mk: ... like this, with a lot of adjustments.
* tests/init.cfg: Move ...
* init.cfg: ... here. This is necessary, for a limitation of the
gnulib-provided 'tests/init.sh', which unconditionally look for
'init.cfg' in the $(srcdir) directory.
* tests/*/*.sh: Adjust: expect init.sh to be in '$srcdir/tests',
not in '$srcdir', and extend $PATH with './src', not with '../src'.
* tests/Coreutils.pm: Adjust similarly.
* tests/pr/pr-tests.pl ($pfx): Likewise.
|
|
Not only this shrinks the size of the generated Makefile (from > 6300
lines to ~3000), but will allow further simplifications in future
changes.
* tests/Makefile.am (TEST_EXTENSIONS): Add '.sh' and '.pl'.
(PL_LOG_COMPILER, SH_LOG_COMPILER): New, still defined simply to
$(LOG_COMPILER) for the time being.
(TESTS, root_tests): Adjust as described.
* All tests: Rename as described.
|
|
* tests/misc/sort-exit-early: skip_if_root_ as this test
requires an unwritable input and an unreadable output.
|
|
The format used is the BSD traditional format which looks like:
MD5 (/dev/null) = d41d8cd98f00b204e9800998ecf8427e
* NEWS: Add new feature info.
* doc/coreutils.texi (md5sum invocation): Add detailed information
about the new --tag option.
* src/md5sum.c: Add the new --tag option for BSD-style output.
(bsd_split_3): Add ESCAPED_FILENAME parameter.
(print_filename): New function refactored from main().
(filename_unescape): New function refactored from split_3().
* tests/misc/md5sum-bsd: Add tests for the new feature.
|
|
We use print_ver_ to run "PROG --version" for each program under
test. Some tests have been derived from others, while the
argument(s) to print_ver_ have not been adapted.
Add a new cfg.mk rule to prohibit this.
* cfg.mk (sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
New rule, to prohibit a test script from calling print_env_ for a
program not actually used by that test.
* tests/chown/basic: s/\(print_ver_\) chgrp/\1 chown/
* tests/cp/acl: s/\(print_ver_\) mv/\1 cp/
* tests/cp/capability: s/\(print_ver_\) ls/\1 cp/
* tests/cp/cp-parents: s/(print_ver_\) mv/\1 cp/
* tests/du/bind-mount-dir-cycle: s/(print_ver_\) rm/\1 du/
* tests/misc/wc-parallel: s/(print_ver_\) md5sum/\1 wc/
|
|
* tests/misc/sort-u-FMR: New file.
* tests/Makefile.am (TESTS): Add it.
* tests/misc/sort: Add the test here, too.
* NEWS (Bug fixes): Mention it.
|
|
* tests/init.cfg (require_valgrind_): New function...
* tests/misc/sort-stale-thread-mem: ...extracted from here.
|
|
sort -u could omit one or more lines of expected output.
This bug arose because sort recorded the most recently printed line via
reference, and if you were unlucky, the storage for that line would be
reused (overwritten) as additional input was read into memory. If you
were doubly unlucky, the new value of the "saved" line would not only
match the very next line, but if that next line were also the first in
a series of identical, not-yet-printed lines, then the corrupted "saved"
line value would result in the omission of all matching lines.
* src/sort.c (saved_line): New static/global, renamed and moved from...
(write_unique): ...here. Old name was "saved", which was too generic
for its new role as file-scoped global.
(fillbuf): With --unique, when we're about to read into a buffer that
overlaps the saved "preceding" line (saved_line), copy the line's .text
member to a realloc'd-as-needed temporary buffer and adjust the line's
key-defining members if they're set.
(overlap): New function.
* tests/misc/sort: New tests.
* NEWS (Bug fixes): Mention it.
* THANKS.in: Update.
Bug introduced via commit v8.5-89-g9face83.
Reported by Rasmus Borup Hansen in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/23173/focus=24647
|
|
* tests/misc/printf-surprise: A VM size of 10,000KiB was too
little in which to run "env printf ..." on FreeBSD 9.0-p3.
Increase it to 15,000.
|
|
Add a test and NEWS entry for a bug inadvertently fixed in
a refactoring in commit v8.9-32-gd4db0cb
* tests/misc/join (v2-format): Add a new test.
* THANKS.in: Add the reporter.
* NEWS: Mention the old bug.
* cfg.mk (old_NEWS_hash): Update.
Reported-by: Jean-Pierre Tosoni
|
|
* test/Makefile.am: Reference the moved tests.
|
|
* tests/misc/sort-merge-fdlimit: As a consequence of commit
v8.17-34-g59daf05, we can reduce the descriptor limit by one.
|
|
date -d "$(printf '\xb0')" would print 00:00:00 with today's date
rather than diagnosing the invalid input. Now it reports this:
date: invalid date '\260'
* gnulib: Update submodule to latest for fixed parse-datetime.y.
* tests/misc/date [invalid-high-bit-set]: New test.
* NEWS (Bug fixes): Mention it.
* bootstrap, tests/init.sh: Also update to latest.
Reported by Peter Evans in http://bugs.gnu.org/11843
|
|
* src/sort.c (check_inputs): A new function to verify all inputs
are accessible before further processing.
(check_output): A new function to open or create a specified
output file, before futher processing.
(stream_open): Adjust to truncating the previously opened
output file rather than opening directly.
(avoid_trashing_input): Optimize to stat the output file
descriptor, rather than the file name.
(main): Call the new functions to check accessibility of
inputs and output, before processing starts.
* tests/misc/sort: Adjust to the changed error message.
* tests/misc/sort-merge-fdlimit: Account for the earlier opened
file descriptor of the specified output file.
* tests/misc/sort-exit-early: A new test to exercise the improvements.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the improvement.
Suggested-by: Bernhard Voelker
|
|
* tests/misc/help-version: Remove expected su exit code.
|
|
* tests/misc/help-version: Fix comment grammar:
s/all these/all of these/
* gl/lib/tempname.c.diff: Likewise.
|
|
* README: Omit "su" from list of programs.
* src/su.c: Remove file.
* src/Makefile.am: Remove su-related rules and variables.
* tests/misc/su-fail: Remove test.
* tests/Makefile.am (TESTS): Remove misc/su-fail.
* tests/misc/invalid-opt: Remove su-related code.
* src/.gitignore: Remove su.
* man/su.x: Remove file.
* man/Makefile.am (su.1): Remove rule.
* po/POTFILES.in: Remove su.c from the list.
* TODO: Remove ancient entry.
* NEWS (Changes in behavior): Mention it.
* doc/coreutils.texi: Remove su-related description.
* AUTHORS: Remove su.
* m4/lib-check.m4 (cu_LIB_CHECK): Remove file/macro.
* configure.ac: Remove su-related code and sole use of cu_LIB_CHECK.
* scripts/git-hooks/commit-msg: Remove su from this list, too.
|
|
* src/head.c (elide_tail_lines_seekable): Reset file pointer
after printing up to an end-relative line-counted offset.
Anoop Sharma reported the problem and suggested the fix.
* tests/misc/head-pos: Add coverage via a very similar, existing test.
Also add coverage for a previously untested block of code.
* tests/misc/head-elide-tail ($READ_BUFSIZE): Update to 8192, to
match the value of BUFSIZ I see today on Fedora 17/x86_64 (unrelated
to this fix).
* NEWS (Bug fixes): Mention it.
Improved-by: Pádraig Brady
|
|
Culprits identified and fixed automatically using these commands:
git ls-files|misspellings -f -|perl -nl \
-e '/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/ or next;' \
-e '($file,$n,$l,$r)=($1,$2,$3,$4); $q="'\''"; $r=~s/$q/$q\\$q$q/g;'\
-e 'print "sed -i $q${n}s!$l!$r!$q $file"' | bash
using http://github.com/lyda/misspell-check
* old/fileutils/ChangeLog: Fix typos.
* old/textutils/ChangeLog: Likewise.
* tests/misc/truncate-fail-diag: Likewise.
|
|
* tests/cp/sparse-fiemap: Don't hard-code "awk". Use $AWK.
* tests/init.cfg: Likewise.
* tests/misc/sort-rand: Likewise.
|
|
* tests/misc/tty-eof: Increase timeout from 1s to 10s, to avoid
unwarranted failure under heavy load.
* tests/Makefile.am (TESTS): Move misc/tty-eof "up" to nearer the
beginning of the list (from near the middle) so that it is started
earlier in parallel test runs. Otherwise, it would frequently be
among the last two tests to complete.
|
|
Problem reported by Samuel Thibault in <http://bugs.gnu.org/11424>.
* NEWS: Document this.
* src/dd.c (skip): Handle skipping past EOF on shared or typed
memory objects the same way as with regular files.
(dd_copy): It's OK to truncate shared memory objects.
* src/du.c (duinfo_add): Check for overflow.
(print_only_size): Report overflow.
(process_file): Ignore negative file sizes in the --apparent-size case.
* src/od.c (skip): Fix comment about st_size.
* src/split.c (main):
* src/truncate.c (do_ftruncate, main):
On files where st_size is not portable, fall back on using lseek
with SEEK_END to determine the size. Although strictly speaking
POSIX says the behavior is implementation-defined, in practice
if lseek returns a nonnegative value it's a reasonable one to
use for the file size.
* src/system.h (usable_st_size): Symlinks have reliable st_size too.
* tests/misc/truncate-dir-fail: Don't assume that getting the size
of a dir is not allowed, as it's now allowed on many platforms,
e.g., GNU/Linux.
|
|
These were identified using: https://github.com/lyda/misspell-check
executed like: git ls-files | misspellings -f -
* src/cat.c: Correct a spelling error.
* src/comm.c: Likewise.
* src/expr.c: Likewise.
* src/pr.c: Likewise.
* src/tac.c: Likewise.
* src/test.c: Likewise.
* src/ChangeLog-2005: Likewise.
* src/ChangeLog-2007: Likewise.
* src/NEWS: Likewise.
* src/doc/coreutils.texi: Likewise.
* src/lib/ChangeLog-2007: Likewise.
* src/man/help2man: Likewise.
* src/old/fileutils/ChangeLog-1997: Likewise.
* src/old/fileutils/NEWS: Likewise.
* src/old/sh-utils/ChangeLog.0: Likewise.
* src/old/textutils/ChangeLog: Likewise.
* src/tests/misc/comm: Likewise.
* src/tests/misc/uniq: Likewise.
* src/tests/mv/dir2dir: Likewise.
* src/cfg.mk (old_NEWS_hash): update with `make update-NEWS-hash`
|
|
... i.e., don't use the getpw* functions.
Before this change, running groups or id with no user name argument
would include a group name or ID from /etc/passwd. Thus, under unusual
circumstances (default group is changed, but has not taken effect for a
given session), those programs could print a name or ID that is neither
real nor effective.
To demonstrate, run this:
echo 'for i in 1 2; do id -G; sleep 1.5; done' \
|su -s /bin/sh ftp - &
sleep 1; perl -pi -e 's/^(ftp:x:\d+):(\d+)/$1:9876/' /etc/passwd
Those id -G commands printed the following:
50
50 9876
With this change, they print this:
50
50
Similarly, running those programs set-GID could make them
print one ID too many.
* src/group-list.c (print_group_list): When username is NULL, pass
egid, not getpwuid(ruid)->pw_gid), to xgetgroups, per the API
requirements of xgetgroups callee, mgetgroups.
When not using the password database, don't call getpwuid.
* NEWS (Bug fixes): Mention it.
* tests/misc/id-setgid: New file.
* tests/Makefile.am (TESTS): Add it.
(root_tests): It's a root-only test, so add it here, too.
Originally reported by Brynnen Owen as http://bugs.gnu.org/7320.
Raised again by Marc Mengel in http://bugzilla.redhat.com/816708.
|
|
* tests/Makefile.am (TESTS): Add misc/stty-pairs.
* tests/init.cfg (stty_reversible_init_): New function.
(stty_reversible_query_): New function.
* tests/misc/stty: Factor out expensive "pairs" code into new test.
Use new stty_reversible_* functions instead of evaluating static
REV_* variables.
* tests/misc/stty-pairs: Add new test. Code added from misc/stty.
Mark this as an expensive test. Skip 'parenb' and 'cread' options,
as these tests are known to fail. Like in misc/stty, also use
the new stty_reversible_* functions.
|
|
* tests/misc/stty: Add iutf8 to the list of REV_* options.
That option has been implemented in commit v5.2.1-193-g733e79e.
|
|
Accept -g for BSD/Plan9 compatibility.
* NEWS (New features): Mention it.
* tests/fmt/goal-option: New test.
* tests/fmt/long-line: Rename from tests/fmt-long-line.
* tests/fmt/base: Rename from tests/misc/fmt.
* doc/coreutils.texi: Document it.
* src/fmt.c (main): Accept the new option
(check_for_goals): new function to implement the operands
Based on BSD's and Plan-9's fmt programs.
|
|
* tests/misc/stty: Don't waste a subshell to perform this:
eval rev=\$REV_$opt. Fix rev1,rev2 assignments similarly.
|
|
* tests/misc/sort-discrim: Correct reversed args to "compare".
This nit was masked by a bug in maint.mk that effectively disabled
many of the syntax-check rules.
|
|
* tests/rm/isatty: Remove now-unneeded "# `" line.
* tests/misc/ls-time: Likewise.
* tests/misc/date-sec: Remove stray "`" in comment.
* tests/du/long-sloop: Likewise.
* tests/mv/part-symlink: Replace multi-line `...` by $(...).
* tests/mv/sticky-to-xpart: Likewise.
* tests/rm/fail-2eperm: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/cp/perm: Likewise.
* tests/cp/preserve-gid: Likewise.
* tests/cp/same-file: Likewise.
|
|
* tests/misc/expr: As above.
* tests/misc/ls-misc: Likewise.
* tests/misc/pwd-long: Likewise.
* tests/misc/uniq: Likewise.
|
|
Exempt init.sh because it runs before we're assured to have a
shell that groks $(...). Exempt *.mk because "$" would have to
be doubled, and besides, any `...` expression in a .mk file is
almost certainly evaluated before init.sh is run. Finally, also
exempt the perl-based tests, because perl's `...` cannot be
converted to $(...). Do that by running this command:
git grep -l '`.*`' tests \
| grep -Ev 'init\.sh|\.mk$' | xargs grep -Lw perl \
| xargs perl -pi -e 's/`(.*?)`/\$($1)/g'
One minor fix-up change was required after that, due to how
quoting differs:
diff --git a/tests/chmod/equals b/tests/chmod/equals
- expected_perms=$(eval 'echo \$expected_'$dest)
+ expected_perms=$(eval 'echo $expected_'$dest)
Another was to make these required quoting adjustments:
diff --git a/tests/misc/stty b/tests/misc/stty
...
- rev=$(eval echo "\\\$REV_$opt")
+ rev=$(eval echo "\$REV_$opt")
...
- rev1=$(eval echo "\\\$REV_$opt1")
- rev2=$(eval echo "\\\$REV_$opt2")
+ rev1=$(eval echo "\$REV_$opt1")
+ rev2=$(eval echo "\$REV_$opt2")
Also, transform two files that were needlessly excluded above:
(both use perl, but are mostly bourne shell)
perl -pi -e 's/`(.*?)`/\$($1)/g' \
tests/du/long-from-unreadable tests/init.cfg
|
|
* tests/misc/nohup: Fix invalid quoting.
|
|
* tests/misc/expr: Avoid spurious failure on AIX 6.1 due to
differing regexp diagnostic. Reported by Michael Felt.
|
|
* tests/misc/sort-stale-thread-mem: Invoke framework_failure_, now,
hoping that valgrind is fixed (or we add exclusions) before the
next release.
|
|
* tests/misc/sort-stale-thread-mem: Skip upon known failure.
|
|
* tests/misc/factor: Map OpenBSD 5.1's "unknown option" to our
expected "invalid option". Reported by Bruno Haible.
|
|
* tests/misc/sort-discrim: The expr limit is intmax_t without GMP.
|
|
* tests/misc/ls-time: Force a ctime update as updating
the atime doesn't update ctime on tmpfs on Solaris 10.
|
|
Most of the time, if someone wants to filter which paths are
relative while leaving all others absolute, they also want to
to the filtering based on the same --relative-to directory.
Make this easier to specify.
* src/realpath.c (main): Convert error to default.
* doc/coreutils.texi (realpath invocation): Document this.
* tests/misc/realpath: Adjust test to match.
* NEWS: Document it.
|
|
'realpath --relative-base --relative-to' is identical to
--relative-base=--relative-to, so the test wasn't covering what
it claimed. Expose recent fixes for handling of // on systems
where // is distinct, and for --relative-base=/. Add test that
exposes our design decision that --relative-base that is not a
prefix of --relative-to is a no-op (if we later change behavior,
we will also have to change that part of the test).
* tests/misc/realpath: Fix typo. Add some tests.
|
|
https://lists.gnu.org/archive/html/bug-gnulib/2012-02/msg00038.html
detailed a couple of bugs in gnulib's canonicalize that were visible
through coreutils' readlink, but only on systems where // is distinct
from /. This particular test assumes the POSIX fix which requires
canonicalization of a symlink containing just slashes to behave as
if slashes separating the symlink from the rest of the name are
elided (see http://austingroupbugs.net/view.php?id=541), as that is
the only useful (and current) behavior on Cygwin. That is,
ln -s / root
ls root/dev
must list the contents of /dev, not //dev.
* tests/misc/readlink-root: New test.
* tests/Makefile.am (TESTS): Run it.
|
|
* tests/Makefile.am (TESTS): Add misc/sort-discrim.
* tests/misc/sort-discrim: New file, which tests a discriminator-based
implementation of 'sort'. Coreutils doesn't use this implementation
yet, but the test is useful anyway.
Co-authored-by: Drew Kutilek <dkutilek@ucla.edu>
Co-authored-by: James Wendt <jwendt@cs.ucla.edu>
|
|
* src/dirname.c (main): Handle new -z option and manage more than one
argument.
* doc/coreutils.texi (dirname invocation): Mention it.
* NEWS (New features): Mention it.
* tests/misc/dirname: Add a two arguments test.
|
|
* src/basename.c (perform_basename): New function refactored from
main() that performs the basename work on a STRING, optionally
removes a trailing SUFFIX and outputs the result.
(main): Handle new options.
* doc/coreutils.texi (basename invocation): Mention new options.
* test/misc/basename: Add new options test cases.
* NEWS (New features): Mention it.
|
|
* tests/misc/help-version: Remove the $EXEEXT suffix from each
program name before comparing with a literal.
|