Compare commits

...

58 Commits

Author SHA1 Message Date
Jim Meyering
10688306fa Version 6.3.
* NEWS: Record the 6.3 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.

* NEWS: Mention Paul's Solaris 8 vs. 10 work-around.
2006-09-30 07:43:21 +00:00
Jim Meyering
af8862ae29 * src/c99-to-c89.diff: Update offsets. 2006-09-30 07:37:07 +00:00
Paul Eggert
37986655cf * .cvsignore: Add openat-proc.c. 2006-09-30 00:42:06 +00:00
Paul Eggert
f7ecea33e4 * tests/rm/readdir-bug: Don't use $(...) in a shell script,
as it doesn't work with Solaris /bin/sh.
2006-09-30 00:19:29 +00:00
Jim Meyering
e245139e46 * NEWS: Mention Paul's fix (to gnulib's canon-host.c) for
the pinky segfault.
2006-09-29 21:37:18 +00:00
Jim Meyering
2e328b0196 * tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that
use .1 as the increment.  Actual output varies too much.
[eq-wid-3]: New, commented out test.
2006-09-29 16:52:59 +00:00
Jim Meyering
a38becce97 * src/shuf.c (read_input): Fix an off-by-one error that
would cause an infloop for piped input of 8KB or more.
* NEWS: Mention the fix.
* tests/misc/shuf: Test for the above fix.
2006-09-29 16:52:48 +00:00
Jim Meyering
31c77a2fde [ChangeLog]
Since any system may be affected by the Darwin readdir bug,
perform the extra rewinddir unconditionally.  The performance
impact of rewinding a directory is negligible.
* src/remove.c (NEED_REWIND): Define to use
CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally.
[m4/ChangeLog]
* readdir.m4: Remove file once again.
* jm-macros.m4: Remove reference to gl_FUNC_READDIR.
2006-09-29 15:58:04 +00:00
Jim Meyering
af46184a80 * tests/seq/basic: Use .11 as the upper bound, in case the ".1"
increment translates to a slightly larger value.
This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe.
The final expected value wasn't being printed.
2006-09-29 11:30:48 +00:00
Jim Meyering
a4d470409f Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+
and NFS, whereby rm would not remove all files in a directory.
* src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10.
(NEED_REWIND): New macro, so that we incur the cost of the work-around
rewinddir only on afflicted systems.
* NEWS: Clarify and correct.
* tests/rm/readdir-bug: New file.  Test for the above fix.
* tests/rm/Makefile.am (TESTS): Add it.
Prompted by testing and analysis from Bruno Haible:
http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
2006-09-29 09:54:24 +00:00
Jim Meyering
344c446776 fix typo: s/dignostic/diagnostic/ 2006-09-28 23:08:20 +00:00
Paul Eggert
f2d5658c08 * tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too;
suggested for Debian stable, which uses Perl 5.8.4.
2006-09-28 22:07:42 +00:00
Jim Meyering
0bc935e209 * readdir.m4: Increment serial number. 2006-09-28 21:03:58 +00:00
Jim Meyering
b15b6fa192 * jm-macros.m4: Require the new macro.
* readdir.m4 (gl_FUNC_READDIR): Rename from GL_FUNC_READDIR.
2006-09-28 21:03:15 +00:00
Jim Meyering
665b228730 * readdir.m4: Revivify this file.
We need it to work around a bug on Darwin 0.7.x.
2006-09-28 21:00:30 +00:00
Jim Meyering
d37c3b8c6d Automatically generated dependencies are important even
when all of the sources in a directory come from gnulib.
* bootstrap (gnulib_tool): Remove the "no-dependencies" automake
option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2006-09-28 18:33:19 +00:00
Jim Meyering
ec3554cd95 * tests/rm/fail-eperm: Enable Perl's (-T) taint checking.
Ensure that IFS is set properly and unset PATH.
Sanitize inputs.
Work properly even when the name of the selected file starts with "-".
Invoke rm via "../../src/rm", and adjust expected output.
Prompted by a patch from Tim Waugh.
2006-09-28 13:31:57 +00:00
Jim Meyering
c2de7816d8 * README-cvs: Add Bison to the list of required packages. 2006-09-28 07:10:53 +00:00
Jim Meyering
0747af4b18 * src/c99-to-c89.diff: Update offsets. 2006-09-26 22:57:51 +00:00
Jim Meyering
a86a56f7d1 * NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept
it from removing a directory containing 188 or more entries.
* src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by
20, go work around the buggy readdir on Darwin 8.6.1 with NFS.
Reported by Matthew Woehlke.
2006-09-26 20:42:43 +00:00
Paul Eggert
b7c315cdda [ChangeLog]
* NEWS: "groups user" no longer outputs "user :"; you need at least
two users.  "groups" now processes options like --help more compatibly.
* src/groups.sh: Implement the option-processing change.
Handle user and group names with special characters more robustly.
Report write errors instead of exiting silently with status 1.
[doc/ChangeLog]
* coreutils.texi (groups invocation): "groups" no longer prefixes
the output with "user :" unless more than one user is specified.
2006-09-26 19:11:25 +00:00
Jim Meyering
412a3ca0b0 * README: Warn not to run autoreconf manually. Use bootstrap instead. 2006-09-26 13:03:03 +00:00
Jim Meyering
bbab62fd27 * src/groups.sh: When invoked with 0 or 1 argument, just exec "id".
Rewrite to avoid using temporary, $status.
2006-09-26 09:46:35 +00:00
Jim Meyering
5f65d05616 * NEWS: Mention the bug fix.
* src/groups.sh: Don't hide a write failure.
Reported by Iain Calder <ic56@rogers.com>.
2006-09-26 09:28:17 +00:00
Jim Meyering
509febe18b *** empty log message *** 2006-09-26 09:18:20 +00:00
Paul Eggert
3d524d9ab2 * .cvsignore: Add fchmodat.c. 2006-09-26 05:21:55 +00:00
Jim Meyering
1cd04b34dd * fchmodat.c: Remove file. gnulib's copy is identical. 2006-09-25 16:58:53 +00:00
Jim Meyering
d3c6206631 * src/chown.c (usage): Clarify --dereference description.
* src/chgrp.c (usage): Likewise.  Suggestion from Jamie McClelland.
2006-09-25 06:28:34 +00:00
Jim Meyering
f951057414 *** empty log message *** 2006-09-25 06:22:35 +00:00
Jim Meyering
e05de760c2 * NEWS: Mention these fixes.
* src/copy.c (copy_reg): With --verbose (-v), print
"removed `file_name'" just after unlinking a file.
(copy_internal): Likewise, in three more places.
Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.
2006-09-24 19:28:25 +00:00
Jim Meyering
de88ea4c5d . 2006-09-24 19:27:02 +00:00
Jim Meyering
af5967eae2 * tests/mv/hard-verbose: New file. Test for the above fix.
* tests/mv/Makefile.am (TESTS): Add hard-verbose.
2006-09-24 16:55:13 +00:00
Jim Meyering
6649f01059 * tests/help-version (sync_args): Don't call sync, since it spins up
disks that I've deliberately caused to spin down (but not unmounted).
2006-09-24 16:46:41 +00:00
Jim Meyering
200aa48e15 * NEWS: Mention the improvement to sort. 2006-09-24 11:44:16 +00:00
Jim Meyering
867251d725 * tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable
as well as existing.
2006-09-24 07:29:44 +00:00
Jim Meyering
b4963a7f70 * tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older,
since that predated addition of d_type support.
2006-09-24 07:27:00 +00:00
Jim Meyering
453c215003 * Makefile.am (EXTRA_DIST): Sort file names.
Add bootstrap and gl/modules/getloadavg.diff
2006-09-23 17:00:29 +00:00
Jim Meyering
328efced8b remove trailing blanks 2006-09-23 17:00:08 +00:00
Jim Meyering
7c8dece8c6 * gl/modules/getloadavg.diff: New file. Work around the way the latest
version of the getloadavg module interacts with our bootstrap script.
* bootstrap (gnulib_tool_options): Add "--local-dir gl".
2006-09-23 16:51:53 +00:00
Paul Eggert
5ffeefb1ab * bootstrap: Add support for --force.
(usage): New function.  Describe usage less tersely.
(CVS_only_file): New var.
2006-09-20 21:28:26 +00:00
Paul Eggert
2a01141018 * NEWS: Document fix for cp -i and mv -i.
* src/copy.c (copy_internal): With -i, prompt even if the source
is a directory and the destination is not.  This is required by
POSIX and gives the user a chance to bail out before failing.
* tests/cp/Makefile.am (TESTS): Add cp-i.
* tests/cp/cp-i: New file.
* tests/mv/Makefile.am (TESTS): Add i-5.
* tests/mv/i-5: New file.
2006-09-20 17:32:14 +00:00
Jim Meyering
fae30e1af9 * NEWS: Mention the chmod bug fix. 2006-09-20 13:30:55 +00:00
Jim Meyering
2c83d42320 *** empty log message *** 2006-09-20 12:41:20 +00:00
Jim Meyering
396a52f790 * tests/chmod/inaccessible: New test.
* tests/chmod/Makefile.am (TESTS): Add inaccessible.
2006-09-20 12:38:22 +00:00
Jim Meyering
05ce3b2986 Fix the 2006-09-18 bug differently.
* src/chmod.c: (process_file): Upon FTS_NS for a top-level file,
tell fts_read to stat the file again, in case it has become
accessible since the initial fts_open call.
* src/chown-core.c (change_file_owner): Likewise.
2006-09-20 11:50:46 +00:00
Jim Meyering
1671b056a5 * src/chmod.c: Revert last change. There is a better way.
* src/chown-core.c: Likewise.
2006-09-20 11:26:18 +00:00
Paul Eggert
856443a97d * coreutils.texi (Disk usage): Clarify intro. Problem reported by Van Ly. 2006-09-19 22:39:38 +00:00
Paul Eggert
7889cfbbc7 * src/ln.c (target_directory_operand): Rewrite to avoid porting
problem on Tandem reported by Matthew Woehlke in
<https://savannah.gnu.org/bugs/?17172>.
2006-09-19 22:11:38 +00:00
Paul Eggert
90616d3a8f (cp invocation): Clarify cp -i a bit more. 2006-09-19 21:54:01 +00:00
Paul Eggert
f544d8dd1a * coreutils.texi (cp invocation): Say that -i and -f are
independent.  Clarify -i's behavior.
2006-09-19 16:49:06 +00:00
Paul Eggert
0e3b87195a Fix bug where chmod, chown, and chgrp did not process operands
left-to-right in some cases.
* src/chmod.c (wd_errno): New var.
(chmod_file): New function, with most of the contents of the
old prcess_file function.
(process_files): Use it.  This gives file names to fts one
at a time, so that they are processed left-to-right as POSIX
requires.
* src/chown-core.c (wd_errno, chown_files): Likewise.
(chown_file): New function.
* tests/install/basic-1: Redo test so as to not workaround
the chmod bug, thereby testing for it.
2006-09-18 22:09:49 +00:00
Paul Eggert
bebf83d0fd * src/shuf.c (main): Quote the entire range when reporting an
invalid one, rather than just the part that contained the error.
2006-09-18 20:38:54 +00:00
Paul Eggert
46dd4b1a8e * tests/stty/row-col-1: Rewrite to avoid temporary file that is
sometimes left behind if the test is skipped or interrupted.
2006-09-18 20:34:50 +00:00
Paul Eggert
058f319e6d * bootstrap (symlink_to_gnulib): New function.
(cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
to copies-of-gnulib.
(cp_mark_as_generated, slurp, gnulib_files):
Avoid making a copy if it's the same as the old version.
(gnulib_files): Add support for this variable (used by Bison).
2006-09-18 20:20:03 +00:00
Paul Eggert
87353aebd8 * tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic
indicating flaw in kernel.  Reword to say that the flaw isn't
serious for coreutils, since the flaw does affect ls -i.
2006-09-18 16:34:27 +00:00
Paul Eggert
5a73ad8c63 Fix bug in test case exposed by building on
Solaris 8 in a setgid directory.  The test case incorrectly
assumed that 'symlink' would be in group $g1.
2006-09-18 16:11:00 +00:00
Jim Meyering
c9c0dc7bc6 * NEWS: Add a line for 6.3-cvs.
* configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix.
2006-09-18 13:01:09 +00:00
Jim Meyering
9c57927ad1 . 2006-09-18 08:09:54 +00:00
45 changed files with 958 additions and 247 deletions

View File

@@ -1 +1 @@
6.1
6.2

212
ChangeLog
View File

@@ -1,5 +1,217 @@
2006-09-30 Jim Meyering <jim@meyering.net>
Version 6.3.
* NEWS: Record the 6.3 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
* NEWS: Mention Paul's Solaris 8 vs. 10 work-around.
* src/c99-to-c89.diff: Update offsets.
2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
* tests/rm/readdir-bug: Don't use $(...) in a shell script,
as it doesn't work with Solaris /bin/sh.
2006-09-29 Jim Meyering <jim@meyering.net>
* NEWS: Mention Paul's fix (to gnulib's canon-host.c) for
the pinky segfault.
* tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that
use .1 as the increment. Actual output varies too much.
[eq-wid-3]: New, commented out test.
* src/shuf.c (read_input): Fix an off-by-one error that
would cause an infloop for piped input of 8KB or more.
* NEWS: Mention the fix.
* tests/misc/shuf: Test for the above fix.
Since any system may be affected by the Darwin readdir bug,
perform the extra rewinddir unconditionally. The performance
impact of rewinding a directory is negligible.
* src/remove.c (NEED_REWIND): Define to use
CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally.
* tests/seq/basic: Use .11 as the upper bound, in case the ".1"
increment translates to a slightly larger value.
This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe.
The final expected value wasn't being printed.
Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+
and NFS, whereby rm would not remove all files in a directory.
* src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10.
(NEED_REWIND): New macro, so that we incur the cost of the work-around
rewinddir only on afflicted systems.
* NEWS: Clarify and correct.
* tests/rm/readdir-bug: New file. Test for the above fix.
* tests/rm/Makefile.am (TESTS): Add it.
Prompted by testing and analysis from Bruno Haible:
http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
2006-09-28 Paul Eggert <eggert@cs.ucla.edu>
* tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too;
suggested for Debian stable, which uses Perl 5.8.4.
2006-09-28 Jim Meyering <jim@meyering.net>
Automatically generated dependencies are important even
when all of the sources in a directory come from gnulib.
* bootstrap (gnulib_tool): Remove the "no-dependencies" automake
option that gnulib-tool adds to what becomes our lib/gnulib.mk.
* tests/rm/fail-eperm: Enable Perl's (-T) taint checking.
Ensure that IFS is set properly and unset PATH.
Sanitize inputs.
Work properly even when the name of the selected file starts with "-".
Invoke rm via "../../src/rm", and adjust expected output.
Prompted by a patch from Tim Waugh.
* README-cvs: Add Bison to the list of required packages.
2006-09-26 Jim Meyering <jim@meyering.net>
* src/c99-to-c89.diff: Update offsets.
* NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept
it from removing a directory containing 188 or more entries.
* src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by
20, go work around the buggy readdir on Darwin 8.6.1 with NFS.
Reported by Matthew Woehlke.
2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: "groups user" no longer outputs "user :"; you need at least
two users. "groups" now processes options like --help more compatibly.
* src/groups.sh: Implement the option-processing change.
Handle user and group names with special characters more robustly.
Report write errors instead of exiting silently with status 1.
2006-09-26 Jim Meyering <jim@meyering.net>
* README: Warn not to run autoreconf manually. Use bootstrap instead.
* src/groups.sh: When invoked with 0 or 1 argument, just exec "id".
Rewrite to avoid using temporary, $status.
* NEWS: Mention the bug fix.
* src/groups.sh: Don't hide a write failure.
Reported by Iain Calder <ic56@rogers.com>.
2006-09-25 Jim Meyering <jim@meyering.net>
* src/chown.c (usage): Clarify --dereference description.
* src/chgrp.c (usage): Likewise. Suggestion from Jamie McClelland.
2006-09-24 Jim Meyering <jim@meyering.net>
* NEWS: Mention these fixes.
* src/copy.c (copy_reg): With --verbose (-v), print
"removed `file_name'" just after unlinking a file.
(copy_internal): Likewise, in three more places.
Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.
* tests/mv/hard-verbose: New file. Test for the above fix.
* tests/mv/Makefile.am (TESTS): Add hard-verbose.
* tests/help-version (sync_args): Don't call sync, since it spins up
disks that I've deliberately caused to spin down (but not unmounted).
* NEWS: Mention the improvement to sort.
* tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable
as well as existing.
* tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older,
since that predated addition of d_type support.
2006-09-23 Jim Meyering <jim@meyering.net>
* gl/modules/getloadavg.diff: New file. Work around the way the latest
version of the getloadavg module interacts with our bootstrap script.
* bootstrap (gnulib_tool_options): Add "--local-dir gl".
* Makefile.am (EXTRA_DIST): Sort file names.
Add bootstrap and gl/modules/getloadavg.diff
2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
* bootstrap: Add support for --force.
(usage): New function. Describe usage less tersely.
(CVS_only_file): New var.
* NEWS: Document fix for cp -i and mv -i.
* src/copy.c (copy_internal): With -i, prompt even if the source
is a directory and the destination is not. This is required by
POSIX and gives the user a chance to bail out before failing.
* tests/cp/Makefile.am (TESTS): Add cp-i.
* tests/cp/cp-i: New file.
* tests/mv/Makefile.am (TESTS): Add i-5.
* tests/mv/i-5: New file.
2006-09-20 Jim Meyering <jim@meyering.net>
* NEWS: Mention the chmod bug fix.
* tests/chmod/inaccessible: New test, specifically for this bug.
Based on a test case from Paul Eggert.
* tests/chmod/Makefile.am (TESTS): Add inaccessible.
Fix the 2006-09-18 bug differently.
* src/chmod.c: (process_file): Upon FTS_NS for a top-level file,
tell fts_read to stat the file again, in case it has become
accessible since the initial fts_open call.
* src/chown-core.c (change_file_owner): Likewise.
* src/chmod.c: Revert last change. There is a better way.
* src/chown-core.c: Likewise.
2006-09-19 Paul Eggert <eggert@cs.ucla.edu>
* src/ln.c (target_directory_operand): Rewrite to avoid porting
problem on Tandem reported by Matthew Woehlke in
<https://savannah.gnu.org/bugs/?17172>.
2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
Fix bug where chmod, chown, and chgrp did not process operands
left-to-right in some cases.
* src/chmod.c (wd_errno): New var.
(chmod_file): New function, with most of the contents of the
old prcess_file function.
(process_files): Use it. This gives file names to fts one
at a time, so that they are processed left-to-right as POSIX
requires.
* src/chown-core.c (wd_errno, chown_files): Likewise.
(chown_file): New function.
* tests/install/basic-1: Redo test so as to not workaround
the chmod bug, thereby testing for it.
* src/shuf.c (main): Quote the entire range when reporting an
invalid one, rather than just the part that contained the error.
* tests/stty/row-col-1: Rewrite to avoid temporary file that is
sometimes left behind if the test is skipped or interrupted.
* bootstrap (symlink_to_gnulib): New function.
(cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
to copies-of-gnulib.
(cp_mark_as_generated, slurp, gnulib_files):
Avoid making a copy if it's the same as the old version.
(gnulib_files): Add support for this variable (used by Bison).
* tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic
indicating flaw in kernel. Reword to say that the flaw isn't
serious for coreutils, since the flaw does affect ls -i.
* tests/chgrp/basic: Fix bug in test case exposed by building on
Solaris 8 in a setgid directory. The test case incorrectly
assumed that 'symlink' would be in group $g1.
2006-09-18 Jim Meyering <jim@meyering.net>
* NEWS: Add a line for 6.3-cvs.
* configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix.
Version 6.2.
* NEWS: Record the 6.2 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.

View File

@@ -20,30 +20,32 @@
SUBDIRS = lib src doc man po tests
EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
.hgignore \
.gitignore \
.hgignore \
.kludge-stamp .prev-version THANKS-to-translators THANKStt.in \
.vg-suppressions \
.x-po-check \
.x-sc_space_tab .x-sc_sun_os_names \
.x-sc_file_system .x-sc_obsolete_symbols \
.x-sc_prohibit_atoi_atof \
.x-sc_require_config_h \
.x-sc_space_tab .x-sc_sun_os_names \
.x-sc_trailing_blank \
.x-sc_unmarked_diagnostics \
.x-sc_useless_cpp_parens \
.x-sc_require_config_h \
.x-sc_prohibit_atoi_atof \
.x-sc_trailing_blank \
ChangeLog-2005 \
announce-gen \
bootstrap \
build-aux/cvsu \
build-aux/vc-list-files \
gl/modules/getloadavg.diff \
m4/ChangeLog \
ChangeLog-2005 \
old/fileutils/ChangeLog \
old/fileutils/ChangeLog-1997 \
old/fileutils/NEWS \
old/sh-utils/ChangeLog \
old/sh-utils/ChangeLog.0 \
old/textutils/ChangeLog \
old/fileutils/NEWS \
old/sh-utils/NEWS \
old/textutils/ChangeLog \
old/textutils/NEWS
install-root:

46
NEWS
View File

@@ -1,5 +1,51 @@
GNU coreutils NEWS -*- outline -*-
* Major changes in release 6.3 (2006-09-30) [stable]
** Improved robustness
pinky no longer segfaults on Darwin 7.9.0 (MacOS X 10.3.9) due to a
buggy native getaddrinfo function.
rm works around a bug in Darwin 7.9.0 (MacOS X 10.3.9) that would
sometimes keep it from removing all entries in a directory on an HFS+
or NFS-mounted partition.
sort would fail to handle very large input (around 40GB) on systems with a
mkstemp function that returns a file descriptor limited to 32-bit offsets.
** Bug fixes
chmod would fail unnecessarily in an unusual case: when an initially-
inaccessible argument is rendered accessible by chmod's action on a
preceding command line argument. This bug also affects chgrp, but
it is harder to demonstrate. It does not affect chown. The bug was
introduced with the switch from explicit recursion to the use of fts
in coreutils-5.1.0 (2003-10-15).
cp -i and mv -i occasionally neglected to prompt when the copy or move
action was bound to fail. This bug dates back to before fileutils-4.0.
With --verbose (-v), cp and mv would sometimes generate no output,
or neglect to report file removal.
For the "groups" command:
"groups" no longer prefixes the output with "user :" unless more
than one user is specified; this is for compatibility with BSD.
"groups user" now exits nonzero when it gets a write error.
"groups" now processes options like --help more compatibly.
shuf would infloop, given 8KB or more of piped input
** Portability
Versions of chmod, chown, chgrp, du, and rm (tools that use openat etc.)
compiled for Solaris 8 now also work when run on Solaris 10.
* Major changes in release 6.2 (2006-09-18) [stable candidate]
** Changes in behavior

6
README
View File

@@ -167,6 +167,12 @@ as you can. Based on the feedback that generates, you may be able to
convince us that it's worth adding.
WARNING: Now that we use the ./bootstrap script, you should not run
autoreconf manually. Doing that will overwrite essential source files
with older versions, which may make the package unbuildable or introduce
subtle bugs.
WARNING: If you modify files like configure.in, m4/*.m4, aclocal.m4,
or any Makefile.am, then don't be surprised if what gets regenerated no
longer works. To make things work, you'll have to be using appropriate

View File

@@ -11,6 +11,7 @@ stable versions of the maintainer tools we depend upon, including:
- Automake <http://www.gnu.org/software/automake/>
- Autoconf <http://www.gnu.org/software/autoconf/>
- Bison <http://www.gnu.org/software/bison/>
- Gettext <http://www.gnu.org/software/gettext/>
- Gzip <http://www.gnu.org/software/gzip/>
- Tar <http://www.gnu.org/software/tar/>

3
THANKS
View File

@@ -198,6 +198,7 @@ Holger Berger hberger@ess.nec.de
Hon-Yin Kok hkok@yoda.unl.edu
Hugh Daniel hugh@xanadu.com
Ian Bruce ian.bruce@myrealbox.com
Iain Calder ic56@rogers.com
Ian Jackson ijackson@chiark.greenend.org.uk
Ian Lance Taylor ian@cygnus.com
Ian Turner vectro@pipeline.com
@@ -211,6 +212,7 @@ James Sneeringer jvs@ocslink.com
James Tanis jtt@soscorp.com
James Youngman james+usenet@free-lunch.demon.co.uk
Jamie Lokier jamie@imbolc.ucc.ie
Jamie McClelland jm@mayfirst.org
Jan Fedak J.Fedak@sh.cvut.cz
Jan Nieuwenhuizen janneke@gnu.org
Janos Farkas chexum@shadow.banki.hu
@@ -287,6 +289,7 @@ Manas Garg manas@cygsoft.com
Manfred Hollstein manfred@s-direktnet.de
Marc Boucher marc@mbsi.ca
Marc Haber mh+debian-bugs@zugschlus.de
Marc Lehman schmorp@schmorp.de
Marc Olzheim marcolz@stack.nl
Marco Franzen Marco.Franzen@Thyron.com
Marcus Brinkmann http://www.marcus-brinkmann.de

145
bootstrap
View File

@@ -29,13 +29,35 @@ nl='
LC_ALL=C
export LC_ALL
usage() {
echo >&2 "\
Usage: $0 [OPTION]...
Bootstrap this package from the CVS sources.
Options:
--gnulib-srcdir=DIRNAME Specify the local directory where gnulib
sources reside. Use this if you already
have gnulib sources on your machine, and
do not want to waste your bandwidth dowloading
them again.
--force Bootstrap even if the sources didn't come from CVS.
--skip-po Do not download po files.
--cvs-user=USERNAME Set the CVS username to be used when accessing
the gnulib repository.
If the file .bootstrap.conf exists in the current working directory, its
contents are read as shell variables to configure the bootstrap.
Running without arguments will suffice in most cases.
"
}
# Configuration.
# List of gnulib modules needed.
gnulib_modules=
# Any extra gnulib files needed.
# Any gnulib files needed that are not in modules.
gnulib_files=
# Translation Project URL, for the registry of all projects
@@ -61,7 +83,7 @@ extract_package_name='
'
package=`sed -n "$extract_package_name" configure.ac` || exit
# Extra files from gnulib, which are not part of any module yet.
# Extra files from gnulib, which override files from other sources.
gnulib_extra_files='
build-aux/install-sh
build-aux/missing
@@ -86,6 +108,10 @@ XGETTEXT_OPTIONS='\\\
# Files we don't want to import.
excluded_files=
# File that should exist with CVS checkout, but not with
# the distributed version.
CVS_only_file=CVS
# Override the default configuration, if necessary.
test -r bootstrap.conf && . ./bootstrap.conf
@@ -97,7 +123,7 @@ for option
do
case $option in
--help)
echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
usage
exit;;
--gnulib-srcdir=*)
GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
@@ -105,12 +131,19 @@ do
CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;;
--skip-po)
SKIP_PO=t;;
--force)
CVS_only_file=;;
*)
echo >&2 "$0: $option: unknown option"
exit 1;;
esac
done
if test -n "$CVS_only_file" && test ! -r "$CVS_only_file"; then
echo "$0: Bootstrapping from a non-CVS distribution is a bit risky." >&2
exit 1
fi
echo "$0: Bootstrapping CVS $package..."
cleanup_gnulib() {
@@ -212,27 +245,73 @@ case $SKIP_PO in
fi;;
esac
symlink_to_gnulib()
{
src=$GNULIB_SRCDIR/$1
dst=${2-$1}
dot_dots=
case $src in
/*) ;;
*)
case /$dst/ in
*//* | */../* | */./* | /*/*/*/*/*/)
echo >&2 "$0: invalid symlink calculation: $src -> $dst"
exit 1;;
/*/*/*/*/) dot_dots=../../../;;
/*/*/*/) dot_dots=../../;;
/*/*/) dot_dots=../;;
esac;;
esac
test -f "$src" && {
test -h "$dst" &&
src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
test "$src_i" = "$dst_i" || {
echo "$0: ln -fs $dot_dots$src $dst" &&
ln -fs "$dot_dots$src" "$dst"
}
}
}
cp_mark_as_generated()
{
cp_src=$1
cp_dst=$2
case $cp_dst in
*.[ch]) c1='/* '; c2=' */';;
*.texi) c1='@c '; c2= ;;
*.m4|*/Make*|Make*) c1='# ' ; c2= ;;
*) c1= ; c2= ;;
esac
if test -z "$c1"; then
cp "$cp_src" "$cp_dst"
return
if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then
symlink_to_gnulib "$cp_dst"
else
case $cp_dst in
*.[ch]) c1='/* '; c2=' */';;
*.texi) c1='@c '; c2= ;;
*.m4|*/Make*|Make*) c1='# ' ; c2= ;;
*) c1= ; c2= ;;
esac
if test -z "$c1"; then
cmp -s "$cp_src" "$cp_dst" || {
echo "$0: cp -f $cp_src $cp_dst" &&
cp -f "$cp_src" "$cp_dst"
}
else
# Copy the file first to get proper permissions if it
# doesn't already exist. Then overwrite the copy.
cp "$cp_src" "$cp_dst-t" &&
(
echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" &&
echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" &&
cat "$cp_src"
) > $cp_dst-t &&
if cmp -s "$cp_dst-t" "$cp_dst"; then
rm -f "$cp_dst-t"
else
echo "$0: cp $cp_src $cp_dst # with edits" &&
mv -f "$cp_dst-t" "$cp_dst"
fi
fi
fi
(
echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2"
echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2"
cat "$cp_src"
) >> "$cp_dst"
}
slurp() {
@@ -245,11 +324,17 @@ slurp() {
test "$dir/$file" = "$excluded_file" && continue 2
done
if test $file = Makefile.am; then
copied=$copied${sep}gnulib.mk; sep=$nl
echo "$0: Copying $1/$dir/$file to $dir/gnulib.mk ..." &&
rm -f $dir/gnulib.mk
sed '/^[^#].*\/intl/s/^/#/' $1/$dir/$file >$dir/gnulib.mk
elif test -r ${2-no/such/dir}/$dir/$file ||
copied=$copied${sep}gnulib.mk; sep=$nl
remove_intl='/^[^#].*\/intl/s/^/#/'
no_dep=no-dependencies
remove_no_dep="/^AUTOMAKE_OPTIONS =.* $no_dep/s/ $no_dep//"
sed_xform="$remove_intl;$remove_no_dep"
sed "$sed_xform" $1/$dir/$file | cmp -s - $dir/gnulib.mk || {
echo "$0: Copying $1/$dir/$file to $dir/gnulib.mk ..." &&
rm -f $dir/gnulib.mk &&
sed "$sed_xform" $1/$dir/$file >$dir/gnulib.mk
}
elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
grep -q '^/[^/]*/[0-9]'; then
echo "$0: $dir/$file overrides $1/$dir/$file"
@@ -267,7 +352,6 @@ slurp() {
AC_DEFUN([gl_LOCK_EARLY], [])
' $1/$dir/$file >$dir/$file
else
rm -f $dir/$file
cp_mark_as_generated $1/$dir/$file $dir/$file
fi
fi || exit
@@ -300,11 +384,16 @@ gnulib_tool_options="\
--m4-base $bt/m4/\
--source-base $bt/lib/\
--tests-base $bt/tests\
--local-dir gl\
"
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
slurp $bt || exit
for file in $gnulib_files; do
symlink_to_gnulib $file || exit
done
# Import from gettext.
@@ -332,13 +421,11 @@ done
# Get some extra files from gnulib, overriding existing files.
for file in $gnulib_extra_files; do
src=$GNULIB_SRCDIR/$file
case $file in
*/INSTALL) dest=.;;
*) dest=$file;;
*/INSTALL) dst=INSTALL;;
*) dst=$file;;
esac
echo "$0: cp -fp $src $dest" &&
cp -fp $src $dest || exit
symlink_to_gnulib $file $dst || exit
done

View File

@@ -20,7 +20,7 @@
dnl Written by Jim Meyering.
AC_PREREQ(2.60)
AC_INIT([GNU coreutils],[6.2],[bug-coreutils@gnu.org])
AC_INIT([GNU coreutils],[6.3],[bug-coreutils@gnu.org])
AC_CONFIG_SRCDIR(src/ls.c)
AC_CONFIG_AUX_DIR(build-aux)

View File

@@ -1,3 +1,14 @@
2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (groups invocation): "groups" no longer prefixes
the output with "user :" unless more than one user is specified.
2006-09-19 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (cp invocation): Say that -i and -f are
independent. Clarify -i's behavior.
(Disk usage): Clarify intro. Problem reported by Van Ly.
2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (tail invocation): Ignore -f when standard input

View File

@@ -6890,6 +6890,9 @@ tries to open it again. Contrast this behavior with that enabled by
is never opened but rather is unlinked unconditionally. Also see the
description of @option{--remove-destination}.
This option is independent of the @option{--interactive} or
@option{-i} option: neither cancels the effect of the other.
@item -H
@opindex -H
If a command line argument specifies a symbolic link, then copy the
@@ -6901,7 +6904,8 @@ via recursive traversal.
@itemx --interactive
@opindex -i
@opindex --interactive
Prompt whether to overwrite existing regular destination files.
When copying a file other than a directory, prompt whether to
overwrite an existing destination file.
@item -l
@itemx --link
@@ -9225,11 +9229,9 @@ For example, use @samp{touch ./12312359 main.c} or @samp{touch -t
@cindex disk usage
No disk can hold an infinite amount of data. These commands report on
how much disk storage is in use or available. (This has nothing much to
do with how much @emph{main memory}, i.e., RAM, a program is using when
it runs; for that, you want @command{ps} or @command{pstat} or @command{swap}
or some such command.)
No disk can hold an infinite amount of data. These commands report
how much disk storage is in use or available, report other file and
file status information, and write buffers to disk.
@menu
* df invocation:: Report file system disk space usage.
@@ -11971,7 +11973,8 @@ options}.
@command{groups} prints the names of the primary and any supplementary
groups for each given @var{username}, or the current process if no names
are given. If names are given, the name of each user is printed before
are given. If more than one name is given, the name of each user is
printed before
the list of that user's groups. Synopsis:
@example

View File

@@ -0,0 +1,16 @@
Index: modules/getloadavg
===================================================================
RCS file: /sources/gnulib/gnulib/modules/getloadavg,v
retrieving revision 1.13
diff -u -p -r1.13 getloadavg
--- modules/getloadavg 22 Sep 2006 12:47:55 -0000 1.13
+++ modules/getloadavg 23 Sep 2006 16:41:36 -0000
@@ -14,7 +14,7 @@ stdbool
fcntl-safer
configure.ac:
-gl_GETLOADAVG([$gl_source_base])
+gl_GETLOADAVG([lib])
Makefile.am:

View File

@@ -67,6 +67,7 @@ exclude.h
exit.h
exitfail.c
exitfail.h
fchmodat.c
fchown-stub.c
fcntl--.h
fcntl-safer.h
@@ -195,6 +196,7 @@ mkdir.c
mkdirat.c
mkstemp-safer.c
mkstemp.c
mkstemp.h
mktime.c
modechange.c
modechange.h
@@ -207,6 +209,7 @@ offtostr.c
open-safer.c
openat-die.c
openat-priv.h
openat-proc.c
openat.c
openat.h
pathmax.h

View File

@@ -1,3 +1,15 @@
2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
* .cvsignore: Add openat-proc.c.
2006-09-25 Paul Eggert <eggert@cs.ucla.edu>
* .cvsignore: Add fchmodat.c.
2006-09-25 Jim Meyering <jim@meyering.net>
* fchmodat.c: Remove file. gnulib's copy is identical.
2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
* .cvsignore: Add fcntl.h, fcntl_.h, inttypes_.h, isapipe.c,

View File

@@ -1,50 +0,0 @@
/* Change the protections of file relative to an open directory.
Copyright (C) 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* written by Jim Meyering */
#include <config.h>
#include "openat.h"
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "save-cwd.h"
#include "openat-priv.h"
#ifndef HAVE_LCHMOD
/* Use a different name, to avoid conflicting with any
system-supplied declaration. */
# undef lchmod
# define lchmod lchmod_rpl
static int lchmod (char const *f, mode_t m) { errno = ENOSYS; return -1; }
#endif
/* Solaris 10 has no function like this.
Invoke chmod or lchmod on file, FILE, using mode MODE, in the directory
open on descriptor FD. If possible, do it without changing the
working directory. Otherwise, resort to using save_cwd/fchdir,
then mkdir/restore_cwd. If either the save_cwd or the restore_cwd
fails, then give a diagnostic and exit nonzero.
Note that an attempt to use a FLAG value of AT_SYMLINK_NOFOLLOW
on a system without lchmod support causes this function to fail. */
#define AT_FUNC_NAME fchmodat
#define AT_FUNC_F1 lchmod
#define AT_FUNC_F2 chmod
#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW
#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode, int flag
#define AT_FUNC_POST_FILE_ARGS , mode
#include "at-func.c"

View File

@@ -1,3 +1,16 @@
2006-09-29 Jim Meyering <jim@meyering.net>
* readdir.m4: Remove file once again.
* jm-macros.m4: Remove reference to gl_FUNC_READDIR.
2006-09-28 Jim Meyering <jim@meyering.net>
* jm-macros.m4: Require the new macro.
* readdir.m4 (gl_FUNC_READDIR): Rename from GL_FUNC_READDIR.
Increment serial number.
* readdir.m4: Revivify this file.
We need it to work around a bug on Darwin 0.7.x.
2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
* .cvsignore: Add fcntl_h.m4, getloadavg.m4, inttypes-h.m4,

View File

@@ -5,32 +5,32 @@ retrieving revision 1.158
diff -u -p -u -r1.158 remove.c
--- src/remove.c 3 Sep 2006 02:54:51 -0000 1.158
+++ src/remove.c 6 Sep 2006 18:57:46 -0000
@@ -238,9 +238,10 @@ pop_dir (Dirstack_state *ds)
@@ -245,9 +245,10 @@ pop_dir (Dirstack_state *ds)
{
size_t n_lengths = obstack_object_size (&ds->len_stack) / sizeof (size_t);
size_t *length = obstack_base (&ds->len_stack);
+ size_t top_len;
assert (n_lengths > 0);
- size_t top_len = length[n_lengths - 1];
+ top_len = length[n_lengths - 1];
assert (top_len >= 2);
/* Pop the specified length of file name. */
@@ -372,10 +373,11 @@ AD_stack_top (Dirstack_state const *ds)
@@ -379,10 +380,11 @@ AD_stack_top (Dirstack_state const *ds)
static void
AD_stack_pop (Dirstack_state *ds)
{
+ struct AD_ent *top;
assert (0 < AD_stack_height (ds));
/* operate on Active_dir. pop and free top entry */
- struct AD_ent *top = AD_stack_top (ds);
+ top = AD_stack_top (ds);
if (top->unremovable)
hash_free (top->unremovable);
obstack_blank (&ds->Active_dir, -(int) sizeof (struct AD_ent));
@@ -542,6 +544,7 @@ AD_mark_helper (Hash_table **ht, char *f
@@ -549,6 +551,7 @@ AD_mark_helper (Hash_table **ht, char *f
if (*ht == NULL)
xalloc_die ();
}
@@ -38,44 +38,44 @@ diff -u -p -u -r1.158 remove.c
void *ent = hash_insert (*ht, filename);
if (ent == NULL)
xalloc_die ();
@@ -550,7 +553,7 @@ AD_mark_helper (Hash_table **ht, char *f
@@ -557,7 +560,7 @@ AD_mark_helper (Hash_table **ht, char *f
if (ent != filename)
free (filename);
}
-
+ }
}
/* Mark FILENAME (in current directory) as unremovable. */
@@ -1090,6 +1093,7 @@ fd_to_subdirp (int fd_cwd, char const *f
@@ -1097,6 +1100,7 @@ fd_to_subdirp (int fd_cwd, char const *f
return NULL;
}
+ {
DIR *subdir_dirp = fdopendir (fd_sub);
if (subdir_dirp == NULL)
{
@@ -1098,6 +1102,7 @@ fd_to_subdirp (int fd_cwd, char const *f
@@ -1105,6 +1109,7 @@ fd_to_subdirp (int fd_cwd, char const *f
}
return subdir_dirp;
+ }
}
/* Remove entries in the directory open on DIRP
@@ -1334,9 +1339,10 @@ remove_dir (int fd_cwd, Dirstack_state *
@@ -1340,9 +1345,10 @@ remove_dir (int fd_cwd, Dirstack_state *
/* The name of the directory that we have just processed,
nominally removing all of its contents. */
char *empty_dir;
+ int fd;
AD_pop_and_chdir (&dirp, ds, &empty_dir);
- int fd = (dirp != NULL ? dirfd (dirp) : AT_FDCWD);
+ fd = (dirp != NULL ? dirfd (dirp) : AT_FDCWD);
assert (dirp != NULL || AD_stack_height (ds) == 1);
/* Try to remove EMPTY_DIR only if remove_cwd_entries succeeded. */
@@ -1414,6 +1420,7 @@ rm_1 (Dirstack_state *ds, char const *fi
@@ -1420,6 +1426,7 @@ rm_1 (Dirstack_state *ds, char const *fi
return RM_ERROR;
}
@@ -83,26 +83,26 @@ diff -u -p -u -r1.158 remove.c
struct stat st;
cache_stat_init (&st);
if (x->root_dev_ino)
@@ -1435,6 +1442,7 @@ rm_1 (Dirstack_state *ds, char const *fi
@@ -1441,6 +1448,7 @@ rm_1 (Dirstack_state *ds, char const *fi
AD_push_initial (ds);
AD_INIT_OTHER_MEMBERS ();
+ {
int fd_cwd = AT_FDCWD;
enum RM_status status = remove_entry (fd_cwd, ds, filename, &st, x, NULL);
if (status == RM_NONEMPTY_DIR)
@@ -1453,6 +1461,8 @@ rm_1 (Dirstack_state *ds, char const *fi
@@ -1459,6 +1467,8 @@ rm_1 (Dirstack_state *ds, char const *fi
ds_clear (ds);
return status;
+ }
+ }
}
/* Remove all files and/or directories specified by N_FILES and FILE.
@@ -1475,9 +1485,11 @@ rm (size_t n_files, char const *const *f
@@ -1481,9 +1491,11 @@ rm (size_t n_files, char const *const *f
}
cycle_check_init (&ds->cycle_check_state);
+ {
enum RM_status s = rm_1 (ds, file[i], x, &cwd_errno);
@@ -110,7 +110,7 @@ diff -u -p -u -r1.158 remove.c
UPDATE_STATUS (status, s);
+ }
}
if (x->require_restore_cwd && cwd_errno)
Index: src/rm.c
===================================================================

View File

@@ -120,8 +120,8 @@ Change the group of each FILE to GROUP.\n\
With --reference, change the group of each FILE to that of RFILE.\n\
\n\
-c, --changes like verbose but report only when a change is made\n\
--dereference affect the referent of each symbolic link, rather\n\
than the symbolic link itself (this is the default)\n\
--dereference affect the referent of each symbolic link (this is\n\
the default), rather than the symbolic link itself\n\
"), stdout);
fputs (_("\
-h, --no-dereference affect each symbolic link instead of any referenced\n\

View File

@@ -193,6 +193,19 @@ process_file (FTS *fts, FTSENT *ent)
return true;
case FTS_NS:
/* For a top-level file or directory, this FTS_NS (stat failed)
indicator is determined at the time of the initial fts_open call.
With programs like chmod, chown, and chgrp, that modify
permissions, it is possible that the file in question is
accessible when control reaches this point. So, if this is
the first time we've seen the FTS_NS for this file, tell
fts_read to stat it "again". */
if (ent->fts_level == 0 && ent->fts_number == 0)
{
ent->fts_number = 1;
fts_set (fts, ent, FTS_AGAIN);
return true;
}
error (0, ent->fts_errno, _("cannot access %s"), quote (file_full_name));
ok = false;
break;

View File

@@ -267,6 +267,19 @@ change_file_owner (FTS *fts, FTSENT *ent,
break;
case FTS_NS:
/* For a top-level file or directory, this FTS_NS (stat failed)
indicator is determined at the time of the initial fts_open call.
With programs like chmod, chown, and chgrp, that modify
permissions, it is possible that the file in question is
accessible when control reaches this point. So, if this is
the first time we've seen the FTS_NS for this file, tell
fts_read to stat it "again". */
if (ent->fts_level == 0 && ent->fts_number == 0)
{
ent->fts_number = 1;
fts_set (fts, ent, FTS_AGAIN);
return true;
}
error (0, ent->fts_errno, _("cannot access %s"), quote (file_full_name));
ok = false;
break;

View File

@@ -101,8 +101,8 @@ Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
With --reference, change the owner and group of each FILE to those of RFILE.\n\
\n\
-c, --changes like verbose but report only when a change is made\n\
--dereference affect the referent of each symbolic link, rather\n\
than the symbolic link itself (this is the default)\n\
--dereference affect the referent of each symbolic link (this is\n\
the default), rather than the symbolic link itself\n\
"), stdout);
fputs (_("\
-h, --no-dereference affect each symbolic link instead of any referenced\n\

View File

@@ -296,6 +296,8 @@ copy_reg (char const *src_name, char const *dst_name,
return_val = false;
goto close_src_desc;
}
if (x->verbose)
printf (_("removed %s\n"), quote (dst_name));
/* Tell caller that the destination file was unlinked. */
*new_dst = true;
@@ -1036,31 +1038,54 @@ copy_internal (char const *src_name, char const *dst_name,
that it is XSTAT'able. */
bool return_now;
bool unlink_src;
bool ok = same_file_ok (src_name, &src_sb, dst_name, &dst_sb,
x, &return_now, &unlink_src);
if (unlink_src)
{
if (!abandon_move (x, dst_name, &dst_sb)
&& unlink (src_name) != 0)
{
error (0, errno, _("cannot remove %s"), quote (src_name));
return false;
}
/* Tell the caller that there's no need to remove src_name. */
if (rename_succeeded)
*rename_succeeded = true;
}
if (return_now)
return true;
if (! ok)
if (! same_file_ok (src_name, &src_sb, dst_name, &dst_sb,
x, &return_now, &unlink_src))
{
error (0, 0, _("%s and %s are the same file"),
quote_n (0, src_name), quote_n (1, dst_name));
return false;
}
/* When there is an existing destination file, we may end up
returning early, and hence not copying/moving the file.
This may be due to an interactive `negative' reply to the
prompt about the existing file. It may also be due to the
use of the --reply=no option.
cp and mv treat -i and -f differently. */
if (x->move_mode)
{
if (abandon_move (x, dst_name, &dst_sb)
|| (unlink_src && unlink (src_name) == 0))
{
/* Pretend the rename succeeded, so the caller (mv)
doesn't end up removing the source file. */
if (rename_succeeded)
*rename_succeeded = true;
if (unlink_src && x->verbose)
printf (_("removed %s\n"), quote (src_name));
return true;
}
if (unlink_src)
{
error (0, errno, _("cannot remove %s"), quote (src_name));
return false;
}
}
else
{
if (! S_ISDIR (src_mode)
&& (x->interactive == I_ALWAYS_NO
|| (x->interactive == I_ASK_USER
&& (overwrite_prompt (dst_name, &dst_sb), 1)
&& ! yesno ())))
return true;
}
if (return_now)
return true;
if (!S_ISDIR (dst_sb.st_mode))
{
if (S_ISDIR (src_type))
@@ -1140,37 +1165,6 @@ copy_internal (char const *src_name, char const *dst_name,
}
}
/* When there is an existing destination file, we may end up
returning early, and hence not copying/moving the file.
This may be due to an interactive `negative' reply to the
prompt about the existing file. It may also be due to the
use of the --reply=no option. */
if (!S_ISDIR (src_type))
{
/* cp and mv treat -i and -f differently. */
if (x->move_mode)
{
if (abandon_move (x, dst_name, &dst_sb))
{
/* Pretend the rename succeeded, so the caller (mv)
doesn't end up removing the source file. */
if (rename_succeeded)
*rename_succeeded = true;
return true;
}
}
else
{
if (x->interactive == I_ALWAYS_NO
|| (x->interactive == I_ASK_USER
&& (overwrite_prompt (dst_name, &dst_sb), 1)
&& ! yesno ()))
{
return true;
}
}
}
if (x->move_mode)
{
/* Don't allow user to move a directory onto a non-directory. */
@@ -1250,6 +1244,8 @@ copy_internal (char const *src_name, char const *dst_name,
return false;
}
new_dst = true;
if (x->verbose)
printf (_("removed %s\n"), quote (dst_name));
}
}
}
@@ -1354,6 +1350,8 @@ copy_internal (char const *src_name, char const *dst_name,
error (0, errno, _("cannot remove %s"), quote (dst_name));
goto un_backup;
}
if (x->verbose)
printf (_("removed %s\n"), quote (dst_name));
link_failed = (link (earlier_file, dst_name) != 0);
}

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# groups -- print the groups a user is in
# Copyright (C) 1991, 1997, 2000, 2002, 2004 Free Software Foundation, Inc.
# Copyright (C) 1991, 1997, 2000, 2002, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -34,37 +34,49 @@ Report bugs to <@PACKAGE_BUGREPORT@>."
version='groups (@GNU_PACKAGE@) @VERSION@
Written by David MacKenzie.
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'
fail=0
for arg
do
case $arg in
--help | --hel | --he | --h)
exec echo "$usage" ;;
--version | --versio | --versi | --vers | --ver | --ve | --v)
exec echo "$version" ;;
--)
shift
break ;;
-*)
echo "$0: invalid option: $arg" >&2
exit 1 ;;
esac
done
# With fewer than two arguments, simply exec "id".
case $# in
1 )
case "z${1}" in
z--help )
echo "$usage" || fail=1; exit $fail;;
z--version )
echo "$version" || fail=1; exit $fail;;
* ) ;;
esac
;;
* ) ;;
0|1) exec id -Gn -- "$@" ;;
esac
if [ $# -eq 0 ]; then
id -Gn
fail=$?
else
for name in "$@"; do
groups=`id -Gn -- $name`
# With more, we need a loop, and be sure to exit nonzero upon failure.
status=0
write_error=0
for name
do
if groups=`id -Gn -- "$name"`; then
echo "$name : $groups" || {
status=$?
if test $write_error = 0; then
echo "$0: write error" >&2
write_error=1
fi
}
else
status=$?
if test $status = 0; then
echo $name : $groups
else
fail=$status
fi
done
fi
exit $fail
fi
done
exit $status

View File

@@ -112,8 +112,9 @@ target_directory_operand (char const *file)
size_t blen = strlen (b);
bool looks_like_a_dir = (blen == 0 || ISSLASH (b[blen - 1]));
struct stat st;
int err = ((dereference_dest_dir_symlinks ? stat : lstat) (file, &st) == 0
? 0 : errno);
int stat_result =
(dereference_dest_dir_symlinks ? stat (file, &st) : lstat (file, &st));
int err = (stat_result == 0 ? 0 : errno);
bool is_a_dir = !err && S_ISDIR (st.st_mode);
if (err && err != ENOENT)
error (EXIT_FAILURE, err, _("accessing %s"), quote (file));
@@ -254,7 +255,7 @@ do_link (const char *source, const char *dest)
Try to unlink DEST even if we may have backed it up successfully.
In some unusual cases (when DEST and DEST_BACKUP are hard-links
that refer to the same file), rename succeeds and DEST remains.
If we didn't remove DEST in that case, the subsequent LINKFUNC
If we didn't remove DEST in that case, the subsequent symlink or link
call would fail. */
if (!ok && errno == EEXIST && (remove_existing_files || dest_backup))

View File

@@ -50,19 +50,26 @@
#define obstack_chunk_free free
/* This is the maximum number of consecutive readdir/unlink calls that
can be made (with no intervening rewinddir or closedir/opendir)
before triggering a bug that makes readdir return NULL even though
some directory entries have not been processed. The bug afflicts
SunOS's readdir when applied to ufs file systems and Darwin 6.5's
(and OSX v.10.3.8's) HFS+. This maximum is conservative in that
demonstrating the problem seems to require a directory containing
at least 254 deletable entries (which doesn't count . and ..), so
we could conceivably increase the maximum value to 254. */
can be made (with no intervening rewinddir or closedir/opendir) before
triggering a bug that makes readdir return NULL even though some
directory entries have not been processed. The bug afflicts SunOS's
readdir when applied to ufs file systems and Darwin 6.5's (and OSX
v.10.3.8's) HFS+. This maximum is conservative in that demonstrating
the problem requires a directory containing at least 16 deletable
entries (which doesn't count . and ..).
This problem also affects Darwin 7.9.0 (aka MacOS X 10.3.9) on HFS+
and NFS-mounted file systems, but not vfat ones. */
enum
{
CONSECUTIVE_READDIR_UNLINK_THRESHOLD = 200
CONSECUTIVE_READDIR_UNLINK_THRESHOLD = 10
};
/* FIXME: in 2009, or whenever Darwin 7.9.0 (aka MacOS X 10.3.9) is no
longer relevant, remove this work-around code. Then, there will be
no need to perform the extra rewinddir call, ever. */
#define NEED_REWIND(readdir_unlink_count) \
(CONSECUTIVE_READDIR_UNLINK_THRESHOLD <= (readdir_unlink_count))
enum Ternary
{
T_UNKNOWN = 2,
@@ -1138,8 +1145,7 @@ remove_cwd_entries (DIR **dirp,
{
/* fall through */
}
else if (CONSECUTIVE_READDIR_UNLINK_THRESHOLD
< n_unlinked_since_opendir_or_last_rewind)
else if (NEED_REWIND (n_unlinked_since_opendir_or_last_rewind))
{
/* Call rewinddir if we've called unlink or rmdir so many times
(since the opendir or the previous rewinddir) that this

View File

@@ -178,7 +178,7 @@ read_input (FILE *in, char eolbyte, char ***pline)
do
{
if (alloc == used)
if (alloc <= used + 1)
{
if (alloc == SIZE_MAX)
xalloc_die ();
@@ -279,6 +279,7 @@ main (int argc, char **argv)
{
unsigned long int argval = 0;
char *p = strchr (optarg, '-');
char const *hi_optarg = optarg;
bool invalid = !p;
if (input_numbers_option_used (lo_input, hi_input))
@@ -292,10 +293,10 @@ main (int argc, char **argv)
|| SIZE_MAX < argval);
*p = '-';
lo_input = argval;
optarg = p + 1;
hi_optarg = p + 1;
}
invalid |= ((xstrtoul (optarg, NULL, 10, &argval, NULL)
invalid |= ((xstrtoul (hi_optarg, NULL, 10, &argval, NULL)
!= LONGINT_OK)
|| SIZE_MAX < argval);
hi_input = argval;

View File

@@ -73,11 +73,10 @@ chgrp $g2 d ||fail=1; test `stat --p=%g: $d_files` = "$g2:$g1:" || fail=1
rm -f f
touch f
ln -s f symlink
chgrp $g1 f; test `stat --printf=%g f` = $g1 || fail=1
chgrp $g1 f
test `stat --printf=%g f` = $g1 || fail=1
# This should not change the group of f.
test `stat --printf=%g f` = $g1 || fail=1
test `stat --printf=%g symlink` = $g1 || fail=1
chgrp -h $g2 symlink
test `stat --printf=%g f` = $g1 || fail=1
test `stat --printf=%g symlink` = $g2 || fail=1

View File

@@ -1,7 +1,17 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
AUTOMAKE_OPTIONS = 1.4 gnits
TESTS = octal no-x equals equal-x c-option setgid umask-x usage
TESTS = \
inaccessible \
c-option \
equal-x \
equals \
no-x \
octal \
setgid \
umask-x \
usage
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"

47
tests/chmod/inaccessible Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/sh
# Test for the bug fixed on 2006-09-20.
# Copyright (C) 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
if test "$VERBOSE" = yes; then
set -x
chmod --version
fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
mkdir -p d/e
chmod 0 d/e d
if test $framework_failure = 1; then
echo "$0: failure in testing framework" 1>&2
(exit 1); exit 1
fi
fail=0
chmod u+rwx d d/e || fail=1
(exit $fail); exit $fail

View File

@@ -29,7 +29,7 @@ TESTS = \
preserve-2 r-vs-symlink link-preserve \
backup-1 no-deref-link1 no-deref-link2 no-deref-link3 backup-is-src \
same-file cp-mv-backup symlink-slash slink-2-slink fail-perm dir-slash \
perm cp-HL special-bits link dir-rm-dest cp-parents deref-slink \
perm cp-HL cp-i special-bits link dir-rm-dest cp-parents deref-slink \
dir-vs-file into-self
EXTRA_DIST = $(TESTS) trailing-slash
TESTS_ENVIRONMENT = \

51
tests/cp/cp-i Executable file
View File

@@ -0,0 +1,51 @@
#!/bin/sh
# Test whether cp -i prompts in the right place.
# Copyright (C) 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
if test "$VERBOSE" = yes; then
set -x
cp --version
fi
. $srcdir/../envvar-check
. $srcdir/../lang-default
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
mkdir -p a b/a/c || framework_failure=1
touch a/c || framework_failure=1
if test $framework_failure = 1; then
echo "$0: failure in testing framework" 1>&2
(exit 1); exit 1
fi
fail=0
# coreutils 6.2 cp would neglect to prompt in this case.
echo n | cp -iR a b 2>/dev/null || fail=1
(exit $fail); exit $fail

View File

@@ -161,6 +161,11 @@ printf_args=foo
seq_args=10
sleep_args=0
su_args=--version
# I'd rather not run sync, since it spins up disks that I've
# deliberately caused to spin down (but not unmounted).
sync_args=--version
test_args=foo
# This is necessary in the unusual event that there is

View File

@@ -112,8 +112,7 @@ test -d xx/rel && fail=1
mkdir -p sub1/d || fail=1
(cd sub1/d && chmod a-rx .. && chmod a-r . &&
ginstall -d $abs/xx/zz rel/a rel/b 2> /dev/null) || fail=1
chmod 755 sub1 || fail=1
chmod 755 sub1/d || fail=1
chmod 755 sub1 sub1/d || fail=1
test -d xx/zz || fail=1
test -d sub1/d/rel/a || fail=1
test -d sub1/d/rel/b || fail=1

View File

@@ -37,7 +37,18 @@ fi
# Also, tmpfs on Solaris 10 lacks d_type support.
skip=yes
fs_type=`stat -f --printf %T .`
test `uname -s` = Linux && test $fs_type = tmpfs && skip=no
linux_2_6_or_newer=0
case `uname -r` in
[01].*) ;;
2.[0-5]*) ;;
*) linux_2_6_or_newer=1 ;;
esac
test `uname -s` = Linux \
&& test $linux_2_6_or_newer = 1 \
&& test $fs_type = tmpfs \
&& skip=no
test $fs_type = ext2/ext3 && skip=no
test $skip = yes &&
{

View File

@@ -60,12 +60,10 @@ while :; do
# We know from experience that there may be mismatches on some
# buggy file systems, at mount points.
if test "$d_ino" != "$st_ino"; then
echo "$0: test failed: $t/$file: d_ino($d_ino) != st_ino($st_ino)" 1>&2
echo "$0: This may indicate a flaw in your kernel or" \
"file system implementation." 1>&2
echo "$0: This flaw won't impact coreutils, but it may well"
"affect other tools,"
echo "$0: so you should report it to your operating system vendor." 1>&2
echo "$0: test failed: $t/$file: d_ino($d_ino) != st_ino($st_ino)
This may indicate a flaw in your kernel or file system implementation.
The flaw isn't serious for coreutils, but it might break other tools,
so you should report it to your operating system vendor." 1>&2
# This test fails too often, and we don't want to be distracted
# with reports, since the code that could be affected by the losing

View File

@@ -51,4 +51,8 @@ cmp in out > /dev/null && { fail=1; echo "not random?" 1>&2; }
sort -n out > out1
cmp in out1 || { fail=1; echo "not a permutation" 1>&2; }
# Before coreutils-6.3, this would infloop.
# "seq 1860" produces 8193 bytes of output.
seq 1860 | shuf > /dev/null || fail=1
(exit $fail); exit $fail

View File

@@ -22,6 +22,7 @@ AUTOMAKE_OPTIONS = 1.3 gnits
XFAIL_TESTS = acl
TESTS = \
hard-verbose \
backup-dir \
dir2dir \
no-target-dir \
@@ -36,7 +37,7 @@ TESTS = \
perm-1 \
i-link-no \
part-fail \
dup-source childproof i-4 update i-2 mv-special-1 \
dup-source childproof i-4 i-5 update i-2 mv-special-1 \
into-self into-self-2 into-self-3 into-self-4 \
backup-is-src \
i-1 hard-link-1 force partition-perm to-symlink dir-file diag \

56
tests/mv/hard-verbose Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/sh
# ensure that mv's --verbose options works even in this unusual case
# Copyright (C) 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
if test "$VERBOSE" = yes; then
set -x
mv --version
fi
. $srcdir/../envvar-check
. $srcdir/../lang-default
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
touch x || framework_failure=1
ln x y || framework_failure=1
if test $framework_failure = 1; then
echo "$0: failure in testing framework" 1>&2
(exit 1); exit 1
fi
fail=0
mv --verbose x y > out || fail=1
cat <<\EOF > exp || fail=1
removed `x'
EOF
cmp out exp || fail=1
test $fail = 1 && diff out exp 2> /dev/null
(exit $fail); exit $fail

51
tests/mv/i-5 Executable file
View File

@@ -0,0 +1,51 @@
#!/bin/sh
# Make sure `mv -i dir file' prompts before failing.
# Copyright (C) 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
if test "$VERBOSE" = yes; then
set -x
mv --version
fi
. $srcdir/../envvar-check
. $srcdir/../lang-default
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
mkdir a || framework_failure=1
touch b || framework_failure=1
if test $framework_failure = 1; then
echo 'failure in testing framework'
exit 1
fi
fail=0
# coreutils 6.2 mv would neglect to prompt in this case.
echo n | mv -i a b 2>/dev/null || fail=1
(exit $fail); exit $fail

View File

@@ -21,6 +21,7 @@
AUTOMAKE_OPTIONS = 1.1 gnits
TESTS = \
readdir-bug \
empty-inacc \
dir-nonrecur \
dot-rel \

View File

@@ -3,7 +3,7 @@
# Ensure that rm gives the expected diagnostic when failing to remove a file
# owned by some other user in a directory with the sticky bit set.
# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
# Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@ $PERL -e 1 > /dev/null 2>&1 || {
ARGV_0=$0
export ARGV_0
exec $PERL -w -- - << \EOP
exec $PERL -Tw -- - << \EOP
require 5.003;
use strict;
@@ -54,7 +54,12 @@ my $verbose = $ENV{VERBOSE} && $ENV{VERBOSE} eq 'yes';
# Ensure that the diagnostics are in English.
$ENV{LC_ALL} = 'C';
# Set up a safe, well-known environment
delete @ENV{qw(BASH_ENV CDPATH ENV PATH)};
$ENV{IFS} = '';
my @dir_list = qw(/tmp /var/tmp /usr/tmp);
my $rm = '../../src/rm';
# Find a directory with the sticky bit set.
my $found_dir;
@@ -71,6 +76,11 @@ foreach my $dir (@dir_list)
foreach my $f (readdir DIR_HANDLE)
{
# Consider only names containing "safe" characters.
$f =~ /^([-\@\w.]+)$/
or next;
$f = $1; # untaint $f
my $target_file = "$dir/$f";
$verbose
and warn "$ME: considering $target_file\n";
@@ -86,7 +96,7 @@ foreach my $dir (@dir_list)
# Invoke rm on this file and ensure that we get the
# expected exit code and diagnostic.
my $cmd = "rm -f $target_file";
my $cmd = "$rm -f -- $target_file";
open RM, "$cmd 2>&1 |"
or die "$ME: cannot execute `$cmd'\n";
@@ -98,14 +108,14 @@ foreach my $dir (@dir_list)
or die "$ME: unexpected exit status from `$cmd';\n"
. " got $status, expected 1\n";
my $exp = "rm: cannot remove `$target_file':";
my $exp = "$rm: cannot remove `$target_file':";
$line
or die "$ME: no output from `$cmd';\n"
. "expected something like `$exp ...'\n";
my $regex = quotemeta $exp;
$line =~ /^$regex/
or die "$ME: unexpected dignostic from `$cmd';\n"
or die "$ME: unexpected diagnostic from `$cmd';\n"
. " got $line"
. " expected $exp ...\n";

60
tests/rm/readdir-bug Executable file
View File

@@ -0,0 +1,60 @@
#!/bin/sh
# Exercise the Darwin/MacOS bug worked around on 2006-09-29,
# whereby rm would fail to remove all entries in a directory.
# Copyright (C) 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
if test "$VERBOSE" = yes; then
set -x
rm --version
fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
# Create a directory containing many files.
# What counts is a combination of the number of files and
# the lengths of their names. For details, see
# http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
mkdir b || framework_failure=1
cd b || framework_failure=1
for i in `seq 1 250`; do
touch `printf %040d $i` || framework_failure=1
done
cd .. || framework_failure=1
if test $framework_failure = 1; then
echo "$0: failure in testing framework" 1>&2
(exit 1); exit 1
fi
fail=0
# On a buggy system, this would fail with the diagnostic,
# "cannot remove directory `b': Directory not empty"
rm -rf b || fail=1
test -d b && fail=1
(exit $fail); exit $fail

View File

@@ -45,7 +45,7 @@ my @Tests =
['onearg-1', qw(10), {OUT => [(1..10)]}],
['onearg-2', qw(-1)],
['neg-1', qw(-10 10 10), {OUT => [qw(-10 0 10)]}],
['neg-2', qw(-.1 .1 .1), {OUT => [qw(-0.1 0.0 0.1)]}],
# ['neg-2', qw(-.1 .1 .11), {OUT => [qw(-0.1 0.0 0.1)]}],
['neg-3', qw(1 -1 0), {OUT => [qw(1 0)]}],
['neg-4', qw(1 -1 -1), {OUT => [qw(1 0 -1)]}],
@@ -53,7 +53,8 @@ my @Tests =
# Prior to 2.0g, this test would fail on e.g., HPUX systems
# because it'd end up using %3.1f as the format instead of %4.1f.
['eq-wid-2', qw(-w -.1 .1 .1),{OUT => [qw(-0.1 00.0 00.1)]}],
# ['eq-wid-2', qw(-w -.1 .1 .11),{OUT => [qw(-0.1 00.0 00.1)]}],
# ['eq-wid-3', qw(-w 1 3.0), {OUT => [qw(1 2 3)]}],
# Prior to coreutils-4.5.11, some of these were not accepted.
['fmt-1', qw(-f %2.1f 1.5 .5 2),{OUT => [qw(1.5 2.0)]}],

View File

@@ -59,9 +59,7 @@ NA LAST NA
'
set $tests
saved_size=.saved-size
stty size > $saved_size \
saved_size=`stty size` && test -n "$saved_size" \
|| { echo "$0: skipping this test: can't get window size" 1>&2;
exit 77; exit; }
@@ -84,7 +82,7 @@ while :; do
shift; shift; shift
done
stty `cat $saved_size|sed 's/ / columns /;s/^/rows /'` || exit 1
rm -f $saved_size
set x $saved_size
stty rows $2 columns $3 || exit 1
exit $fail

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Prior to textutils-2.0.17, `tail /proc/ksyms' would segfault on Linux.
# Copyright (C) 2001, 2004 Free Software Foundation, Inc.
# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ trap '(exit $?); exit' 1 2 13 15
fail=0
ksyms=/proc/ksyms
if test -f $ksyms; then
if test -r $ksyms; then
tail $ksyms > /dev/null || fail=1
fi