Commit Graph

868 Commits

Author SHA1 Message Date
Eric Blake
72a0a8264d maint: apply correct license to auxiliary files
* gnulib: Update, for maint.mk improvements.
* HACKING: Use GFDL 1.3, not 1.2.
* NEWS: Likewise.
* README: Likewise.
* cfg.mk (old_NEWS_hash): Update accordingly.
* .gitignore: Ignore file created by 'make update-NEWS-hash'.
2010-01-06 21:05:52 -07:00
Eric Blake
7a1f69aae0 cp, touch: avoid problem with new glibc
* gnulib: Update, for utimens fix.
* NEWS: Mention the fix.
Reported by Guillaume Ayoub in http://bugs.debian.org/563726.
See also http://bugzilla.redhat.com/552320.

Signed-off-by: Eric Blake <ebb9@byu.net>
2010-01-06 06:42:16 -07:00
Philip Rowlands
bbdc929602 doc: fix typo in NEWS
* NEWS: Fix typo: s/repeated/repeatedly/
2010-01-05 14:11:56 +01:00
Eric Blake
b7f2b51c42 ls: fix color of broken symlinks colored as target
* src/ls.c (print_color_indicator): When using 'LINK target' in
dircolors, treat broken symlink as C_ORPHAN.
* tests/misc/ls-misc (sl-dangle2, sl-dangle3, sl-dangle4)
(sl-dangle5): Test for it, and add more coverage.
* NEWS: Document it.
* THANKS: Update.
Reported by Chris Jones.
2010-01-01 13:41:46 -07:00
Jim Meyering
1aa17dc89b maint: update all FSF copyright year lists to include 2010
Use this command:
git ls-files | grep -v COPYING \
  | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \
      build-aux/update-copyright
2010-01-01 14:06:47 +01:00
Eric Blake
7e0c2b9a59 touch: work around ntfs-3g bug
* gnulib: Update, for utimensat fix.
* NEWS: Improve wording about touch fixes.
* THANKS: Update.
Reported by Stuart Citrin.
2009-12-30 20:33:39 -07:00
Jim Meyering
d3a4bc86cd doc: mention two tail -F bug fixes in NEWS
* NEWS (Bug fixes): Two tail -F fixes.
2009-12-30 11:22:55 +01:00
Pádraig Brady
8d2ecd4a3e tail: fix --follow to not use inotify on remote files
* src/tail.c (struct File_spec): Add a flag to record if file is remote.
(recheck): If we're using inotify then check if the file has gone remote
and if so, drop it with a warning.
(any_remote_files): A new function to check for any open remote files.
(tailable_stdin): A new function to refactor the check for whether
a tailable file was specified through stdin.
(fremote): A new function to check if a file descriptor
refers to a remote file.
(tail_forever_inotify): Add some comments.
(tail_file): Record if a file is remote when initially opened.
(main): Disable inotify if any remote files specified.
Also document the caveat about remounted files not
being noticed by inotify.
* NEWS: Mention the fix.
2009-12-25 00:56:41 +00:00
Pádraig Brady
11dc0016bb wc: line-buffer the printed counts
* src/wc.c (main): Set stdout to line buffered mode
to ensure parallel running instances don't intersperse
their output.  This adds 6.5% to the run time in the worst case
of many zero length files, but has neglible impact for
standard sized files.
* tests/misc/wc-parallel: New test for atomic output.
* tests/Makefile.am: Reference it.
* NEWS: Mention the fix
This is similar to commit 710fe413, 20-10-2009,
"md5sum, sha*sum, sum: line-buffer the printed checksums"
2009-12-23 13:45:34 +00:00
Pádraig Brady
53db8d6479 stat: Recognize k-afs, gfs, ocfs2 file system types
* src/stat.c (human_fstype): Add k-afs, gfs/gfs2 and ocfs2.
* NEWS: Update the stat -f entry.
2009-12-22 16:55:04 +00:00
Pádraig Brady
4b449caf2d stat: add support for more file system types
* src/stat.c (human_fstype): Add the following FS types:
fuseblk, rpc_pipefs.  Also fix a typo of minux3 to minix3,
and mention the fs-magic-compare make target to help update the list.
* NEWS: Mention the fix.
2009-12-22 11:17:01 +00:00
Eric Blake
01e4f003a0 touch: fix ctime regression in 'touch -a'
Regression introduced in coreutils 8.1 due to a bug in the Linux
kernel implementation of utimensat with mtime of UTIME_OMIT.

* gnulib: Update to latest, to pick up utimensat fix.
* NEWS: Mention the change.
* THANKS: Update.
Reported by John Stanley.
2009-12-19 17:32:45 -07:00
Pádraig Brady
d64c186d8e rm: fix --one-file-system regression due to fts conversion
* src/remove.c (rm_fts): Fix incorrect comparison of
device and inode numbers.
* tests/rm/one-file-system2: Add a separate test so
that it can be run as a normal user (It doesn't need to mount).
* tests/Makefile.am: Reference it.
* NEWS: Mention the fix.
Reported by Jan Larres.
2009-12-19 01:14:07 +00:00
Jim Meyering
a0000ba4ae post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-12-11 14:43:13 +01:00
Jim Meyering
70d023b076 version 8.2
* NEWS: Record release date.
2009-12-11 14:00:40 +01:00
Jim Meyering
fc4d3f63b0 tail: don't call fstat on an uninitialized FD
This bug showed up via valgrind as a "Conditional jump or move
depends on uninitialized value(s)" error.
* src/tail.c (ignore_fifo_and_pipe): New function.
(main): Use it only when tailing forever.
The code to compute n_viable and mark some F[i] as ignored would call
isapipe on an uninitialized file descriptor.  But n_viable and those
.ignored marks are useful/used only when tailing forever.  This bug
was introduced via commit f0ff8c73 (7.6), "tail: make the new
piped-stdin test as portable as the old one".
* NEWS (Bug fixes): Mention it.
2009-12-11 12:15:13 +01:00
Jim Meyering
3df2108b0d doc: NEWS: mention that gnulib's mgetgroups fix affects id
* NEWS (Bug fixes): Mention the "id" bug fix inherited via this gnulib
change: "mgetgroups: do not write bytes beyond end of malloc'd buffer"
http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=51d5e813e9ee6cf23
2009-12-11 08:51:28 +01:00
Jim Meyering
bb4cb10e89 doc: NEWS: the "make distcheck" vulnerability dates back to 5.0
* NEWS (Bug fixes): Correct the introduced-in version number.
This was introduced on 2003-04-02 by commit 722a49ea.
2009-12-09 13:58:12 +01:00
Jim Meyering
23c0cecaa8 doc: NEWS: mention the "make distcheck" vulnerability
* NEWS (Bug fixes): Mention implications of the "make distcheck" change.
This was introduced on 2008-07-22 by commit 9bb0d576, "tests: ensure
"make check" w/tainted build dir no longer impacts $HOME".
2009-12-09 13:09:33 +01:00
Pádraig Brady
f5a97b8269 sort: fix failure if sort's parent has ignored SIGCHLD
* src/sort.c (main): Reset the SIGCHLD handler to the default
as otherwise wait() could return an error.
* tests/misc/sort-compress: Set the CHLD handler in a subshell
to SIG_IGN to ensure the sort command resets it to SIG_DFL.
* NEWS: Mention the fix.
2009-12-08 15:29:27 +00:00
Pádraig Brady
73d4626134 timeout: fix failure if timeout's parent has ignored SIGCHLD
* src/timeout.c (main): Reset the SIGCHLD handler to the default
as otherwise wait() could return -1 and set errno to ECHILD.
This condition was ignored until commit 0b1dcf33, on 31-08-2009,
"timeout: defensive handling of all wait() errors"
but subsequently timeout would run the command correctly
but then fail with an error message.
* tests/misc/timeout: In a subshell set the CHLD handler to
SIG_IGN to ensure the timeout command resets it to SIG_DFL.
* NEWS: Mention the fix.
2009-12-08 15:17:01 +00:00
Eric Blake
9b4b38f56e id: handle systems without getgroups support
If getgroups failed with ENOSYS, mgetgroups would unnecessarily
fail, and that provoked id into freeing an uninitialized pointer.
Meanwhile, we were not using xalloc_die properly.  Both issues
are better solved in gnulib, by introducing xgetgroups; this
patch uses the new interface.

Regression introduced by commit 6a31fd8d7.

* gnulib: Update, for mgetgroups improvments.
* src/id.c (print_full_info): Adjust caller to die on allocation
failure, and no longer worry about ENOSYS.
* src/group-list.c (print_group_list): Likewise.
* src/setuidgid.c (main): Likewise.
* NEWS: Mention the fix.
* THANKS: Update.
Reported by Scott Harrison.
2009-12-04 19:18:06 -07:00
Jim Meyering
0dc1f4c6f3 rm: fix empty-name bug introduced with conversion to use fts
While "rm ''" would properly fail, "rm F1 '' F2" would fail
to remove F1 and F2, due to the empty string argument.
This bug was introduced on 2009-07-12, via commit 4f73ecaf,
"rm: rewrite to use fts".
* gnulib: Update to latest, for fixed fts.c.
* NEWS (Bug fixes): Describe it.
* tests/rm/empty-name: Adjust for changed diagnostic.
(mk_file): Define, copied from misc/ls-misc.
(empty-name-2): New test, for today's fix.
* lib/xfts.c (xfts_open): Reflect the change in fts_open, now that
it no longer fails immediately when one argument is the empty string.
Assert that the bit flags were not the cause of failure.
* po/POTFILES.in: Remove xfts.c.
* THANKS: Update.
Reported by Ladislav Hagara.
2009-12-01 14:38:39 +01:00
Jim Meyering
e246d654f3 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-11-18 19:56:25 +01:00
Jim Meyering
447d245551 version 8.1
* NEWS: Record release date.
2009-11-18 19:38:50 +01:00
Jim Meyering
6609ccbf87 doc: mention the du/fts vs. NFSv4 mount-point work-around
* NEWS (Changes in behavior): Mention it.
2009-11-17 08:56:12 +01:00
Jim Meyering
3b997a9bcb tail -F can fail to track a file after it's been rotated
Tailing forever and by-name (--follow=name, -F), tail would
sometimes fail to follow a file that had been removed via rename.
If you can't apply this patch and have tail 7.6 or newer, you can
work around the bug via the undocumented --disable-inotify option.
* src/tail.c (tail_forever_inotify): When tailing by name (-F),
do not un-watch a file upon receipt of the IN_MOVE_SELF event.
Reported by Arjan Opmeer in http://bugs.debian.org/548439.
* NEWS (Bug fixes): Mention it.
Also see http://marc.info/?l=coreutils-bug&m=125829031916515
* tests/Makefile.am (TESTS): Add tail-2/inotify-rotate.
* tests/tail-2/inotify-rotate: New test.
2009-11-16 09:30:43 +01:00
Pádraig Brady
10d97b3191 ls: fix capability coloring
Capability checking was incorrectly done on just the base name
rather than on the whole path.  Consequently there could be both
false positives and negatives when coloring files with capabilities.
Also capability checking was not done at all in certain cases for
non executable files.  Note passing absolute rather than relative
names to cap_get_file() reduces the has_capability() overhead
from around 33% to 30%.  I.E. ls --color is now around 3% faster.

* src/ls.c (struct fileinfo): Add a has_capability member.
(print_color_indicator): Refactor to pass just a fileinfo pointer
and a flag to say if we're dealing with a symlink target.
(print_name_with_quoting): Likewise.
(gobble_file): Set has_capability in the fileinfo struct.  Also do
a capability check even if executable coloring is disabled.
Ditto for SETUID and SETUID coloring.
Comment on how expensive has_capability() is.
(print_long_format): Adjust to refactored print_name_with_quoting.
(quote_name): Likewise.
(print_file_name_and_frills): Likewise.
* tests/ls/capability: Test the various false positive and negatives.
* THANKS: Add reporter (Ivan Labath).
* NEWS: Mention the fix.
2009-11-09 08:16:20 +00:00
Jim Meyering
d9dbbb9a45 chcon, chgrp, chmod and chown now diagnose a directory cycle
* lib/xfts.c (cycle_warning_required): New function.
* lib/xfts.h: Declare it.
* src/chown-core.c (change_file_owner): Diagnose a cycle.
* src/chmod.c (process_file): Likewise.
* src/chcon.c (process_file): Likewise.
* NEWS (Bug fixes): Mention this.
2009-11-07 08:43:00 +01:00
Giuseppe Scrivano
74cf4cb26d nproc: A new program to count the available processors
* AUTHORS: Add my name.
* NEWS: Mention it.
* README: Likewise.
* bootstrap.conf (gnulib_modules): Add nproc.
* doc/coreutils.texi (nproc invocation): Add nproc info.
* man/Makefile.am (nproc.1): Add dependency.
* man/nproc.x: New template.
* man/.gitignore: Ignore generated man page.
* po/POTFILES.in: Add src/nproc.c.
* src/.gitignore: Exclude nproc.
* src/Makefile.am (EXTRA_PROGRAMS): Add nproc.
* src/nproc.c: New file.
* tests/Makefile.am (TESTS): Add misc/nproc-{avail,positive}.
* tests/misc/nproc-avail: New file.
* tests/misc/nproc-positive: New file.
2009-11-06 16:54:12 +00:00
Eric Blake
31a9937081 mktemp: add suffix handling
Now that mkstemps is supported, we might as well use it.

* src/mktemp.c (TMPDIR_OPTION): New enum value.
(longopts): Add new option.
(usage): Document it.
(count_trailing_X_s): Rename...
(count_consecutive_X_s): ...to this, and add parameter.
(mkstemp_len, mkdtemp_len): Add parameter.
(main): Implement new option.
(AUTHORS): Add myself.
* AUTHORS (mktemp): Likewise.
* tests/misc/mktemp: Test new option.
* doc/coreutils.texi (mktemp invocation): Document it.
* NEWS: Likewise.
Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548316.
2009-11-05 07:10:40 -07:00
Eric Blake
41b3a8ed8b mktemp: don't leave file behind on write failure
* src/mktemp.c (main): Remove just-created file if stdout had
problems.
* bootstrap.conf (gnulib_modules): Add remove.
* tests/misc/close-stdout: Test it.
* NEWS: Document it.
2009-11-05 06:53:21 -07:00
Jim Meyering
8ba5d1a70c du now diagnoses cycles, rather than ignoring them
* src/du.c (symlink_deref_bits): New global, decl moved from ...
(main): ...here.
(process_file): When fts detects a directory cycle that can't
be due to symlinks, report it and arrange to exit nonzero.
* NEWS (Bug fixes): Mention it.
2009-11-05 08:32:31 +01:00
Jim Meyering
7bf2e3db23 rm -f: ignore EROFS when it's really ENOENT
rm -f must not print a diagnostic for a nonexistent file.  However,
most linux-based kernel unlinkat functions set errno to EROFS when
the named file (regardless of whether it exists) would lie on a
read-only file system.  remove.c now performs an extra fstatat call
in that case, to determine whether the file exists.
* src/remove.c (excise): Map EROFS to ENOENT, if a file is nonexistent.
Reported by Steven Drake in <http://savannah.gnu.org/bugs/?27923>.
* NEWS (Changes in behavior): Mention it.
2009-11-03 14:14:00 +01:00
Eric Blake
1c59bb3cef nice, nohup, su: detect write failure to stderr
These programs can print non-fatal diagnostics to stderr prior to
exec'ing a subsidiary program.  However, if we thought the situation
warranted a diagnostic, we insist that the diagnostic be printed
without error, rather than blindly exec, as it may be a security risk.

For an example, try 'nice -n -1 nice 2>/dev/full'.  Failure to raise
priority (by lowering niceness) is not fatal, but failure to inform
the user about failure to change priority is dangerous.

* src/nice.c (main): Declare failure if writing advisory message
to stderr fails.
* src/nohup.c (main): Likewise.
* src/su.c (main): Likewise.
* tests/misc/nice: Test this.
* tests/misc/nohup: Likewise.
* NEWS: Document this.
2009-10-28 21:12:41 -06:00
Pádraig Brady
2904d675a4 echo, printf: interpret \e as the Escape character
Match gcc, perl, bash, ksh, tcsh, ... in supporting \e.
* src/printf.c (print_escape_char): Output \x1B when \e encountered.
* src/echo.c (main): Likewise.
* src/stat.c (print_escape_char): Likewise.
* doc/coreutils.texi (echo invocation): Add \e to the list.
* tests/misc/printf: Verify that \e outputs \x1B.
* NEWS: Mention the change in behaviour.
2009-10-28 16:37:07 +00:00
Eric Blake
54491d2751 printenv: ignore bogus variable names
Exposed by env a=b=c printenv a=b.

* src/printenv.c (main): Silently reject = in names.
* tests/misc/printenv: Test for it.
* NEWS: Document this.
2009-10-28 06:24:52 -06:00
Eric Blake
d6de2f198e env, printenv: add -0/--null option
Allows for unambiguous processing when environment values (or even
non-portable names!) contain newline.

* src/env.c (longopts): Add new option.
(usage): Document it.
(main): Implement it.
* src/printenv.c (longopts): New variable.
(usage): Document new option.
(main): Implement it.
* doc/coreutils.texi (Common options): New macro optNull.
(du invocation, env invocation, printenv invocation): Use it.
* NEWS: Mention this.
* tests/misc/env-null: New test.
* tests/Makefile.am (TESTS): Run it.
2009-10-27 19:55:35 -06:00
Eric Blake
243f1b1c71 env: reject bogus -u arguments
* src/env.c (main): Use unsetenv rather than putenv to remove
items from environ, and check for failure.
* bootstrap.conf (gnulib_modules): Add unsetenv.
* tests/misc/env: Test this.
* NEWS: Document it.
2009-10-26 21:30:30 -06:00
Jim Meyering
501bf7b589 nice: execute program even when setpriority fails due to EACCES
* src/nice.c (perm_related_errno): New function.
(main): Use it, rather than testing only errno == EPERM.
* NEWS (Bug fixes): Mention it.
2009-10-26 08:25:34 +01:00
Pádraig Brady
69fbfd400c timeout: don't orphan monitored programs if they ignore specified signals
* src/timeout.c (install_signal_handlers): Handle any user
specified signal, so that if it does not cause the child
to exit then we don't exit and orphan the child. Previously this
for example, would leave an orphan dd process running:
timeout -sUSR1 1s dd if=/dev/zero of=/dev/null
* NEWS: Mention the fix.
2009-10-25 23:28:38 +00:00
Eric Blake
1ce9e1e5ca nohup: use EXIT_CANCELED if not POSIXLY_CORRECT
* src/nohup.c (NOHUP_FAILURE): Rename...
(POSIX_NOHUP_FAILURE): ...to this.
(main): Pay attention to POSIXLY_CORRECT, to determine whether to
use status 125 or 127.
* doc/coreutils.texi (nohup invocation): Document this.
* NEWS: Likewise.
* tests/misc/invalid-opt (exit_status): Adjust expected results.
* tests/misc/help-version (expected_failure_status): Likewise.
* tests/misc/nohup: Likewise.
2009-10-23 16:24:08 -06:00
Eric Blake
b6540b96ba chroot, env, nice, su: use EXIT_CANCELED for internal failure
* src/chroot.c (main): Use EXIT_CANCELED, not EXIT_FAILURE.
* src/env.c (main): Likewise.
* src/nice.c (main): Likewise.
* src/su.c (change_identity, main): Likewise.
* doc/coreutils.texi (chroot invocation, env invocation)
(nice invocation, su invocation): Document this.
* NEWS: Likewise.
* tests/misc/invalid-opt (exit_status): Adjust expected results.
* tests/misc/help-version (expected_failure_status): Likewise.
2009-10-23 16:24:05 -06:00
Giuseppe Scrivano
cd0f3036f6 tail -f: avoid a race condition
* NEWS (Bug fixes): Mention it.
* src/tail.c (check_fspec): New function.
(tail_forever_inotify): Ensure there is no new data before entering the
inotify events wait loop.
2009-10-22 09:11:24 +02:00
Pádraig Brady
710fe413fe md5sum, sha*sum, sum: line-buffer the printed checksums
* src/md5sum.c (main): Set stdout to line buffered mode
to ensure parallel running instances don't intersperse
their output.  This adds 5% to the run time in the worst case
of many zero length files, or 2% with standard file sizes.
* src/sum.c (main): Likewise.
* tests/misc/md5sum-parallel: New test for atomic output.
* tests/Makefile.am: Reference it.
* NEWS: Mention the fix
2009-10-21 16:56:00 +01:00
Eric Blake
9e13b6a0b4 touch: add -h to change symlink timestamps, where supported
* src/touch.c (no_dereference): New flag variable.
(longopts): Add -h/--no-dereference.
(touch): Add symlink handling.
(usage): Document new option.
(main): Accept new option.
* NEWS: Document it.
* doc/coreutils.texi (touch invocation): Likewise.  Also mention
birthtime.
* tests/touch/no-dereference: New test.
* tests/Makefile.am (TESTS): Run it.
2009-10-17 14:36:28 -06:00
Jim Meyering
0023f65fd7 chcon: don't disable just because SELinux is disabled
* src/chcon.c (main): Now that gnulib provides getfilecon wrappers,
we can revert most of the 2009-10-05 commit 3a97d664, "chcon: exit
immediately if SELinux is disabled", since chcon is still useful as
long as the file system provides handlers for the security.*
name space.  gnulib's getfilecon wrappers ensure that an offending
context now evokes a return value of -1.
Prompted by comments from Stephen Smalley in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18394
* NEWS (Bug fixes): Mention it.
2009-10-09 14:33:10 +02:00
Jim Meyering
eb5f06f2a6 stat: add support for many more file system types
* src/stat.c (human_fstype): Add the following FS types,
from <linux/magic.h>: afs, anon-inode FS, btrfs, cgroupfs,
cramfs-wend, debugfs, futexfs, inotifyfs, minux3, securityfs,
selinux, xenfs.
Also add "nilfs".
* src/Makefile.am (fs-kernel-magic): New rule.
* NEWS (Bug fixes): Mention this.
2009-10-08 10:18:28 +02:00
Jim Meyering
8e32390716 stat: recognize CIFS and HFS file system types
* src/stat.c (human_fstype) [CIFS, HFS]: Add new file system types.
Prompted by a report from Stuart Kemp.
Normalize the form of a few hexadecimal magic numbers.
Alphabetize on S_MAGIC_ case names.
* src/Makefile.am (fs-magic-compare, fs-def, fs-magic): New rules, to
automate comparison of our list with that in the Linux statfs man page.
* NEWS (Bug fixes): Mention it.
2009-10-08 09:07:12 +02:00
Guenter Knauf
b95be30e3f md5sum, sha*sum: also accept openssl checksum syntax
* src/md5sum.c (split_3): Accept openssl checksum syntax, which
differs only by two spaces from that of the bsd checksum tools:
openssl: MD5(f)= d41d8cd98f00b204e9800998ecf8427e
bsd:     MD5 (f) = d41d8cd98f00b204e9800998ecf8427e
2009-10-07 09:31:27 +02:00
Jim Meyering
96829a9ff0 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-10-06 13:20:18 +02:00
Jim Meyering
ca1e31f3c5 version 8.0
* NEWS: Record release date.
2009-10-06 13:04:16 +02:00
Pádraig Brady
f8726e05c4 tail: avoid a race where we could miss new data with --pid
* src/tail.c (tail_forever, tail_forever_inotify): Close a race in
tail_forever_inotify where new data written after the file check by
a now dead process, but before the pid check, is not output.  We use
the POSIX guarantee that read() and write() are serialized wrt each
other even in separate processes, to assume full file consistency
after exit() and so poll for new data _after_ the writer has exited.
This also allows us to not redundantly _wait_ for new data if the
process is dead.
* tests/tail-2/pid: Remove the now partially invalid sub second sleep
check as we now don't unconditionally wait, and replace it with a check
for the redundant sleep.  Also clarify some of the existing comments.
* NEWS: Mention the fix.
2009-10-02 14:00:06 +01:00
Pádraig Brady
d4c7114bce ls: always print "?" for allocated size of a dereferenced dangling symlink
Previously for `ls -Ls` (but not `ls -Lsl`), we referenced
the st_blocks returned from the previous failed stat() call.
This undefined value was seen to be 0 for dangling symlinks at least.
* src/ls.c (print_file_name_and_frills, length_of_file_name_and_frills):
Don't use st_blocks if the previous stat() failed
* tests/ls/dangle: Add a test case
* NEWS: Mention the fix, and roll up related items into a single entry.
2009-09-30 15:42:35 +01:00
Jim Meyering
a033e28737 stat: interpret "-" as standard input
* src/stat.c (do_stat): Interpret a command line argument of "-"
to mean "standard input", like many other tools do.
(do_statfs): Fail upon any attempt to use "-".
* NEWS (Changes in behavior): Mention it.
* tests/misc/stat-hyphen: New test, to exercise the above.
* tests/Makefile.am (TESTS): Add misc/stat-hyphen.
2009-09-29 16:04:12 +02:00
Jim Meyering
b7aaa0da8b ls: don't use an undefined struct stat after failed stat/lstat
* src/ls.c (format_inode): Access f->stat only if f->stat_ok is set.
* NEWS (Bug fixes): Mention it.
Improved-by: Pádraig Brady <P@draigBrady.com>
2009-09-29 14:12:30 +02:00
Jim Meyering
36edf7bad2 ls: print "?", not "0" as inode of dereferenced dangling symlink
ls prints inode numbers two ways: for long (-l) listings,
and for short ones, e.g., ls -li and ls -i.  The code to print
long listings properly printed "?" when the inode was unknown,
but the code for handling short listings would print 0 instead.
Factor out the formatting code into a new function so ls prints
the right string ("?") from both places:
* NEWS (Bug fixes): Mention it.
* src/ls.c (format_inode): New function.
(print_long_format): Use it here.
(print_file_name_and_frills): Use it here, too.
* tests/ls/dangle: Exercise this fix.
Reported by Yang Ren in http://bugzilla.redhat.com/525400
2009-09-29 11:42:45 +02:00
Jim Meyering
242689c7f9 ls: with -LR, exit with status 2 upon detecting a cycle
* src/ls.c (print_dir): Diagnosing the cycle is not enough.
Also set exit status to 2.  This is what Solaris' /bin/ls does, too.
* tests/ls/infloop: Rework test: match both expected stdout and stderr.
Require an exit status of 2 in this case.
* doc/coreutils.texi (ls invocation): Mention that a loop provokes
in an exit status of 2.
* NEWS (Bug fixes): Mention it.
Reported by Yang Ren in http://bugzilla.redhat.com/525402.
* THANKS: Correct ordering of Yang Ren's names.
2009-09-29 07:28:39 +02:00
Eric Blake
efcee783e4 ln: add -L/-P options
* src/ln.c (STAT_LIKE_LINK): Delete.
(logical): New flag.
(long_options): Add -L, -P.
(usage): Mention them.
(main): Choose between them.
(do_link): Perform correct action.
* tests/ln/misc: Move hard-to-sym portion of test...
* tests/ln/hard-to-sym: ...into new test, and add more.
* tests/Makefile.am (TESTS): Run new test.
* NEWS: Document this.
* doc/coreutils.texi (link invocation, ln invocation): Likewise.
* bootstrap.conf (gnulib_modules): Add linkat.
2009-09-25 07:03:03 -06:00
Eric Blake
82124c3c06 maint: summarize gnulib changes
* NEWS: Provide a blurb about recent gnulib improvements.  Fix typo
in readlink blurb.
2009-09-23 06:45:07 -06:00
Eric Blake
8a1edc971f readlink: pick up gnulib changes to readlink -f
* bootstrap.conf (obsolete_gnulib_modules): Move rename...
(gnulib_modules): ...here.  Add symlink.
* NEWS: Document the change in readlink.
* doc/coreutils.texi (readlink invocation): Likewise.
* tests/readlink/can-f: Update test to new semantics, and add test
of loop.
2009-09-23 08:45:08 +02:00
Pádraig Brady
3a169f4c5d ls: handle disabling of colors consistently for all tile types
* src/ls.c (print_color_indicator): Use consistent syntax for
all file and directory subtypes, and fall back to the color
of the base type if there is no enabled color for the subtype.
This allows turning off specific colors for o+w dirs for example.
* tests/ls/color-dtype-dir: Add a case to test that turning off
coloring for o+w directories, falls back to standard dir color.
* NEWS: Mention the fix
Introduced by commit ac467814, 2005-09-05,
"Colorize set-user-ID ... files and sticky ... directories."
2009-09-21 13:16:44 +01:00
Jim Meyering
a77fb35364 doc: NEWS: mention origin of touch -t ....60 bug
* NEWS: It is an old bug.
2009-09-14 15:57:13 +02:00
Jim Meyering
20761ce686 touch: don't reject "60" as number of seconds in a legacy time stamp
A valid command like "touch -t 197101010000.60 F" would fail due
to the suffix of ".60".  This bug is fixed via the latest change
to gnulib's posixtm module.
* tests/touch/60-seconds: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
2009-09-14 15:27:51 +02:00
Ondřej Vašík
cca83fafa6 cp,mv: preserve extended attributes even for read-only files
* src/copy.c (copy_reg): Temporarily set u+rw on the destination file
to allow GNU/Linux to set xattrs.
* tests/misc/xattr: Test that change.
* NEWS (Bug fixes): Mention it.
Reported by Ernest N. Mamikonyan.
2009-09-14 14:19:03 +01:00
Jim Meyering
f6f78f093b doc: NEWS: say quadratic and linear, rather than O(N^2) and O(N)
* NEWS: Use a slightly less technical description.
Suggested by Andreas Schwab.
2009-09-13 12:11:57 +02:00
Jim Meyering
21b617b78b doc: improve NEWS
* NEWS (rm -r, without -f): Mention that the N in "O(N)" represents
hierarchy depth.  Suggested by Ralf Wildenhues.
(rm -r, standards conformance): Make wording more accurate.
2009-09-13 11:58:48 +02:00
Jim Meyering
ebbf0a1f0f id: don't print context=... when POSIXLY_CORRECT is set
* src/id.c (print_full_info) [POSIXLY_CORRECT]: Don't print context.
Reported by Ulrich Drepper.
* NEWS (Changes in behavior): Mention it.
* doc/coreutils.texi (id invocation): Document that id also prints the
security context, when possible, and when POSIXLY_CORRECT is not set.
* tests/id/no-context: New file.  Test for this.
* tests/Makefile.am (TESTS): Add it.
2009-09-11 19:58:18 +02:00
Jim Meyering
722287e443 rm: improve efficiency of rm -r (without -f) from O(N^2) to O(N)
where N is the depth of the deepest hierarchy rm is processing.
* src/remove.c (write_protected_non_symlink): Use faccessat to
avoid O(N)-per-entry cost of calling euidaccess.
* m4/jm-macros.m4 (coreutils_MACROS): Check for faccessat.
* NEWS (Improvements): Mention it.
2009-09-11 14:08:58 +02:00
Jim Meyering
4f73ecaf7d rm: rewrite to use fts
* remove.c: Don't include "unlinkdir.h"; no longer used.
Do not include <setjmp.h> or "cycle-check.h".  Likewise.
Include "xfts.h".
(dir_name, dir_len): Remove definitions.
(CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Likewise.
(INODE_SORT_DIR_ENTRIES_THRESHOLD, NEED_REWIND, D_TYPE): Likewise.
(struct dirstack_state, Dirstack_state): Likewise.
(g_buf, g_n_allocated): Remove declarations.
(hash_freer, hash_compare_strings, rm_malloc): Remove functions.
(rm_free, push_dir, top_dir, pop_dir, right_justify): Likewise.
(full_filename0, xfull_filename, full_filename_): Likewise.
(AD_stack_height, AD_stack_top, AD_stack_pop, AD_stack_clear): Likewise.
(obstack_init_minimal, ds_init, ds_clear, ds_free): Likewise.
(AD_pop_and_chdir, AD_ensure_initialized, AD_mark_helper): Likewise.
(AD_mark_as_unremovable, AD_mark_current_as_unremovable): Likewise.
(AD_push_initial, AD_push, AD_push, AD_is_removable): Likewise.
(write_protected_non_symlink): Change 3rd parameter from
dirstack_state "ds" to full_name.
(prompt): Adjust parameters.  Now, state comes from FTS/FTSENT pair.
Those replace fd_cwd and "ds".  Remove "filename".  Remove pdirent_type
in favor of new "is_dir" parameter.  Rename is_empty to is_empty_p.
(DO_RMDIR, DO_UNLINK): Remove definitions.
(remove_entry, fd_to_subdirp, compare_ino): Remove functions.
(dirent_count, dirent_inode_sort_may_be_useful): Likewise.
(preprocess_dir): Likewise.
(fts_skip_tree, mark_ancestor_dirs, excise, rm_fts): New functions.
(remove_cwd_entries, remove_dir, rm_1): Remove functions.
(rm): Rewrite as a simple loop calling fts_read and dispatching
each entry via rm_fts.
* src/rm.c (main): Adapt to new signature of rm().
* bootstrap.conf (gnulib_modules): Remove unlinkdir, no longer used.
* src/Makefile.am (sc_tight_scope): Also recognize an extern "enum"
declaration.
* tests/rm/empty-name: Adjust expected output to match new diagnostic.
* NEWS (Improvements): Mention it.
2009-09-11 14:08:51 +02:00
Jim Meyering
bd11475627 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-09-11 08:16:18 +02:00
Jim Meyering
aa2f797c7d version 7.6
* NEWS: Record release date.
2009-09-11 07:53:16 +02:00
Jim Meyering
ebc7aacf7b link,ln: use gnulib's link module to work around Solaris 10 deficiency
Before this change, :>f; ln -T f no-such/ would succeed on Solaris 10.
After it, ln fails, as it should: ln: accessing `z/': Not a directory
The command, link f no-such/, had the same problem on that system.
* bootstrap.conf (gnulib_modules): Add "link".
* tests/ln/slash-decorated-nonexistent-dest: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Portability): Mention the improvement.
2009-09-10 18:52:12 +02:00
Jim Meyering
0bbb9d7785 dd conv=unblock: print final newline consistently
* src/dd.c (dd_copy) [C_UNBLOCK]: Always print the final newline for
non-empty output, not just when output size is a multiple of cbs.
* doc/coreutils.texi (dd invocation) [conv=unblock]: Mention that dd
prints a newline after each output record, not just when replacing
trailing spaces.
Reported by Ulrich Drepper.
* tests/dd/unblock: New file.  Test for this.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
2009-09-10 12:25:04 +02:00
Jim Meyering
f0ff8c73fe tail: make the new piped-stdin test as portable as the old one
* src/tail.c (main): Adapt piped-stdin test to use the same isapipe,
test as was used in the preceding POSIXLY_CORRECT condition.
Remove the now-subsumed POSIXLY_CORRECT test.
Reported by Pádraig Brady.
* doc/coreutils.texi (tail invocation): Document this change.
* NEWS (Changes in behavior): Reclassify, clarify.
2009-09-08 13:30:38 +02:00
Jim Meyering
af6436559c tail: ignore -f for piped-stdin, as POSIX requires
* src/tail.c (main): Tailing a pipe "forever" is not useful,
and POSIX specifies that tail ignore the -f when there is no
file argument and stdin is a FIFO or pipe.  So we do that.
In addition, GNU tail excludes "-" arguments from the list of files
to tail forever, when the associated file descriptor is connected
to a FIFO or pipe.  Before this change, ":|tail -f" would hang.
Reported by Ren Yang and Ulrich Drepper.
* tests/tail-2/pipe-f: Test for this.
* tests/tail-2/pipe-f2: Ensure tail doesn't exit early for a fifo.
* tests/Makefile.am (TESTS): Add these tests.
* NEWS (POSIX conformance): Mention it.
2009-09-07 23:19:56 +02:00
Jim Meyering
f68f5f23c6 doc: tweak NEWS
* NEWS (dd): Tweak wording.
Two blank lines between sections.
2009-09-07 09:23:48 +02:00
Jim Meyering
cdfb703c5d tail -f: handle "-"/stdin once again
* src/tail.c (main) [HAVE_INOTIFY]: When stdin (i.e., "-", or no args,
but not /dev/stdin) is specified on the command line, don't use inotify.
Reported by Bill Brelsford in <http://bugs.debian.org/545422>.
* tests/tail-2/follow-stdin: New file.  Test for this.
* tests/Makefile.am (TESTS): Add the test.
* NEWS (Bug fixes): Mention it.
This bug was introduced in coreutils-7.5 via commit ae494d4b,
2009-06-02, "tail: use inotify if it is available".
2009-09-07 09:01:14 +02:00
Jim Meyering
d54376db68 tail: flush initial output before possibly blocking
* src/tail.c (main): Flush any output from tail_file,
before calling tail_forever_inotify, which can block.
* tests/tail-2/flush-initial: New file.  Test for the bug.
* tests/Makefile.am (TESTS): Add tail-2/flush-initial.
* NEWS (Bug fixes): Mention it.
This bug was introduced in coreutils-7.5 via commit ae494d4b,
2009-06-02, "tail: use inotify if it is available".
2009-09-06 09:40:43 +02:00
Jim Meyering
e0e8429c24 df: don't fail due to an unreadable argument
* src/df.c (main): If open or fstat fails when we're trying to ensure
that all arg-partitions are automounted, fall back on using stat.
Inspired by the report and patch from Olivier Fourdan in
http://bugzilla.redhat.com/520630.
* NEWS (Bug fixes): Mention it.
* tests/df/unreadable: New test for the above.
* tests/Makefile.am (TESTS): Add df/unreadable.
The bug was introduced in coreutils-7.3 via commit dbd17157,
2009-04-28, "df: use open(2), not stat, to trigger automounting".
2009-09-03 19:52:47 +02:00
Ondřej Vašík
1a94ac4a05 cp: don't leak resources for each xattr preservation failure
* src/copy.c (copy_reg): Don't return from the function after an
unsuccessful and required preservation of extended attributes.
This resulted in leaking the copy buffer and file descriptors.
* NEWS (Bug fixes): Mention the fix.
The bug was introduced in coreutils-7.1 via commit 0889381c, 2009-01-23,
"cp/mv: add xattr support".
2009-09-03 10:00:32 +01:00
Jim Meyering
a977dbbe78 ls -i: print consistent inode numbers also for mount points
On most unix- and linux-based kernels, ls -i DIR_CONTAINING_MOUNT_POINT
would print the wrong inode number for any entry that is a mount point.
It would do that by relying on readdir's dirent.d_ino values, while
most readdir implementations return the inode number of the underlying,
inaccessible directory.  Thus, it is not consistent with what you'd
get when applying stat to the same entry.  This bug led to surprising
results like "ls -i" and "ls -i --color" printing different numbers (ls
must usually "stat" a file to colorize its name).  This change makes it
so that on offending systems, ls must stat non-command-line-arguments
for which otherwise it would be able to use "for free" dirent.d_ino
values.  Regardless of this change, ls is already required to stat every
command-line argument.  Note: versions of GNU ls prior to coreutils-6.0
did not perform the invalid optimization, and hence always printed
correct inode numbers.  Thus, for the sake of correctness, ls -i is
forgoing the readdir optimization, for any kernel (including linux!)
with POSIX-nonconforming readdir.  Note that currently, only Cygwin has
been agile enough to conform.

* src/ls.c (RELIABLE_D_INO): Define.
(print_dir): Use it.
For plenty of discussion, see this long thread:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14020
This bug was introduced by the 2006-02-26 commit, 33eb3efe:
"In ls, avoid calling stat for --inode (-i), when possible."
* tests/ls/readdir-mountpoint-inode: New test.
* tests/Makefile.am (TESTS): Add it.
* tests/ls/stat-vs-dirent: Don't suppress failure of this test,
now that ls -i is fixed.  Though note that it doesn't test well,
since it compares only the always-stat'd command-line arguments.
* NEWS (Bug fixes): Mention it.
2009-09-01 07:07:45 +02:00
Pádraig Brady
9e59f8c47c cp --reflink: preserve attributes on cloned files if asked
* src/copy.c (copy_reg): When cloning only skip the data copying
* tests/cp/reflink-perm: New test to check times and modes copied
* tests/Makefile.am: Reference the new test
* NEWS: Mention the fix
2009-08-29 01:37:05 +01:00
Pádraig Brady
72f98388c3 cp --reflink: add an "auto" parameter to fall back to a normal copy
* doc/coreutils.texi (cp invocation): Document the new
"auto" and "always" options to --reflink.
* src/copy.c (copy_reg): Fall back to a standard copy
when reflink() is not supported and --reflink=auto specified.
* src/copy.h [struct cp_options] (reflink): Change type s/bool/enum/.
* src/cp.c (usage): Describe the --reflink={always,auto} options
and expand a little on what --reflink does.
(main): parse the new parameters to --reflink and allow all
--sparse options with --reflink=auto.
* src/install.c (cp_option_init): Init the enum instead of bool.
* src/mv.c (cp_option_init): Likewise.
* tests/cp/reflink-auto: A new test for falling back to normal copy.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the new feature.
2009-08-29 00:24:49 +01:00
Eric Blake
31fa922e57 dd: detect closed stderr
* src/dd.c (maybe_close_stdout): Always flush stderr; regression
introduced in commit 381e69ea.
* tests/misc/close-stdout (p): Use consistent style.
* tests/dd/stderr: New test, borrowing from misc/close-stdout.
* tests/Makefile.am (TESTS): Run it.
* NEWS: Mention this.
2009-08-28 12:56:51 -06:00
Jim Meyering
2bc0f3caaa cp: ignore obscure failure to preserve symlink time stamps,
...when run on a kernel older than what was implied by headers and
libraries tested at configure time.
* src/copy.c (utimens_symlink): Ignore failure when errno == ENOSYS.
* NEWS (Bug fixes): Mention it.
Reported by Todd Zullinger and Kamil Dudka.
Details in this thread:
http://thread.gmane.org/gmane.linux.redhat.fedora.devel/119834
2009-08-24 12:44:13 +02:00
Jim Meyering
04a31ad99d post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-08-20 21:48:45 +02:00
Jim Meyering
af1996dde2 version 7.5
* NEWS: Record release date.
2009-08-20 21:19:36 +02:00
Giuseppe Scrivano
718b2790c0 nl: deprecate --page-increment in favor of --line-increment
* NEWS: Mention the change.
* doc/coreutils.texi: Document the new --line-increment option.
* src/nl.c (struct option): Add --line-increment,
(usage): Describe it,
(main): Use it.
2009-08-18 18:40:41 +02:00
Pádraig Brady
8574c74325 doc: clarify the cp --reflink NEWS
* NEWS: Remove the description associated with the removed
experimental code which unconditionally tried to reflink() on copy.
Also clarify where --reflink works exactly.
2009-08-14 10:48:07 +01:00
Pádraig Brady
e4caea5775 dd: fix a signal handling race
* src/dd.c (main): Install the signal handlers at startup
rather than just before the copy starts. In this way signals
received before the copy (like during a slow truncate for e.g.)
will be deferred and handled consistently.
* THANKS: Add Bernhard's email address.
* NEWS: Mention the fix.
Reported by Bernhard Voelker.
2009-08-13 16:06:50 +01:00
Giuseppe Scrivano
a1d7469835 cp: accept the --reflink option
* NEWS: Mention it.
* doc/coreutils.texi (cp invocation): Describe it.
* src/copy.h (struct cp_options) [reflink]: New member.
* src/copy.c (usage): Describe it.
(copy_reg): If reflink is true try to clone the file.
(main): Check for --reflink.
(cp_option_init): Initialize the new member.
* src/install.c (cp_option_init): Initialize the new member.
* src/mv.c (cp_option_init): Likewise.
* tests/cp/sparse: Add a new test case.
2009-08-07 17:14:22 +02:00
Jim Meyering
5929322ccb dd: work around buffer length restrictions with oflag=direct (O_DIRECT)
dd oflag=direct would fail to copy a file with size that is
not a multiple of 512 (destination file system specific)

* NEWS (Bug fixes): Mention it.
* src/dd.c (iwrite): Turn off O_DIRECT for any
smaller-than-obs-sized write.  Don't bother to restore it.
* tests/dd/direct: New test for the above.
* tests/Makefile.am (TESTS): Add dd/direct.
* doc/coreutils.texi (dd invocation): Mention oflag=direct
buffer size restriction.
Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17586
Reported by Eric Sandeen.
2009-08-06 09:41:50 +02:00
Jim Meyering
eae535e1a3 cp -pP (and e.g., -a): preserve time stamps on symlinks, too
* src/copy.c (utimensat_if_possible): New function.
(copy_internal): Remove variable, "preserve_metadata".
Replace with "dest_is_symlink".  That covers all cases but one:
the one in which cp --link has created hard links to non-directories.
In that case, there is no need to update attributes of the links.
Use utimensat_if_possible, to preserve timestamps of symlinks.
* NEWS (New features): Mention this.
* tests/Makefile.am (TESTS): Add cp/preserve-slink-time.
* tests/cp/preserve-slink-time: New file.
* m4/jm-macros.m4 (coreutils_MACROS): Test for utimensat.
Reported in http://bugzilla.redhat.com/230866
2009-08-04 17:38:54 +02:00
Kamil Dudka
1762092901 install runs faster again with SELinux enabled
* m4/jm-macros.m4: Pull in SELinux libraries while checking for
matchpathcon_init_prefix ().  Emit configure warning when not found
with SELinux enabled.
* NEWS (Bug fixes): Mention it.
The bug was introduced in coreutils-7.0 via commit 0647f3eb, 2008-06-02,
"accommodate older SELinux which lacks matchpathcon_init_prefix".
2009-08-04 16:51:52 +02:00
Jim Meyering
bc51349ccd maint: update NEWS
* NEWS (New features): Mention it.
2009-07-29 12:27:08 +02:00
Kamil Dudka
493c481684 ls -1U dir arg ... now works again
* src/ls.c (print_dir): Emit "$dir_name:\n" *before* accumulating (and
possibly printing) directory entry names.
The bug was introduced in coreutils-7.0 via commit
8d974b00, 2008-07-30, "ls -U1 now uses constant memory".
Reported by Julian Bradfield.
* NEWS (Bug fixes): Mention it.
2009-07-27 17:10:39 +02:00
Pádraig Brady
9c6c621c32 doc: clarify the tail inotify NEWS
* NEWS: Say why inotify was used
2009-06-25 14:50:05 +01:00
Pádraig Brady
a5a2a406f8 stdbuf: A new program to run a command with modified stdio buffering
* AUTHORS: Register as the author.
* NEWS: Mention this change.
* README: Add stdbuf command to list.
* configure.ac: Only enable on ELF systems with GCC.
* cfg.mk (sc_system_h_headers): Use VC_LIST_EXCEPT rather than
VC_LIST, so we can add an exception, if needed.
* .x-sc_system_h_headers: New file.  Exempt libstdbuf.c.
* Makefile.am (syntax_check_exceptions): Add .x-sc_system_h_headers.
* doc/coreutils.texi (stdbuf invocation): Add stdbuf info.
* man/.gitignore: Ignore generated manpage.
* src/.gitignore: Ignore stdbuf and libstdbuf.so binaries.
* man/Makefile.am (stdbuf.1): Add dependency.
* man/stdbuf.x: New file with example usage.
* po/POTFILES.in: Reference new command and shared library sources.
* src/Makefile.am (build_if_possible__progs): Add stdbuf and libstdbuf,
(pkglib_PROGRAMS): Reference optional shared lib,
(libstdbuf_so_LDADD): Ensure we don't link with non PIC libcoreutils.a.
(libstdbuf_so_LDFLAGS): Add -shared GCC option,
(libstdbuf_so_CFLAGS): Add -fPIC GCC option.
(check-README): Exclude libstbuf.
(check-AUTHORS): ditto.
(sc_tight_scope): Exclude functions starting with __.
* src/libstdbuf.c: The LD_PRELOAD shared library to control buffering.
* src/stdbuf.c: New file to setup env variables before execing command.
* tests/Makefile.am: Reference new test file.
* tests/misc/help-version: Set expected exit codes.
* tests/misc/invalid-opt: ditto.
* tests/misc/stdbuf: Add 9 tests.
2009-06-17 14:54:29 +01:00
Giuseppe Scrivano
ae494d4be8 tail: use inotify if it is available
* NEWS: Document the new feature.
* m4/jm-macros.m4: Check if inotify is present.
* src/tail.c (tail_forever_inotify): New function.
(main): Use the inotify-based function, if possible.
* tests/Makefile.am: Add new tests for tail.
* tests/test-lib.sh (require_proc_pid_status_, get_process_status_):
New functions.
* tests/tail-2/pid: New file.
* tests/tail-2/wait: New file.
* tests/tail-2/tail-n0f: Refactor code into the test-lib.sh
require_proc_pid_status_ function.
2009-06-15 18:34:14 +02:00
Cliff Miller
24c727d3c2 sort: Ignore fields where end position is before the start position
* NEWS: Mention the fix
* THANKS: Add Cliff Miller
* src/sort.c (keycompare): Ensure lima >= texta
* tests/misc/sort: Add 3 corresponding tests

Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-06-13 01:25:06 +01:00
Kamil Dudka
0df338f671 ls --color: do not colorize files with multiple hard links by default
* src/ls.c: Rename hl->mh, do not colorize files with multiple
hard links by default.
* src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh.
* src/dircolors.hin: Do not colorize files with multiple hard links by
default.
* tests/Makefile.am: Rename the test case accordingly.
* tests/ls/multihardlink: Additionally test ls' default behavior
and factor out some duplication.
* NEWS: Mention the change in behavior.
2009-06-11 09:53:50 +02:00
Michael Speer
159faba137 sort: new --human-numeric-sort option to sort KiB MB etc.
* NEWS: Document the new option
* doc/coreutils.texi (sort invocation): ditto
* src/sort.c (main): handle the new --human-numeric-sort option (-h).
(human_numcompare): A new function to compare SI and IEC suffixes
before falling back to the standard --numeric comparison.
(find_unit_order): A new helper function to find the order
of magnitude of a number string as determined by its suffix.
(check_mixed_SI_IEC): A new helper function to exit with error
if both SI and IEC suffixes are presented.
* tests/misc/sort: Add 8 tests to test the new functionality.
* THANKS: Update
2009-05-26 14:49:17 +01:00
Giuseppe Scrivano
c45c51fe97 chroot: accept new options --userspec=U:G and --groups=G1,G2,G3
* NEWS: Note chroot's new options.
* doc/coreutils.texi: Document them.
* src/chroot.c (main): Add support for --userspec and --groups.
* tests/Makefile.am (root-tests): Add chroot/credentials.
* tests/chroot/credentials: New file.
* tests/test-lib.sh: Define NON_ROOT_GROUP to a default value.
2009-05-26 15:10:22 +02:00
Eric Blake
60e7332dc0 truncate: fix bug in use of isspace
* src/truncate.c (main): Pass unsigned characters to isspace.
* NEWS: Mention this.
2009-05-11 05:52:50 -06:00
Jim Meyering
034cbb3923 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-05-07 15:52:50 +02:00
Jim Meyering
4e54ea0480 version 7.4
* NEWS (Build-related): Mention make check fixes.
2009-05-07 15:35:19 +02:00
Jim Meyering
5aa7858385 admin: update NEWS
* NEWS (Bug fixes): Mention the date-related fixes.
(Portability): Mention the ACL-related fixes on *BSD.
2009-05-07 15:20:56 +02:00
Jim Meyering
40d50b821f post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-05-01 18:19:19 +02:00
Jim Meyering
0ae4336f4f version 7.3
* NEWS: Record release date.
2009-05-01 18:03:50 +02:00
Pádraig Brady
0a28715b10 misc: correct NEWS entry about id -G portability
* NEWS (Portability): getgrouplist has the portability issues,
not getgroups.
2009-04-28 15:52:29 +01:00
Jim Meyering
c4dfd3138e misc: mention the df vs. automount change
* NEWS (Portability): Mention that df now accommodates the new
behavior of some automounters.
2009-04-28 14:32:26 +02:00
Jim Meyering
d76a1c2a2d misc: alphabetize NEWS entries 2009-04-28 14:32:26 +02:00
Ondřej Vašík
1fa226772c cp -a: diagnose failure when preserving xattr/context required
* src/copy.c (copy_attr_by_fs): Always print diagnostics when preserving
xattrs is required.
(copy_attr_by_name): Likewise.
(copy_reg): Always print diagnostics when preserving SELinux
context is required.
(copy_internal): Likewise.  Also, do not ignore ENOTSUP and ENODATA
errors when preserving SELinux context is required.
* NEWS (Bug fixes): Mention it.
2009-04-27 13:33:42 +02:00
Ondřej Vašík
941bd48235 mv: ignore xattr-preservation failure when not supported by filesystem
*src/copy.c: Do not warn about xattr-preservation failure when xattrs
are not supported and preservation of xattrs is not explicitly required.
Reported by Eric Sandeen in http://bugzilla.redhat.com/496142
2009-04-27 13:26:03 +02:00
Jim Meyering
25eb4c6909 sort -m: don't segfault when output file is also an input file
* src/sort.c (avoid_trashing_input): Fix an off-by-one error and
guard the use of memmove.
* NEWS (Bug fixes): Mention it.
* tests/misc/sort: Add tests to exercise the offending code.
* THANKS: Update.
Reported by Otavio Salvador in http://bugs.debian.org/525048.
2009-04-23 21:03:14 +02:00
Jim Meyering
c74fbaefeb cp: work around linux kernel bug: short-read != EOF on /proc
Remove the optimization that avoided up to 50% of cp's read syscalls.
Do not assume that a short read on a regular file indicates EOF.
When reading from a file in /proc on linux [at least 2.6.9 - 2.6.29]
into a 4k-byte buffer or larger, a short read does not
always indicate EOF.  For example, "cp /proc/slabinfo /tmp"
copies only 4068 of the total 7493 bytes.  This optimization
(25719a3315, Improve performance a bit
by optimizing away; 2005-11-24) appears to have been worth less than
a 2% speed-up (and usually much less), so the impact of removing it
is negligible.

* src/copy.c (copy_reg): Don't exit the loop early.
* tests/cp/proc-short-read: New test, lightly based on a suggestion
from Mike Frysinger, to exercise this fix.
* tests/Makefile.am (TESTS): Add cp/proc-short-read.
* NEWS (Improve robustness): Mention this change.
2009-04-22 21:52:11 +02:00
Jim Meyering
03490e3565 gnulib: update to latest: fix ls -v & sort -V
* NEWS (Bug fixes): Mention it.
2009-04-10 10:15:24 +02:00
Pádraig Brady
bf87a2c8ea id: fix infinite loop on some systems
Steven Parkes reported that `id -G $USER` went into an infinite loop
on Darwin systems for users in more than 10 groups:
http://bugs.gentoo.org/show_bug.cgi?id=264007
* gl/lib/mgetgroups.c (mgetgroups): Work around buggy getgrouplist
implementations that don't update the required size correctly,
by doubling the result buffer and retrying. Also return the
parameter updated by getgrouplist rather than its return value,
as the documentation doesn't actually state the number of groups
stored is returned by getgrouplist.
* tests/misc/id-groups: Add test to exercise this logic
* tests/Makefile.am: Reference new test
* NEWS: Mention the fix
* THANKS: Update
2009-04-09 14:07:29 +01:00
Pádraig Brady
af5723c71e shred,sort,shuf: don't use /dev/urandom by default
Suggestion from Steven Schveighoffer at:
http://savannah.gnu.org/patch/?6797
to greatly speed up the random passes done by shred.
* gl/lib/randread.c: Default to using the internal
pseudorandom generator, rather than reading /dev/urandom
* src/shred.c (usage): remove mention of /dev/urandom
* src/shuf.c (usage); ditto
* src/sort.c (usage): ditto
* doc/coreutils.text: Document the new behaviour
for aquiring random data.
2009-04-07 19:01:46 +01:00
Jim Meyering
e1e5963a9d doc: adjust 7.2 "cat,cp,install,mv,split speed-up" NEWS item
* NEWS: Reword an entry from 7.2 and change "linux" to "GNU/Linux".
The latter was requested by Richard Stallman.
* cfg.mk (old_NEWS_hash): Regenerate.
2009-04-03 21:53:50 +02:00
Pádraig Brady
612b647dd1 ls: fix alignment when month names have varying widths
Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR
locale has recently changed to use the official but variable width
abbreviated month names. Other glibc locales also have variable widths.
http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html
http://sourceware.org/bugzilla/show_bug.cgi?id=9859
* NEWS: Mention the fix
* gl/lib/mbsalign.c: A new module to align and truncate a
string in a specified number of screen cells, while handling
multi-byte characters appropriately.
* gl/lib/mbsalign.h: Ditto
* gl/modules/mbsalign: Ditto
* bootstrap.conf: Reference the new module
* src/ls.c (abmon_init): New function, precompute the abbreviated
months aligned left in a minimum width column <= 5 screen cells.
(align_nstrftime): New function, replace the first %b in the
format specification to strftime with the precomputed month string.
Note using the cached month strings speeds up `ls -lU` by around 17%
on glibc-2.7-2 on linux at least.  Also if we implement this function
using heap storage rather than automatic storage, and use snprintf
instead of strcpy, ls will slow down by 2% and 1% respectively
(i.e. a net gain of 14% rather than 17%).
* tests/ls/abmon-align: A new test to test ls alignment for
various formats and locales
* tests/Makefile.am: Reference the new test
2009-04-03 00:34:11 +01:00
Jim Meyering
278ae924be post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-03-31 14:48:50 +02:00
Jim Meyering
3dcf7a4d23 version 7.2
* NEWS: Record release date.
2009-03-31 14:11:57 +02:00
Eric Blake
9b4aa5e268 pwd: support -L and -P
* src/pwd.c (longopts): New variable.
(logical_getcwd): New function.
(main): Use it.
(usage): Document new options.
* doc/coreutils.texi (pwd invocation): Likewise.
* NEWS: Likewise.
* TODO (pwd): Mark it done.
* tests/misc/pwd-option: New file.
* tests/Makefile.am (TESTS): Add test.
* THANKS: Update.
Reported by Paul D. Smith, in savannah bug 24949.
2009-03-25 06:33:32 -06:00
Kamil Dudka
2827bb5704 ls: make it possible to disable coloring of hard links
* src/ls.c (print_color_indicator): Don't color hard links if disabled
(when there is an empty hl= in the LS_COLORS environment variable).
* tests/ls/hardlink: Add test case for disabled hard link highlighting.
* NEWS: Mention the change.
2009-03-24 16:11:00 +00:00
Ondřej Vašík
c160afe902 cp: make -a option preserve xattrs, but with reduced diagnostics
* copy.c (copy_attr_by_fd): Reduce xattr diagnostics for 'cp -a'.
(copy_attr_by_name): Likewise.
* cp.c (main): Preserve xattrs with -a option, when possible.
* doc/coreutils.texi: Document that xattrs are preserved with
cp -a, with no added diagnostics.
* NEWS: Mention the change.
* tests/misc/xattr: Add tests for 'cp --preserve=all' and 'cp -a'.
2009-03-11 17:32:44 +01:00
Pádraig Brady
1644e58905 cat: Fix immediate output of processed data
Introduced by commit 790892db, 2006-06-08 "Ensure that cat works ...".
* NEWS: Mention the bugfix.
* src/cat.c (cat): Fix the typo which stopped the writing
of processed data before a blocking read() is done.
* tests/misc/cat-buf: Add to ensure processed data is not buffered.
* tests/Makefile.am: Reference the new test.
2009-03-11 14:27:39 +00:00
Pádraig Brady
55efc5f3ee cat,cp,mv,install,split: Set the minimum IO block size used to 32KiB
This is following on from this change:
[02c3dc9d 2008-03-06 cat: use larger buffer sizes ...]
which increased the IO block size used by cat by 8 times,
but also capped it at 32KiB.
* NEWS: Mention the change in behavior.
* src/system.h: Add a new io_blksize() function that
returns the max of ST_BLKSIZE or 32KiB, as this was
seen as a good value for a minimum block size to use
to get good performance while minimizing system call overhead.
* src/cat.c: Use it.
* src/copy.c: ditto
* src/split.c: ditto
2009-03-11 14:19:08 +00:00
Jim Meyering
93f6771e82 tests: add a test for newly-fixed bug in comm --check-order
* tests/misc/comm (ooo-prefix): Add a test for today's fix.
* NEWS (Bug fixes): Mention it.
2009-03-08 21:34:08 +01:00
Jim Meyering
df2e983677 tests: ls -v: exercise the bug fixed by gnulib's new filevercmp
* tests/misc/ls-misc (version-sort): New test.
(mk_file): New function.
Reported by Josh Triplett in <http://bugs.debian.org/517558>.
Details in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16902
* NEWS (Bug fixes): Mention it.
2009-03-08 21:18:47 +01:00
Jim Meyering
a4053c5291 pr: fix a bug whereby --indent=N (-o) did not indent header lines
* src/pr.c (print_header): Honor chars_per_margin also for the header.
Inspired by a patch from C de-Avillez.
This change also adjusts two other %*s directives to be %*.*s instead,
(for the padding on either side of "file_text") to correct a bug that
could make pr print one space of padding instead of none.
* NEWS (Bug fixes): Mention it.
* tests/pr/o3Jml24f-lm-lo: Adjust for new expected output.
* tests/pr/o3a3Sl24f-tn: Likewise.
* tests/pr/o3a3Snl24f-tn: Likewise.
* tests/pr/o3a3l24f-tn: Likewise.
* tests/pr/o3b3Sl24f-tn: Likewise.
* tests/pr/o3b3Snl24f-tn: Likewise.
* tests/pr/o3b3l24f-tn: Likewise.
* tests/pr/o3mSl24f-bl-tn: Likewise.
* tests/pr/o3mSnl24fbltn: Likewise.
* tests/pr/o3ml24f-bl-tn: Likewise.
2009-03-07 23:52:08 +01:00
Jim Meyering
b50a4ae557 cp: diagnose invalid "cp -rl dir dir" right away, once again
Running "mkdir dir; cp -rl dir dir" would create dir/dir/dir/...
rather than diagnosing the "copy-into-self" failure.

The easy fix would have been to revert this part of the change
[3ece0355 2008-11-09 cp: use far less memory in some cases]
that introduced the bug:

-         remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);
+         if (!x->hard_link)
+           remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);

However, that would have induced the failure of the new cp/link-heap
test, due to the added memory pressure of recording 10k dev/ino pairs.
And besides, I liked that improvement and wanted to keep it.

Now that it's obvious recording the just-created-directory dev/ino
needn't depend on the setting of hard_link, I realized it is necessary
to record the pair only for the first directory created for each
source command-line argument.

I made that change, then noticed the new test, cp -rl a d d, would pass
when run once, yet output the into-self diagnostic twice.  Also note
the side effect: it creates d/a and d/d.  However, running that same
command a second time, now with the modified directory, would fail.

That turned out to be due to the fact that although the first into-self
failure was detected in copy_dir, that function would continue copying
other entries regardless -- and that would make it fail (eventually)
with the unwanted recursion.

* src/copy.c (copy_internal): This function needed an indicator of
whether, for a give command line argument, it had already created its
first directory.  If so, no more need to record dev/ino pairs.  If this
is the first, then do record its pair.  Hence, the new parameter.
(copy_dir, copy): Update callers.
(copy_dir): Upon any into-self failure, break out of the loop.
* tests/cp/into-self: Test for the above.
Reported by Mikael Magnusson.
2009-02-27 11:44:26 +01:00
Pádraig Brady
224a69b56b sort: Fix two bugs with determining the end of field
* src/sort.c: When no specific number of chars to skip
is specified for the end field, always skip the whole field.
Also never include leading spaces from next field.
* tests/misc/sort: Add 2 new tests for these cases.
* NEWS: Mention this bug fix.
* THANKS: Add bug reporter.
Reported by Davide Canova.
2009-02-26 14:40:28 +00:00
Jim Meyering
359c48d5c6 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-02-21 22:49:24 +01:00
Jim Meyering
74ba433a14 version 7.1
* NEWS: Record release date.
2009-02-21 22:35:33 +01:00
Ondřej Vašík
8c243ff965 cp: -a now preserves SELinux context, with reduced diagnostics
* copy.c (copy_reg): Reduce SELinux context diagnostics for 'cp -a'.
(copy_internal): Likewise
* copy.h (cp_options): Add boolean reduce_diagnostics.
* cp.c (usage): Say that --archive (-a) behaves like -dR --preserve=all.
(cp_option_init): Initialize added reduce_diagnostics.
(main): Add reduce_diagnostics for the -a option, and preserve SELinux
context, if possible.
* mv.c (cp_options_init): Initialize new cp_options booleans.
* install.c (cp_option_init): Likewise.
* NEWS: Mention those behaviour changes.
* doc/coreutils.texi: Document --preserve=context, document that
diagnostics are not shown for failures of non-mandatory attributes
(just SELinux at the moment).
* tests/cp/cp-a-selinux: Check not only failures, but succesful use
of preserving SELinux context in cp.
2009-02-18 15:27:10 +01:00
Eric Blake
86cef85b36 add missing copyright dates
* NEWS: Add 2009 to copyright.
* README: Likewise.
* README-hacking: Likewise.
* TODO: Likewise.
* doc/Makefile.am: Likewise.
* m4/prereq.m4: Likewise.
* src/nl.c: Likewise.
* src/seq.c: Likewise.
* tests/cp/cp-i: Likewise.
* tests/install/install-C: Likewise.
* tests/install/install-C-root: Likewise.
* tests/install/install-C-selinux: Likewise.
* tests/misc/seq: Likewise.
* tests/mv/mv-n: Likewise.
2009-02-18 06:07:30 -07:00
Kamil Dudka
dac5f12c6e install: add --compare (-C) option to install file only when necessary
* src/install.c (have_same_content): New function to compare files
content.
(extra_mode): New function checking for non-permission bits in mode.
(need_copy): New function to check if copy is necessary.
(main): Handle new option --compare (-C).
(copy_file): Skip file copying if not necessary.
(usage): Show new option --compare (-C) in --help.
* tests/install/install-C: Basic tests for install --compare (-C).
* tests/install/install-C-root: Tests requiring root privileges.
* tests/install/install-C-selinux: Tests requiring SELinux.
* tests/Makefile.am: Add new tests for install --compare (-C).
* doc/coreutils.texi: Document new install option --compare (-C).
* NEWS: Mention the change.
2009-02-17 14:12:44 +01:00
Pádraig Brady
5d0b158f4c seq: Fix equal width calculation when '.' added to last number
Issue reported by Samuel Hapák.
<http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00139.html>

* src/seq.c: Account for '.' added to "last" number.
* tests/misc/seq: Add corresponding test.
* NEWS: Mention the fix.
2009-02-14 23:47:14 +00:00
Kamil Dudka
0889381cbf cp/mv: add xattr support
This patch was originally written by Andreas Grünbacher, nowadays
available at
http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff

* bootstrap.conf: Add gnulib module verror.
* po/POTFILES.in: Add lib/verror.c.
* m4/xattr.m4: Check for libattr availability, new configure option
--disable-xattr.
* m4/prereq.m4: Require gl_FUNC_XATTR.
* src/Makefile.am: Link cp, mv and ginstall with libattr.
* src/copy.h: Add preserve_xattr and require_preserve_xattr to
cp_options.
* src/copy.c (copy_attr_error): New function to handle errors during
xattr copying.
(copy_attr_quote): New function to quote file name in error messages
printed by libattr.
(copy_attr_free): Empty function requested by libattr to free quoted
string.
(copy_attr_by_fd): New fd-oriented function to copy xattr.
(copy_attr_by_name): New name-oriented function to copy xattr.
(copy_reg, copy_internal): Call copy_extended_attributes function.
* src/cp.c (usage): Mention new --preserve=xattr option.
(decode_preserve_arg): Handle new --preserve=xattr option.
* src/mv.c: Always attempt to preserve xattr.
* src/install.c: Never attempt to preserve xattr.
* tests/misc/xattr: New test for xattr support in cp, mv and install.
* tests/Makefile.am: Add the new test to list.
* doc/coreutils.texi: Mention xattr support, new --preserve=xattr
option.
* NEWS: Mention the change.
2009-01-29 13:26:07 +01:00
Pádraig Brady
460ebb078e dd: Better handle user specified offsets that are too big
Following are the before and after operations for seekable files,
for the various erroneous offsets handled by this patch:

skip beyond end of file
  before: immediately exit(0);
  after : immediately printf("cannot skip to specified offset"); exit(0);

skip > max file size
  before: read whole file and exit(0);
  after : immediately printf("cannot skip: Invalid argument"); exit(1);
seek > max file size
  before: immediately printf("truncate error: EFBIG"); exit(1);
  after : immediately printf("truncate error: EFBIG"); exit(1);

skip > OFF_T_MAX
  before: read whole device/file and exit(0);
  after : immediately printf("cannot skip:"); exit(1);
seek > OFF_T_MAX
  before: immediately printf("truncate error: offset too large"); exit(1);
  after : immediately printf("truncate error: offset too large"); exit(1);

skip > device size
  before: read whole device and exit(0);
  after : immediately printf("cannot skip: Invalid argument"); exit(1);
seek > device size
  before: read whole device and printf("write error: ENOSPC"); exit(1);
  after : immediately printf("cannot seek: Invalid argument"); exit(1);

* NEWS: Summarize this change in behavior.
* src/dd.c (skip): Add error checking for large seek/skip offsets on
seekable files, rather than deferring to using read() to advance offset.
(dd_copy): Print a warning if skip past EOF, as per FIXME comment.
* test/Makefile.am: Add 2 new tests.
* tests/dd/seek-skip-past-file: Add tests for first 3 cases above.
* tests/dd/seek-skip-past-dev: Add root only test for last case above.
2009-01-28 15:14:57 +00:00
Pádraig Brady
10f3e12a0d doc: shred: Correct docs on default number of overwrites.
* NEWS: Mention the change to the default number of passes.
* doc/Makefile.am: Update constants.texi with the default
number of passes shred uses, so that the documentation
will automatically reflect any future changes.
* doc/coreutils.texi (shred invocation): Update the description
of the --iterations option to have the correct default number,
while still conveying that there are 25 internal patterns
that may be useful.
2009-01-22 23:42:51 +00:00
Kamil Dudka
d01338eb3d cp/mv: add --no-clobber (-n) option to not overwrite target
* src/cp.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* src/mv.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* doc/coreutils.texi: Document new cp/mv option -n.
* tests/cp/cp-i: Add tests for -f, -i and -n options.
* tests/mv/mv-n: New test for mv -n.
* tests/Makefile.am: Add test mv/mv-n to the list.
* NEWS: Mention the change.
2009-01-14 09:09:22 +01:00
Matt Harden
5c065bb0cb dd: add support for opening files in Concurrent I/O (CIO) mode
* src/dd.c (O_CIO): New flag.
* src/dd.c (O_FULLBLOCK): Add O_CIO to the list of flags that
O_FULLBLOCK should be greater than.
* src/dd.c (flags): Give the name "cio" to the new O_CIO flag, mirroring
the treatment of O_DIRECT.
* src/dd.c (usage): Add a description of the new flag when it is available.
* doc/coreutils.text (dd invocation): Describe the new flag.
* NEWS: Mention the new feature.
2008-12-26 10:57:05 +01:00
Jim Meyering
9965d234e5 du: -H now does what POSIX requires
* src/du.c (usage): Update --help output.
(main): Move -H-handling code from the --si block to
the one for --dereference-args (-D).
* doc/coreutils.texi (du invocation): Update description.
* NEWS (Changes in behavior): Mention this.
2008-12-16 08:04:01 +01:00
Jim Meyering
9b8023e69c tests: ensure that chmod, chgrp and chown honor --silent
* tests/chmod/silent: New file, to test all three programs.
* tests/Makefile.am (TESTS): Add chmod/silent.
* NEWS (Bug fixes): Mention this.
The bug was introduced in 96a5d2ce6a.
2008-12-03 11:02:57 +01:00
Jim Meyering
c2e56e0de7 wc: read and process --files0-from= input a name at a time,
when the file name list is not too large.  Before, wc would always read
the entire file name list into memory and *then* process each file name.
wc does read the list into memory when the list is known not to be too
large; this is done in order to be able to align the output numbers,
as it does with arguments specified on the command-line
* src/wc.c: Include "argv-iter.h".
(main): Rewrite to use argv-iter when the input file name list
is known to be too large.
* NEWS (Bug fixes): Mention it.
2008-12-02 13:12:22 +01:00
Jim Meyering
031e2fb5e9 du: read and process --files0-from= input a name at a time,
rather than by reading the entire input into memory and *then*
processing each file name.
* src/du.c: Include "argv-iter.h", not "readtokens0.h".
(main): Rewrite to use argv-iter.
Call xfts_open on each argument, rather than on the entire
argv list at once.
Call print_size here, not from du_files.
Diagnose read failure.
* NEWS (Bug fixes): Mention it.
* THANKS: update.
Reported by Barry Kelly.  More details in
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/15159/
2008-12-02 13:12:13 +01:00
Jim Meyering
7ef56a26fd cp, mv: remove 3-year-deprecated+warned-about --reply option
* src/cp.c (reply_args, reply_vals): Remove globals.
[REPLY_OPTION]: Remove enum.
(long_opts) ["reply"]: Remove initializer.
(main): Remove case stmt.
* src/mv.c: Likewise.
Don't include "argmatch.h".  No longer used.
* NEWS (Changes in behavior): Mention this.
* tests/Makefile.am (TESTS): Remove mv/reply-no.
* tests/mv/reply-no: Remove file.
* tests/mv/i-link-no: Update, now that --reply= is gone.
2008-12-01 17:03:37 +01:00