platform/upstream/coreutils.git
12 years ago* tests/ls/block-size: Make it executable.
Paul Eggert [Sat, 12 Nov 2011 08:11:22 +0000 (00:11 -0800)]
* tests/ls/block-size: Make it executable.

12 years ago* src/system.h (emit_size_note): Reword for clarity.
Paul Eggert [Sat, 12 Nov 2011 07:36:47 +0000 (23:36 -0800)]
* src/system.h (emit_size_note): Reword for clarity.

See discussion in Bug#9939.

12 years agols: -k no longer affects -l's file sizes
Paul Eggert [Sat, 12 Nov 2011 07:21:13 +0000 (23:21 -0800)]
ls: -k no longer affects -l's file sizes

This fixes an incompatibility with POSIX 2008 and with BSD.
Problem reported by Abdallah Clark (Bug#9939)
via Alan Curry (Bug#10016).
* NEWS: Document this.
* doc/coreutils.texi (General output formatting): Document the
new -k behavior, and --kibibytes.
* src/ls.c (file_human_output_opts): New static var.
(long_options, usage): Add --kibibytes.
(decode_switches, gobble_file, print_long_format):
Implement the new -k behavior.
* tests/ls/block-size: New file.
* tests/Makefile.am (TESTS): Add it.

12 years agodoc: fix typo in sort description
Eric Blake [Tue, 8 Nov 2011 19:11:39 +0000 (12:11 -0700)]
doc: fix typo in sort description

* doc/coreutils.texi (sort invocation): Fix typo.

12 years agobuild: update gnulib for more openat changes
Jim Meyering [Sat, 5 Nov 2011 19:57:19 +0000 (20:57 +0100)]
build: update gnulib for more openat changes

12 years agobuild: do use fstatat and unlinkat modules, now that they're separate
Jim Meyering [Fri, 4 Nov 2011 19:44:34 +0000 (20:44 +0100)]
build: do use fstatat and unlinkat modules, now that they're separate

* bootstrap.conf (gnulib_modules): Add fstatat and unlinkat.

12 years agobuild: update gnulib to pull in openat module separation changes
Jim Meyering [Fri, 4 Nov 2011 10:34:08 +0000 (11:34 +0100)]
build: update gnulib to pull in openat module separation changes

No semantic change.

12 years agotests: avoid signal issues in timeout-group
Pádraig Brady [Thu, 3 Nov 2011 01:42:43 +0000 (01:42 +0000)]
tests: avoid signal issues in timeout-group

These issues were seen on an OpenSuse 10.3 system
(kernel 2.6.22.5 x86_64, glibc 2.6.1-18, bash updated to 4.2),
and also on a 64 bit SLES system with a 2.6.16 kernel.
Both systems had 2 CPUs.

There were two issues seen.  1. Occasionally the
timeout.cmd shell script would block SIGINT until
the sleep command exited.  2. Much less frequently the
signal handler in the timeout command itself was ignored,
causing SIGALRM to kill the process.

* tests/misc/timeout-group: Detect the above two cases,
and skip rather than fail.  Note only issue 2. causes
a failure unless skipped, but we skip for case 1. also,
for diagnostic purposes.

12 years agotests: fix a race in timeout-group
Pádraig Brady [Thu, 13 Oct 2011 13:58:58 +0000 (14:58 +0100)]
tests: fix a race in timeout-group

This could cause a false failure, or even
an infinite loop in rare circumstances.

* tests/misc/timeout-group: Increase the timeouts
passed to the timeout command, so that they're
effectively not used.  Instead the command termination
is triggered by the kill commands when everything
is in the correct state.

Reported by Bernhard Voelker.

12 years agobuild: adapt to gnulib's recent openat/fchmodat separation
Jim Meyering [Wed, 2 Nov 2011 09:20:11 +0000 (10:20 +0100)]
build: adapt to gnulib's recent openat/fchmodat separation

* gnulib: Update to latest, pulling in the openat/fchmodat separation.
* bootstrap.conf (gnulib_modules): Add fchmodat, now that gnulib
has moved it into its own module.

12 years agomaint: fix git-log typos when generating ChangeLog
Jim Meyering [Mon, 31 Mar 2008 20:39:15 +0000 (22:39 +0200)]
maint: fix git-log typos when generating ChangeLog

* gnulib: Update to latest, for new gitlog-to-changelog.
* Makefile.am (gen-ChangeLog): Use its new --amend=F option.
* build-aux/git-log-fix: New file, with ChangeLog fixes.

12 years agostat: avoid compilation failure with gnulib's new alignof
Jim Meyering [Wed, 2 Nov 2011 08:11:18 +0000 (09:11 +0100)]
stat: avoid compilation failure with gnulib's new alignof

* src/stat.c: Include <stdalign.h>, not "alignof.h" for alignof use.

12 years agoscripts: reject references to long-form bug URLs
Jim Meyering [Tue, 1 Nov 2011 19:54:37 +0000 (20:54 +0100)]
scripts: reject references to long-form bug URLs

* scripts/git-hooks/commit-msg: Require the normalized/shortened
form of bugzilla.redhat.com and bugs.gnu.org bug URLs.

12 years agodoc: date: mention that the hardware clock might not be set
Pádraig Brady [Tue, 1 Nov 2011 17:29:53 +0000 (17:29 +0000)]
doc: date: mention that the hardware clock might not be set

* doc/coreutils.texi (Setting the time): Reorganize slightly
and mention that the hardware clock might need to be explicitly
updated by the user as is the case on Fedora 16 currently.
See http://bugzilla.redhat.com/749516

12 years agobuild: adapt to gnulib's recent openat/fchownat separation
Jim Meyering [Tue, 1 Nov 2011 10:36:51 +0000 (11:36 +0100)]
build: adapt to gnulib's recent openat/fchownat separation

* bootstrap.conf (gnulib_modules): Add fchownat, now that gnulib
has moved it into its own module.
* gnulib: Update to latest.

12 years agobuild: update gnulib for GNUmakefile fix
Jim Meyering [Sun, 30 Oct 2011 21:26:14 +0000 (22:26 +0100)]
build: update gnulib for GNUmakefile fix

12 years agomaint: avoid new "make syntax-check" failure due to stdalign definition
Jim Meyering [Sun, 30 Oct 2011 21:31:17 +0000 (22:31 +0100)]
maint: avoid new "make syntax-check" failure due to stdalign definition

* gl/modules/randread (Depends-on): Add stdalign.
* gl/lib/randread.c: Include <stdalign.h>, so we can ...
[!_STRING_ARCH_unaligned]: remove definition of stdalign.

12 years agotests: update gnulib to latest to avoid FP DST-related test failure
Jim Meyering [Sun, 30 Oct 2011 11:42:55 +0000 (12:42 +0100)]
tests: update gnulib to latest to avoid FP DST-related test failure

Otherwise, "make check" would fail after e.g., a CEST-to-CST
daylight savings transition.
See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28825

12 years agotests: doc: fix stale comment in new rm/many-dir-entries-vs-OOM
Jim Meyering [Sun, 30 Oct 2011 10:51:45 +0000 (11:51 +0100)]
tests: doc: fix stale comment in new rm/many-dir-entries-vs-OOM

12 years agotests: don't make tail's pipe-f2 test take the full 10 seconds
Jim Meyering [Fri, 28 Oct 2011 16:06:44 +0000 (18:06 +0200)]
tests: don't make tail's pipe-f2 test take the full 10 seconds

* tests/tail-2/pipe-f2: Don't always wait 10 seconds.
Before, this test would always wait 10 seconds.
Now, it stops early when it detects that tail -f has written output.
BTW, the race condition that prompted changing the timeout from 1 second
to 10 was that tail -f could be killed by the timeout before producing
any output.

12 years agodate: reinstate the --iso-8601 (-I) option
Jim Meyering [Thu, 27 Oct 2011 20:02:23 +0000 (22:02 +0200)]
date: reinstate the --iso-8601 (-I) option

We deprecated and undocumented the --iso-8601 (-I) option mostly
because date could not parse that particular format.  Now that
it can, it's time to restore the documentation.
* src/date.c (usage): Document it.
* doc/coreutils.texi (Options for date): Reinstate documentation.
Reported by Hubert Depesz Lubaczewski in http://bugs.gnu.org/7444.

12 years agobuild: avoid bootstrap failure when using patch-2.5.8
Jim Meyering [Thu, 27 Oct 2011 17:04:45 +0000 (19:04 +0200)]
build: avoid bootstrap failure when using patch-2.5.8

* gl/modules/tempname.diff: Regenerate to correct bogus offsets
and adjust for 1-line offset.  Eric Blake reported that this
patch failed to apply when using patch-2.5.8.
Note that it applies fine using patch-2.6.1.

12 years agobuild: do not remove definition of ENODATA, after all
Jim Meyering [Tue, 25 Oct 2011 10:31:44 +0000 (12:31 +0200)]
build: do not remove definition of ENODATA, after all

* src/system.h (ENODATA): Restore definition.
gnulib defines it only on native Windows systems, so removing our
definition would have provoked build failure on systems that use it,
like FreeBSD.  Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28739/focus=28795
* gnulib: Update to latest, to get new ENODATA-exempting maint.mk rule.

12 years agodoc: NEWS: correct "bug introduced in ..." version number
Eric Blake [Mon, 24 Oct 2011 14:20:34 +0000 (16:20 +0200)]
doc: NEWS: correct "bug introduced in ..." version number

* NEWS: s/7.0/8.0/

12 years agorm: update gnulib to get an fts fix for Cygwin+NWFS/NcFsd file systems
Jim Meyering [Mon, 24 Oct 2011 08:27:22 +0000 (10:27 +0200)]
rm: update gnulib to get an fts fix for Cygwin+NWFS/NcFsd file systems

* NEWS (Bug fixes): Mention it.
As far as we know, this fix affects only Cygwin with NWFS or NcFsd
file systems.  See these:
http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=71f13422f3e634
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28739
http://cygwin.com/ml/cygwin/2011-10/msg00365.html
* src/system.h (ENODATA): Remove fall-back definition, now that
gnulib provides one.  Caught by the sc_prohibit_always-defined_macros
syntax-check rule.
Also remove now-irrelevant "Don't use bcopy..." comment.

12 years agomaint: add git hook scripts
Jim Meyering [Thu, 20 Oct 2011 15:26:01 +0000 (17:26 +0200)]
maint: add git hook scripts

We find it worthwhile to use consistent commit summary prefixes.
To that end, the commit-msg script requires that all commits I make
start with "$P: " (where $P is one of ~100 programs in coreutils)
or one of a few other words, like gnulib tests maint doc build.
It allows more than one word, so e.g., "cat tail head: " would also
be accepted.  Pádraig Brady wrote the initial version, with its
72-column and blank-if-present second line checks.
The pre-commit script is the same as the git-supplied sample script,
modulo a bug fix and the "exec 1>&2" redirection.
* scripts/git-hooks/commit-msg: New file.
* scripts/git-hooks/pre-commit: New file.
* scripts/git-hooks/applypatch-msg: New file.  Verbatim from .sample.
* cfg.mk: Exempt two of the new scripts from the no-leading-TABs check,
since they're nearly verbatim from git, and we want to stay in sync.
Exempt the commit-msg script from the no-"fail=0" check.

12 years agotail: with -f, use nanosleep (not inotify) on a GPFS file system
Martial Bornet [Thu, 20 Oct 2011 17:18:09 +0000 (19:18 +0200)]
tail: with -f, use nanosleep (not inotify) on a GPFS file system

Because tail's fremote function did not designate GPFS as
a remote file system type, tail -f would mistakenly attempt
to use inotify, which cannot work with a remote file system.
* src/tail.c (fremote): List GPFS as a remote file system type.
* NEWS (Bug fixes): Mention it.
Reported in http://bugs.debian.org/646022.

12 years agobuild: include man-pages for non-default progs
Mike Frysinger [Thu, 20 Oct 2011 04:54:13 +0000 (00:54 -0400)]
build: include man-pages for non-default progs

At the moment, things like man/arch.1 are not included in the tarball.
This makes perl a requirement if you want to build/install the arch
helper.

* man/Makefile.am (EXTRA_DIST): Add $(NO_INSTALL_PROGS_DEFAULT:%=%.1).

12 years agomaint: tac: prefer "failed to" diagnostic over "cannot"
Jim Meyering [Tue, 18 Oct 2011 12:20:36 +0000 (14:20 +0200)]
maint: tac: prefer "failed to" diagnostic over "cannot"

* src/tac.c: Change wording in diagnostic: "failed to open" seems
clearer than "cannot open".

12 years agotac: do not let failed allocation cause immediate exit
Jim Meyering [Tue, 18 Oct 2011 10:04:02 +0000 (12:04 +0200)]
tac: do not let failed allocation cause immediate exit

* src/tac.c (temp_stream): Don't exit immediately upon failed heap
allocation, here.  That would inhibit processing of any additional
command-line arguments.

12 years agotac: use only one temporary file, with multiple nonseekable inputs
Jim Meyering [Tue, 18 Oct 2011 09:44:39 +0000 (11:44 +0200)]
tac: use only one temporary file, with multiple nonseekable inputs

* src/tac.c (temp_stream): New function, factored out of...
(copy_to_temp): ...here.
(tac_nonseekable): Don't free or fclose, now that we reuse the file.
Suggested by Ambrose Feinstein.
* THANKS.in: Update.

12 years agomaint: make tac.c slightly cleaner
Paul Eggert [Tue, 18 Oct 2011 05:43:58 +0000 (07:43 +0200)]
maint: make tac.c slightly cleaner

* src/tac.c (copy_to_temp): Now that the template string tacXXXXXX
is used in only one place, don't bother using a separate variable.
Also, using three unconditional assignments seems slightly clearer.

12 years agotac: don't leak a file descriptor for each non-seekable input
Jim Meyering [Sun, 16 Oct 2011 10:14:05 +0000 (12:14 +0200)]
tac: don't leak a file descriptor for each non-seekable input

* src/tac.c (tac_nonseekable): Call fclose and free tmp_file after
each successful call to copy_to_temp.

12 years agotac: don't misbehave with multiple non-seekable inputs
Jim Meyering [Sun, 16 Oct 2011 10:07:05 +0000 (12:07 +0200)]
tac: don't misbehave with multiple non-seekable inputs

* src/tac.c (copy_to_temp): Do not reuse the template buffer.
Instead, scribble only on a freshly-xstrdup'd copy each time.
Free that buffer both here, upon failure, and ...
(tac_nonseekable): ...free the buffer in caller, upon success.
* tests/misc/tac-2-nonseekable: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
Reported by Ambrose Feinstein in http://debbugs.gnu.org/9762.

12 years agomaint: tac: remove sole use of sprintf in favor of filenamecat
Jim Meyering [Sun, 16 Oct 2011 08:35:56 +0000 (10:35 +0200)]
maint: tac: remove sole use of sprintf in favor of filenamecat

* src/tac.c: Include filenamecat.h.
(copy_to_temp): Use filenamecat rather than xmalloc and sprintf.
Move some declarations "down" to point of initialization.

12 years agomaint: speed up make check (vc_exe_in_TESTS)
Pádraig Brady [Mon, 17 Oct 2011 10:20:01 +0000 (11:20 +0100)]
maint: speed up make check (vc_exe_in_TESTS)

* tests/check.mk (vc_exe_in_TESTS): The main change is to
not start a sed process for each file under tests/,
which was taking around 2.5s on a 2.1GHz i3-2310M.
Also adjust the rule to no longer use temporary files.

12 years agomaint: post-release administrivia
Jim Meyering [Wed, 12 Oct 2011 09:57:25 +0000 (11:57 +0200)]
maint: post-release administrivia

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

12 years agoversion 8.14 v8.14
Jim Meyering [Wed, 12 Oct 2011 09:45:24 +0000 (11:45 +0200)]
version 8.14

* NEWS: Record release date.

12 years agotests: avoid a false failure on systems without inotify
Pádraig Brady [Sun, 9 Oct 2011 10:25:34 +0000 (11:25 +0100)]
tests: avoid a false failure on systems without inotify

* tests/tail-2/follow-name: Exclude the inotify warning
from the comparison.
Reported by Bruno Haible.

12 years agobuild: update gnulib to latest to fix MacOS X 10.5 test link failure
Jim Meyering [Sun, 9 Oct 2011 16:51:53 +0000 (18:51 +0200)]
build: update gnulib to latest to fix MacOS X 10.5 test link failure

Details here:
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1743

12 years agorm: do not resort to stat'ing very long names even on deficient systems
Jim Meyering [Sun, 9 Oct 2011 08:52:52 +0000 (10:52 +0200)]
rm: do not resort to stat'ing very long names even on deficient systems

This change affects only systems that have neither *at function support
nor the /proc/self/fd support required to emulate those *at functions.
* src/remove.c (write_protected_non_symlink): Call faccessat
unconditionally.  Thus we no longer need euidaccess_stat, which was
the sole function used here to operate on a full relative file name.
Remove full_name parameter and update caller.
* lib/euidaccess-stat.h: Remove file.
* lib/euidaccess-stat.c: Likewise.
* m4/euidaccess-stat.m4: Likewise.
* po/POTFILES.in: Remove lib/euidaccess-stat.c.
* m4/prereq.m4 (gl_PREREQ): Don't require gl_EUIDACCESS_STAT.
Prompted by a report from Bruno Haible that the rm/deep-2
test was failing on HP-UX 11.31.
See http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1748

12 years agotests: skip rather than failing when perl is not available
Jim Meyering [Sun, 9 Oct 2011 07:28:37 +0000 (09:28 +0200)]
tests: skip rather than failing when perl is not available

* tests/df/total-verify: Use require_perl_, so that this test is
skipped when perl is not available.
* tests/rm/deep-2: Likewise, and fix wording in a comment.
Reported by Bruno Haible.

12 years agotests: avoid tail-2/F-vs-missing failure on NFS
Jim Meyering [Sat, 8 Oct 2011 17:57:21 +0000 (19:57 +0200)]
tests: avoid tail-2/F-vs-missing failure on NFS

* tests/tail-2/F-vs-missing: This test would fail about 80% of the
time on linux/powerpc when run in an NFS-mounted directory.
Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1727

12 years agotests: avoid ls/slink-acl test failure on Solaris 10
Jim Meyering [Sat, 8 Oct 2011 15:57:01 +0000 (17:57 +0200)]
tests: avoid ls/slink-acl test failure on Solaris 10

* tests/ls/slink-acl: Use setfacl's "-m user::r" option rather than
less-portable "-m m::r".  The latter did not work with Solaris 10's
version of setfacl.  Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1737

12 years agotests: avoid false-positive failures on linux/sparc64
Jim Meyering [Sat, 8 Oct 2011 15:11:10 +0000 (17:11 +0200)]
tests: avoid false-positive failures on linux/sparc64

* tests/init.cfg (require_strace_): Detect a version of strace
that fails on linux/sparc64 for 64-bit executables.  Report and
most of the suggested fix from Bruno Haible:
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1728

12 years agobuild: let bootstrap resort to wget for downloading .po files
Bernhard Voelker [Mon, 5 Sep 2011 11:28:20 +0000 (13:28 +0200)]
build: let bootstrap resort to wget for downloading .po files

* bootstrap (download_po_files): Fallback to wget when downloading
the .po files via rsync failed.  This is necessary to bootstrap behind
a strict firewall.

12 years agodoc: clean up NEWS
Jim Meyering [Wed, 5 Oct 2011 17:32:54 +0000 (19:32 +0200)]
doc: clean up NEWS

* NEWS: Mention when the sort -g infloop bug was introduced and
alphabetize entries.  Clarify a sentence in the pwd-improvement entry.

12 years agotests: add a test to exercise today's ls-lL-vs-ACL bug
Jim Meyering [Mon, 3 Oct 2011 11:49:47 +0000 (13:49 +0200)]
tests: add a test to exercise today's ls-lL-vs-ACL bug

* tests/ls/slink-acl: New file.
* tests/Makefile.am (TESTS): Add it.
* tests/init.cfg (require_setfacl_): New function.
* gnulib: Update to latest, for file-has-acl changes.
* NEWS (Bug fixes): Mention it.
See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28538.  This
":>k; setfacl -m m::r k; ln -s k s; ls -Log s" should print e.g.,
    -rw-r-----+ 1 0 Oct  5 19:22 s
With the ls from coreutils-8.13, it would print this (with "." or
nothing in place of the "+"):
    -rw-r-----. 1 0 Oct  5 19:22 s

12 years agobuild: don't use automake's obsolete AM_C_PROTOTYPES macro
Jim Meyering [Mon, 3 Oct 2011 09:01:44 +0000 (11:01 +0200)]
build: don't use automake's obsolete AM_C_PROTOTYPES macro

* m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove use of AM_C_PROTOTYPES,
now that automake rejects it.

12 years agomaint: clean up m4 syntax
Jim Meyering [Sat, 1 Oct 2011 17:48:17 +0000 (19:48 +0200)]
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.

12 years agobuild: use getgr*_nomembers functions on Interix
Markus Duft [Thu, 8 Sep 2011 11:09:27 +0000 (13:09 +0200)]
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.

12 years agobuild: accommodate missing setgroups on Interix
Markus Duft [Thu, 8 Sep 2011 09:18:17 +0000 (11:18 +0200)]
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.

12 years agobuild: stop distributing gzip'd releases; xz is enough
Jim Meyering [Sat, 1 Oct 2011 12:25:54 +0000 (14:25 +0200)]
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.

12 years agobuild: update gnulib submodule to latest
Jim Meyering [Sat, 1 Oct 2011 12:26:06 +0000 (14:26 +0200)]
build: update gnulib submodule to latest

12 years agodoc: mention the recent ls -L "argetm" fix in NEWS
Pádraig Brady [Sat, 1 Oct 2011 01:35:32 +0000 (02:35 +0100)]
doc: mention the recent ls -L "argetm" fix in NEWS

* NEWS: Mention the bug fix

12 years agols: fix output of dangling symlinks colored as target
Pádraig Brady [Sat, 1 Oct 2011 00:47:53 +0000 (01:47 +0100)]
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.

12 years agols: avoid reading beyond end of color indicator
Jim Meyering [Fri, 30 Sep 2011 18:13:01 +0000 (20:13 +0200)]
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.

12 years agotests: update gnulib to latest, to fix test link failure
Jim Meyering [Wed, 28 Sep 2011 06:07:24 +0000 (08:07 +0200)]
tests: update gnulib to latest, to fix test link failure

12 years agosort: avoid a NaN-induced infloop
Jim Meyering [Tue, 27 Sep 2011 14:32:35 +0000 (16:32 +0200)]
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.

12 years agobuild: update gnulib submodule to latest
Jim Meyering [Sat, 24 Sep 2011 11:18:30 +0000 (13:18 +0200)]
build: update gnulib submodule to latest

12 years agomaint: avoid new syntax-check failure
Jim Meyering [Mon, 19 Sep 2011 18:13:36 +0000 (20:13 +0200)]
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.

12 years agotests: mention new check-expensive/check-very-expensive in test logs
Bernhard Voelker [Mon, 19 Sep 2011 18:02:22 +0000 (20:02 +0200)]
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.

12 years agotests: introduce make targets check-expensive and check-very-expensive
Bernhard Voelker [Mon, 19 Sep 2011 18:00:56 +0000 (20:00 +0200)]
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.

12 years agotimeout: handle implicitly created threads
Pádraig Brady [Wed, 21 Sep 2011 14:22:52 +0000 (15:22 +0100)]
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.

12 years agotests: init.sh: support any non-GNU diff
Bruno Haible [Mon, 19 Sep 2011 17:24:35 +0000 (19:24 +0200)]
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.

12 years agognulib: update for getcwd fix on systems without openat
Jim Meyering [Mon, 19 Sep 2011 15:10:58 +0000 (17:10 +0200)]
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.

12 years agomd5sum: clarify what is meant by binary/text flag.
Reuben Thomas [Sat, 17 Sep 2011 15:05:17 +0000 (16:05 +0100)]
md5sum: clarify what is meant by binary/text flag.

        src/md5sum.c: Clarify that we are talking about input mode.
        doc/coreutils.texi: Ditto.

12 years agotests: cp-parents: don't let a failing chmod go unnoticed
Jim Meyering [Mon, 19 Sep 2011 08:53:45 +0000 (10:53 +0200)]
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.

12 years agorandread: add FIXME comment for RDRAND
Paul Eggert [Sat, 17 Sep 2011 15:53:45 +0000 (08:53 -0700)]
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.

12 years agomd5sum: handle BSD reversed format checksums
Pádraig Brady [Fri, 16 Sep 2011 10:47:35 +0000 (11:47 +0100)]
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.

12 years agodoc: improve description of join's -a option
Eric Blake [Tue, 13 Sep 2011 22:07:11 +0000 (16:07 -0600)]
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.

12 years agobuild: avoid unwarranted failure w/gcc-4.6.1 and --enable-gcc-warnings
Jim Meyering [Mon, 12 Sep 2011 13:04:32 +0000 (15:04 +0200)]
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.

12 years agodoc: fix typo in test script comment
Jim Meyering [Thu, 8 Sep 2011 20:03:17 +0000 (22:03 +0200)]
doc: fix typo in test script comment

* tests/d_type-check: Fix typo in comment.

12 years agomaint: post-release administrivia
Jim Meyering [Thu, 8 Sep 2011 15:23:21 +0000 (17:23 +0200)]
maint: post-release administrivia

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

12 years agoversion 8.13 v8.13
Jim Meyering [Thu, 8 Sep 2011 15:04:42 +0000 (17:04 +0200)]
version 8.13

* NEWS: Record release date.

12 years agobuild: update gnulib submodule to latest
Jim Meyering [Thu, 8 Sep 2011 13:49:42 +0000 (15:49 +0200)]
build: update gnulib submodule to latest

12 years agostat: avoid compilation failure on AIX 7.x
Jim Meyering [Thu, 8 Sep 2011 09:52:55 +0000 (11:52 +0200)]
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

12 years agotests: adjust PATH to include /sbin for mkfs-using tests
Bernhard Voelker [Wed, 7 Sep 2011 09:58:52 +0000 (11:58 +0200)]
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.

12 years agotests: avoid false-positive "make check" failure when perl is missing
Jim Meyering [Wed, 7 Sep 2011 09:18:20 +0000 (11:18 +0200)]
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.

12 years agocp: update gnulib to get support for NFSv4 ACLs
Jim Meyering [Tue, 6 Sep 2011 06:02:33 +0000 (08:02 +0200)]
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.

12 years agotests: init.sh: work also with any non-GNU diff that supports -u
Bruno Haible [Fri, 2 Sep 2011 08:51:52 +0000 (10:51 +0200)]
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.

12 years agotests: remove require-perl script; use function instead
Jim Meyering [Thu, 1 Sep 2011 21:59:02 +0000 (23:59 +0200)]
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.

12 years agotests: cut: exercise distro-added multibyte code paths
Jim Meyering [Thu, 1 Sep 2011 19:30:10 +0000 (21:30 +0200)]
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.

12 years agodoc: describe test control variables
Pádraig Brady [Fri, 2 Sep 2011 10:33:42 +0000 (11:33 +0100)]
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.

12 years agotimeout: fixup previous warning fix
Pádraig Brady [Thu, 1 Sep 2011 14:50:08 +0000 (15:50 +0100)]
timeout: fixup previous warning fix

* src/timeout.c (settimeout): Fix the previous commit
to test errno rather than the return value.

12 years agotests: split/l-chunk: avoid a portability issue
Pádraig Brady [Thu, 1 Sep 2011 14:43:25 +0000 (15:43 +0100)]
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

12 years agotests: pwd-long: diagnose failure earlier
Jim Meyering [Thu, 1 Sep 2011 13:11:12 +0000 (15:11 +0200)]
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.

12 years agotests: printf-surprise: avoid false-positive failure
Jim Meyering [Thu, 1 Sep 2011 12:45:51 +0000 (14:45 +0200)]
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.

12 years agotests: improve message in 'require_membership_in_two_groups_' function
Bernhard Voelker [Thu, 1 Sep 2011 09:11:06 +0000 (11:11 +0200)]
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.

12 years agotests: misc/printf: accommodate alternate behavior
Jim Meyering [Thu, 1 Sep 2011 10:14:11 +0000 (12:14 +0200)]
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.

12 years agotests: invoke via "env printf", rather than using an absolute name
Jim Meyering [Thu, 1 Sep 2011 10:09:32 +0000 (12:09 +0200)]
tests: invoke via "env printf", rather than using an absolute name

* tests/misc/printf: This results in more concise diagnostics.

12 years agotimeout: suppress a redundant warning on some systems
Pádraig Brady [Thu, 1 Sep 2011 14:30:18 +0000 (15:30 +0100)]
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

12 years agostdbuf: fix helper lib identification on some platforms
Pádraig Brady [Thu, 1 Sep 2011 14:23:17 +0000 (15:23 +0100)]
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

12 years agobuild: avoid the use of strsignal() in split
Pádraig Brady [Thu, 1 Sep 2011 14:07:51 +0000 (15:07 +0100)]
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

12 years agodate: support parsing of ISO-8601-with-"T" dates
Jim Meyering [Tue, 30 Aug 2011 21:02:28 +0000 (23:02 +0200)]
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.

12 years agobuild: heap.c: make possible gnulib candidate c89 compatible
Pádraig Brady [Tue, 30 Aug 2011 14:09:23 +0000 (15:09 +0100)]
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.

12 years agotimeout: revert signal propagation enhancement
Pádraig Brady [Thu, 25 Aug 2011 10:25:30 +0000 (11:25 +0100)]
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`

12 years agomaint: rename a test
Jim Meyering [Wed, 24 Aug 2011 08:40:51 +0000 (10:40 +0200)]
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.

12 years agotests: adjust the new, very expensive rm test to be less expensive
Jim Meyering [Wed, 24 Aug 2011 08:36:25 +0000 (10:36 +0200)]
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.

12 years agopr: fix so that LAST_PAGE is honored with -T
Pádraig Brady [Tue, 23 Aug 2011 23:09:30 +0000 (00:09 +0100)]
pr: fix so that LAST_PAGE is honored with -T

Ever since the LAST_PAGE functionality was added
in commit ed0923a1, 1996-12-05,
"Apply big patch (patch-20) from Roland Huebner"
it was ignored when -t or -T were specified or
when -l <= 10.

* src/pr.c (print_page): Increment the current page here.
(print_header): Don't increment the current page here.
* tests/pr/pr-tests: Add a test case.
* NEWS: Mention the fix

Reported at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9347