Commit Graph

26941 Commits

Author SHA1 Message Date
Jim Meyering
d588c8100c maint: clean up m4 syntax
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS):
Remove unnecessary backslashes and add quotes around multi-line
argument lists.
2011-10-01 19:48:17 +02:00
Markus Duft
07498748d2 build: use getgr*_nomembers functions on Interix
Interix provides faster replacements for getgr{gid,nam,ent} where
group member information is not fetched from domain controllers.
This makes 'id' usable on domain controlled interix boxes.
* m4/jm-macros.m4: Check for _nomembers functions.
* src/system.h: Redefine function to _nomembers when available.
2011-10-01 19:17:26 +02:00
Markus Duft
7289f12588 build: accommodate missing setgroups on Interix
Add a dummy, non-functional, always-successful replacement setgroups
function, to keep the original code untouched and simple.
 * src/chroot.c (setgroups) [! HAVE_SETGROUPS]: Define.
2011-10-01 19:17:21 +02:00
Jim Meyering
e1c589ecd5 build: stop distributing gzip'd releases; xz is enough
* configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip.
* NEWS (Build-related): Mention that we're dropping .tar.gz.
2011-10-01 17:50:32 +02:00
Jim Meyering
28460826d3 build: update gnulib submodule to latest 2011-10-01 17:50:32 +02:00
Pádraig Brady
f215f7fe06 doc: mention the recent ls -L "argetm" fix in NEWS
* NEWS: Mention the bug fix
2011-10-01 02:35:32 +01:00
Pádraig Brady
84457c491e ls: fix output of dangling symlinks colored as target
This is related to commit b7f2b51c, 2010-01-01,
"ls: fix color of broken symlinks colored as target"
which didn't handle the --dereference case.
The simplest way to reproduce the resultant
erroneous "argetm" is as follows:

 $ ln -s /no-such dangle
 $ env LS_COLORS=ln=target ls --dereference --color
 ls: cannot access dangle: No such file or directory
 argetmdangle

This is also an issue with the `tree` utility,
reported here: http://bugs.debian.org/586765

* src/ls.c (print_color_indicator): Move the handling
of 'ln=target' in $LS_COLORS (color_symlink_as_referent == true)
to a higher scope, to handle all cases where type == C_LINK.
* tests/misc/ls-misc: Add a test case for the specific issue,
and 2 further test cases to verify other code paths in this area.

Reported by Jason Glassey.
2011-10-01 02:15:12 +01:00
Jim Meyering
4f38e9f249 ls: avoid reading beyond end of color indicator
At first this looked like a buffer overrun, since there was no test
to ensure that the buffer length was 6.  However, since the LS_COLORS
string is NUL-terminated and since settings within it are separated by
":" there was neither the risk of reading beyond end of buffer nor risk
of a false-positive match.
* src/ls.c (print_color_indicator): Use color_symlink_as_referent
rather than manually comparing against "target" again.
* src/system.h (STRNCMP_LIT): Correct description in comment.
2011-09-30 22:03:47 +02:00
Jim Meyering
bec8920923 tests: update gnulib to latest, to fix test link failure 2011-09-28 11:00:13 +02:00
Jim Meyering
57ee5493d9 sort: avoid a NaN-induced infloop
These commands would fail to terminate:
    yes -- -nan | head -156903 | sort -g > /dev/null
    echo nan > F; sort -m -g F F
That can happen with any strtold implementation that includes
uninitialized data in its return value.  The problem arises in the
mergefps function when bubble-sorting the two or more lines, each
from one of the input streams being merged: compare(a,b) returns 64,
yet compare(b,a) also returns a positive value.  With a broken
comparison function like that, the bubble sort never terminates.
Why do the long-double bit strings corresponding to two identical
"nan" strings not compare equal?  Because some parts of the result
are uninitialized and thus depend on the state of the stack.
For more details, see http://bugs.gnu.org/9612.
* src/sort.c (nan_compare): New function.
(general_numcompare): Use it rather than bare memcmp.
Reported by Aaron Denney in http://bugs.debian.org/642557.
* NEWS (Bug fixes): Mention it.
* tests/misc/sort-NaN-infloop: New file.
* tests/Makefile.am (TESTS): Add it.
2011-09-27 16:49:51 +02:00
Jim Meyering
1d0a7ed7d5 build: update gnulib submodule to latest 2011-09-24 13:18:30 +02:00
Jim Meyering
081e262daf maint: avoid new syntax-check failure
Pulling in the latest gnulib triggered a new false-positive
syntax-check failure.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_always-defined_macros):
Exempt remove.c; its definitions of DT_UNKNOWN, DT_DIR and DT_LNK are
harmless.
2011-09-24 13:17:22 +02:00
Bernhard Voelker
eb6f977ff5 tests: mention new check-expensive/check-very-expensive in test logs
* tests/init.cfg: (very_expensive_): Mention toplevel make target,
check-very-expensive.
(expensive_): Likewise for check-expensive.
2011-09-24 13:17:22 +02:00
Bernhard Voelker
57db1fc2a9 tests: introduce make targets check-expensive and check-very-expensive
* Makefile.am: add shortcuts to run (very) expensive tests.
Use "make check-expensive" to run tests with RUN_EXPENSIVE_TESTS=yes,
use "make check-very-expensive" to run tests with both
RUN_EXPENSIVE_TESTS=yes and RUN_VERY_EXPENSIVE_TESTS=yes.
Non-expensive tests are included in all cases.
2011-09-24 13:17:21 +02:00
Pádraig Brady
80a1aca0d2 timeout: handle implicitly created threads
On some systems like glibc on GNU/kFreeBSD, a thread is
implicitly created when timer_settime() is used.
This breaks our scheme to ignore signals we've
sent ourselves.

* src/timeout.c (send_sig): Change the scheme used to
ignore signals we've sent ourselves, to a more robust
but perhaps limited scheme of ignoring all signals of
a certain type after we've sent that signal to the job.
* NEWS: Mention the change in behavior.
2011-09-22 12:01:05 +01:00
Bruno Haible
a4fa14849a tests: init.sh: support any non-GNU diff
* tests/init.sh (compare): If "diff -c" is supported but "diff -u" is
not, use "diff -c".  Useful on AIX 6.1, HP-UX 11.31, OSF/1 5.1,
Solaris 8.
2011-09-19 19:24:46 +02:00
Jim Meyering
9bb92a4db1 gnulib: update for getcwd fix on systems without openat
This fixes a bug in pwd and all getcwd-using applications (for some
uses: df, readlink, stat) when run from a directory whose absolute name
contains more than PATH_MAX / 3 components.  For more details, see
http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=f6fe351fc534ae1
* gnulib: Update.
* NEWS (Improvements): Mention it.
2011-09-19 17:25:43 +02:00
Reuben Thomas
f2fb24809c md5sum: clarify what is meant by binary/text flag.
src/md5sum.c: Clarify that we are talking about input mode.
        doc/coreutils.texi: Ditto.
2011-09-19 10:55:37 +02:00
Jim Meyering
6c93cd4512 tests: cp-parents: don't let a failing chmod go unnoticed
* tests/cp/cp-parents: If somehow a chmod set-up command failed,
subsequent tests would fail in a harder-to-diagnose manner.
2011-09-19 10:53:45 +02:00
Paul Eggert
e92b0dbc13 randread: add FIXME comment for RDRAND
* gl/lib/randread.c: Add a FIXME comment suggesting how to improve
performance by using the RDRAND hardware instruction.
2011-09-17 08:54:26 -07:00
Pádraig Brady
7da844cc86 md5sum: handle BSD reversed format checksums
* src/md5sum.c (split_3): Detect and handle BSD reversed
format checksums.
* tests/misc/md5sum-bsd: Add a new test.
* tests/Makefile.am: Reference new test.
* NEWS: Mention the improvement
Suggested by Rimas Kudelis.
2011-09-16 19:09:26 +01:00
Eric Blake
b98e41cc74 doc: improve description of join's -a option
* src/join.c (usage): Mention that -a adds to the overall output,
rather than replacing the default output.
* THANKS: Update.
Reported by Tomas Volka.
2011-09-14 07:46:09 -06:00
Jim Meyering
3f456c54bb build: avoid unwarranted failure w/gcc-4.6.1 and --enable-gcc-warnings
* configure.ac (gl_GCC_VERSION_IFELSE): Define new macro.
(WERROR_CFLAGS): With --enable-gcc-warnings, use it to
add -Wsuggest-attribute=pure only with gcc 4.7 or newer.
2011-09-12 19:07:00 +02:00
Jim Meyering
82e86b4831 doc: fix typo in test script comment
* tests/d_type-check: Fix typo in comment.
2011-09-08 22:03:17 +02:00
Jim Meyering
1888629627 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2011-09-08 17:23:21 +02:00
Jim Meyering
c7fca77515 version 8.13
* NEWS: Record release date.
2011-09-08 17:04:42 +02:00
Jim Meyering
032bbff2da build: update gnulib submodule to latest 2011-09-08 15:49:42 +02:00
Jim Meyering
5581bf28e3 stat: avoid compilation failure on AIX 7.x
* src/stat.c (USE_STATVFS): Adjust definition so that it is enabled
also on AIX 7.x systems that provide statvfs64 and no statvfs.
[USE_STATVFS && ! STAT_STATVFS && STAT_STATVFS64] (STATFS): Define
to statvfs64 in that precise case.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Adjust the condition
here to match the new one in stat.c, to keep them in sync.
Reported by Bruno Haible.  For details, see
http://article.gmane.org/gmane.comp.gnu.coreutils.general/1668
2011-09-08 12:16:17 +02:00
Bernhard Voelker
5eeaca942a tests: adjust PATH to include /sbin for mkfs-using tests
* tests/init.cfg (require_mkfs_PATH_): New function to test whether mkfs
is in PATH, otherwise adding /sbin to PATH.  Needed for distributions
(OpenSuSE, Solaris) in which sudo does not include /sbin in PATH.
* tests/cp/cp-a-selinux: Use require_mkfs_PATH_.
* tests/cp/cp-mv-enotsup-xattr: Likewise.
* tests/cp/sparse-fiemap: Likewise.
* tests/mkdir/writable-under-readonly: Likewise.
* tests/rm/read-only: Likewise.
2011-09-07 18:00:55 +02:00
Jim Meyering
f85ca2c876 tests: avoid false-positive "make check" failure when perl is missing
* doc/Makefile.am (sc-lower-case-var): Skip this test when $(PERL)
is not usable.  Reported by Bruno Haible.
2011-09-07 18:00:55 +02:00
Jim Meyering
ac5739d317 cp: update gnulib to get support for NFSv4 ACLs
* NEWS (Improvements): Mention the cp-vs-NFSv4-ACL improvement we
have inherited via gnulib.  For details, see
http://article.gmane.org/gmane.comp.lib.gnulib.bugs/28100
and the following messages in that thread.
* gnulib: Update to latest, for numerous ACL-related improvements.
2011-09-07 17:59:46 +02:00
Bruno Haible
0cefe58092 tests: init.sh: work also with any non-GNU diff that supports -u
* tests/init.sh: Relax check for diff -u support.
Rather than checking for GNU diff via --version, simply check
for support for -u itself.  Useful at least on OpenBSD 4.9.
2011-09-02 14:08:40 +02:00
Jim Meyering
7490145dd0 tests: remove require-perl script; use function instead
* tests/require-perl: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove it from this list.
* tests/init.cfg (require_perl_): New function.
* tests/misc/pwd-long: Use the new function, not the file.
* tests/ls/nameless-uid: Likewise.
* tests/misc/sum-sysv: Likewise.
2011-09-02 14:08:40 +02:00
Jim Meyering
d8945c8d8f tests: cut: exercise distro-added multibyte code paths
* tests/misc/cut: Repeat each test using a multibyte locale,
if the configure-time test found such a locale.
Adjust the tests so that they also accept a slightly
different diagnostic that is specific to the MB-patched cut.
2011-09-02 14:08:40 +02:00
Pádraig Brady
832c85e3f7 doc: describe test control variables
* HACKING (Add tests): Mention the variables and default values.
* README-release (Pre-release testing): Mention that setting
the SHELL variable may be required.
Suggested by Bruno Haible.
2011-09-02 11:41:23 +01:00
Pádraig Brady
3d2e55d508 timeout: fixup previous warning fix
* src/timeout.c (settimeout): Fix the previous commit
to test errno rather than the return value.
2011-09-01 15:50:08 +01:00
Pádraig Brady
37784220dd tests: split/l-chunk: avoid a portability issue
* tests/split/l-chunk: Don't use the `test "$var"`
idiom to test that var is set to something as
that's not supported by all shells.
The new style matches the usage is the rest of
the test in any case.
Reported by Bruno Haible on AIX 6.1 and 7.1
2011-09-01 15:43:25 +01:00
Jim Meyering
551cbda027 tests: pwd-long: diagnose failure earlier
Without this change, we'd get use-of-uninit value warnings
and harder-to-diagnose failure down the road.
* tests/misc/pwd-long (normalize_to_cwd_relative): Diagnose stat
failure.  This failed on AIX 6.1 and 7.1.  Reported by Bruno Haible.
2011-09-01 16:36:23 +02:00
Jim Meyering
af5f2d741b tests: printf-surprise: avoid false-positive failure
* tests/misc/printf-surprise: Also accept a strerror-style string
after the usual 'printf: write error:' diagnostic prefix.
Otherwise, this test would fail on HP-UX 11.
Reported by Bruno Haible.
2011-09-01 16:36:23 +02:00
Bernhard Voelker
44f7444987 tests: improve message in 'require_membership_in_two_groups_' function
* tests/init.cfg (require_membership_in_two_groups_): Add quotes
around the suggested groups for the COREUTILS_GROUPS variable.
2011-09-01 16:36:23 +02:00
Jim Meyering
ac54e1e4d2 tests: misc/printf: accommodate alternate behavior
* tests/misc/printf: Avoid false positive failure on MacOS X 10.5
due to a slightly differing diagnostic.  Reported by Bruno Haible.
2011-09-01 16:36:23 +02:00
Jim Meyering
a8c7983629 tests: invoke via "env printf", rather than using an absolute name
* tests/misc/printf: This results in more concise diagnostics.
2011-09-01 16:36:23 +02:00
Pádraig Brady
38e3a90e4b timeout: suppress a redundant warning on some systems
* src/timeout.c (settimeout): Don't warn about ENOSYS
which is returned on OpenBSD 4.9 at least.
Reported by Bruno Haible
2011-09-01 15:30:18 +01:00
Pádraig Brady
197cd0994d stdbuf: fix helper lib identification on some platforms
* src/stdbuf.c (main): Pass the path of `stdbuf` rather than
the command it's running to the search function.  This is
significant on platforms without /proc/self/exe
Reported by Bruno Haible
2011-09-01 15:27:58 +01:00
Pádraig Brady
0d89a42bff build: avoid the use of strsignal() in split
... which is not available on some platforms,
and the replacement currently requires linking
with threading libraries.
* src/split.c (closeout): Remove the call to strsignal()
which is largely redundant anyway as sig2str()
is already used to map number to name in the error.
Reported by Bruno Haible on AIX 6.1 and 7.1
2011-09-01 15:20:55 +01:00
Jim Meyering
df9cd0a426 date: support parsing of ISO-8601-with-"T" dates
Thanks to an improvement in gnulib's parse-datetime module,
commands like this now succeed (output manually indented):
    $ ./date -u -d 2004-02-29T16:21:42.33+07:00 +%FT%T.%N%z
		   2004-02-29T09:21:42.330000000+0000
* tests/misc/date: Add a test to exercise the new-in-gnulib
parsing of ISO8601-with-"T" dates.
* NEWS (New features): Mention it.
* gnulib: Update, to pull in this parse-datetime improvement.
2011-08-31 20:00:19 +02:00
Pádraig Brady
683ee76ad2 build: heap.c: make possible gnulib candidate c89 compatible
* gl/lib/heap.c: Move declaration to the top of scope.
Reported by Rob McMahon and Wolfgang Steinwender
in relation to "Sun WorkShop 6 update 2 C 5.3 Patch 111679-12
2003/05/18" and "GCC 2.95.3" respectively.
2011-08-30 15:09:23 +01:00
Pádraig Brady
24a1a8c473 timeout: revert signal propagation enhancement
This effectively reverts the unreleased commit 5a647a05

* src/timeout.c (main): Don't propagate signals from the monitored
process, as on Linux /proc/sys/kernel/core_pattern could still
handle them and cause false reports against `timeout`
2011-08-25 11:35:31 +01:00
Jim Meyering
6a2751d59d maint: rename a test
Lesson: do not include details like "4 million" in a file name.
* tests/rm/many-dir-entries-vs-OOM: Renamed from ...
* tests/rm/4-million-entry-dir: ...this.
* tests/Makefile.am (TESTS): Reflect renaming.
2011-08-24 10:50:28 +02:00
Jim Meyering
ebc63d33ea tests: adjust the new, very expensive rm test to be less expensive
* tests/rm/4-million-entry-dir: Create only 200,000 files, rather
than 4 million.  The latter was overkill, and was too likely to
fail due to inode exhaustion.  Not everyone is using btrfs yet.
Now that this test doesn't take so long, label it as merely
"expensive", rather than "very expensive".  Thanks to
Bernhard Voelker for pointing out the risk of inode exhaustion.
2011-08-24 10:50:15 +02:00