platform/upstream/coreutils.git
16 years agocp: add a test for today's bug fix.
Jim Meyering [Mon, 7 Jan 2008 10:57:27 +0000 (11:57 +0100)]
cp: add a test for today's bug fix.

* tests/cp/parent-perm: New script.  Test today's change.
Based on reproducer from Jan Blunck.
* tests/cp/Makefile.am (TESTS): Add parent-perm.

16 years agotouch: add a test for today's change.
Jim Meyering [Sun, 6 Jan 2008 11:38:18 +0000 (12:38 +0100)]
touch: add a test for today's change.

* tests/touch/now-owned-by-other: New script.  Test today's change.
* tests/touch/Makefile.am (TESTS): Add now-owned-by-other.
* tests/Makefile.am (all_t): Add td, a new root-only test.
(td): New target.
* NEWS: Mention the improvement.

16 years agotouch: ignore "-d now" option, when appropriate
Paul Eggert [Sun, 6 Jan 2008 08:54:15 +0000 (09:54 +0100)]
touch: ignore "-d now" option, when appropriate

* src/touch.c (main): Treat "-d now" as if it were absent, if
neither -a nor -m is specified.  Problem reported by Dan Jacobson in:
http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00010.html

16 years agoAvoid tr case-conversion failure in some locales.
Jim Meyering [Sat, 5 Jan 2008 22:55:01 +0000 (23:55 +0100)]
Avoid tr case-conversion failure in some locales.

* src/tr.c (skip_construct): New function.
(main): When processing a pair of case-converting classes, don't
iterate through the elements of each [:upper:] or [:lower:] class.
Reported by Gerald Pfeifer in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218>.
* tests/tr/Test.pm [tolower-F]: New test for the above fix.
[upcase-xtra, dncase-xtra]: New tests, for a related code path.
* NEWS: Mention the tr bug fix.

16 years ago* .gitignore: Ignore lzma-compressed files, too.
Jim Meyering [Wed, 2 Jan 2008 17:05:24 +0000 (18:05 +0100)]
* .gitignore: Ignore lzma-compressed files, too.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoUpdate copyright date.
Jim Meyering [Wed, 2 Jan 2008 17:05:09 +0000 (18:05 +0100)]
Update copyright date.

* tests/sample-test: Likewise.
* doc/coreutils.texi: Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoAdd a syntax check, so this doesn't recur. Reorganize existing checks.
Jim Meyering [Mon, 31 Dec 2007 10:28:02 +0000 (11:28 +0100)]
Add a syntax check, so this doesn't recur.  Reorganize existing checks.

* doc/Makefile.am (sc-exponent-grouping):
(syntax_checks): New variable.
(sc-avoid-io, sc-avoid-non-zero, sc-avoid-timezone):
(sc-avoid-zeroes, sc-use-small-caps-NUL): New rules, extracted
from check-texinfo.
(check-texinfo): Depend on $(syntax_checks).

16 years agodoc: Put braces around multi-digit exponents.
Jim Meyering [Mon, 31 Dec 2007 10:22:53 +0000 (11:22 +0100)]
doc: Put braces around multi-digit exponents.

Reported by Darrel Francis.

17 years ago* src/dircolors.hin (TERM): Add gnome-256color.
Mike Frysinger [Sun, 30 Dec 2007 08:25:06 +0000 (09:25 +0100)]
* src/dircolors.hin (TERM): Add gnome-256color.

17 years agodoc/coreutils.texi: Fix a typo. Avoid the term `relationals'.
Ralf Wildenhues [Fri, 21 Dec 2007 18:33:43 +0000 (19:33 +0100)]
doc/coreutils.texi: Fix a typo.  Avoid the term `relationals'.

17 years agoUse comma-separated list in ./configure --help output.
Jim Meyering [Thu, 20 Dec 2007 16:38:57 +0000 (17:38 +0100)]
Use comma-separated list in ./configure --help output.

* configure.ac: Map commas to spaces in excluded-program list.
Use a comma-separated list, not a space-separated one.
* m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG):
Expect list of program names to be comma-separated.
Reported by Jan Bauke Douma.

17 years agoAvoid another "make check" failure due to omitted programs.
Jim Meyering [Thu, 20 Dec 2007 13:19:56 +0000 (14:19 +0100)]
Avoid another "make check" failure due to omitted programs.

* tests/test-lib.sh (require_built_): New function.
* tests/misc/groups-version: Use it to skip this test if
either groups or id is not built.

17 years agoAvoid spurious "make check" failures due to omitted programs.
Jim Meyering [Thu, 20 Dec 2007 13:03:12 +0000 (14:03 +0100)]
Avoid spurious "make check" failures due to omitted programs.

* man/Makefile.am (distcheck-hook): Make check rules dependents of
this target, not of check-local, so that people aren't distracted by
failures due to programs omitted via --enable-no-install-program=...

17 years agoImprove wording in uniq's --help "Note".
Paul Eggert [Wed, 19 Dec 2007 09:01:25 +0000 (10:01 +0100)]
Improve wording in uniq's --help "Note".

17 years ago* src/uniq.c (usage): Say "key-selection", not "field-selection".
Jim Meyering [Tue, 18 Dec 2007 20:14:49 +0000 (21:14 +0100)]
* src/uniq.c (usage): Say "key-selection", not "field-selection".

Quote example commands consistently.

17 years agoNote that sorting uniq's input is often useful.
Jim Meyering [Tue, 18 Dec 2007 10:20:31 +0000 (11:20 +0100)]
Note that sorting uniq's input is often useful.

Suggested by Eric Blake.

17 years ago.prev-version: Record previous version: 6.9.91.
Jim Meyering [Sat, 15 Dec 2007 09:13:44 +0000 (10:13 +0100)]
.prev-version: Record previous version: 6.9.91.

17 years agoVersion 6.9.91. v6.9.91
Jim Meyering [Sat, 15 Dec 2007 08:44:40 +0000 (09:44 +0100)]
Version 6.9.91.

17 years ago* Makefile.cfg (gpg_key_ID): Use new, longer signing subkey.
Jim Meyering [Sat, 15 Dec 2007 08:43:43 +0000 (09:43 +0100)]
* Makefile.cfg (gpg_key_ID): Use new, longer signing subkey.

17 years ago* tests/mv/part-symlink: Redirect diff output to stderr.
Jim Meyering [Wed, 12 Dec 2007 09:25:38 +0000 (10:25 +0100)]
* tests/mv/part-symlink: Redirect diff output to stderr.

17 years agoAdd a test to exercise today's bug fix.
Jim Meyering [Tue, 11 Dec 2007 20:26:32 +0000 (21:26 +0100)]
Add a test to exercise today's bug fix.

* tests/misc/selinux: Test for today's bug fix.
* NEWS: Mention the SELinux "ls -l" fix.

17 years ago"ls -l" wouldn't output "+" on SELinux hosts unless -Z was also given.
Paul Eggert [Tue, 11 Dec 2007 20:16:24 +0000 (21:16 +0100)]
"ls -l" wouldn't output "+" on SELinux hosts unless -Z was also given.

* src/ls.c (gobble_file): Also get the file context if -l is specified.
Treat getfilecon failures like file_has_acl failures.
(UNKNOWN_SECURITY_CONTEXT): New constant.
(clear_files): Don't free it.
(gobble_file): Set unknown security contexts to it; that way, we
don't have to have special cases for unknown contexts.
(print_long_format, print_file_name_and_frills): Don't worry
about scontext being null, since it's always some string now.

17 years ago* NEWS: Add the "Bug fixes" heading.
Jim Meyering [Tue, 11 Dec 2007 18:08:03 +0000 (19:08 +0100)]
* NEWS: Add the "Bug fixes" heading.

17 years ago"rm" as root would fail to unlink a non-directory on OS X 10.4.x
Jim Meyering [Sat, 8 Dec 2007 23:56:02 +0000 (00:56 +0100)]
"rm" as root would fail to unlink a non-directory on OS X 10.4.x

* src/remove.c (remove_entry) ["can unlink directories"]: Fix a
mistakenly reversed condition.
* NEWS: Mention this bug fix.
Reported by Pieter Bowman.

17 years ago* src/c99-to-c89.diff: Adjust shred.c offsets.
Jim Meyering [Sat, 8 Dec 2007 13:08:16 +0000 (14:08 +0100)]
* src/c99-to-c89.diff: Adjust shred.c offsets.

17 years agoReflect change in gnulib: don't include getpagesize.h,
Jim Meyering [Mon, 3 Dec 2007 23:42:18 +0000 (00:42 +0100)]
Reflect change in gnulib: don't include getpagesize.h,

now that it's provided by unistd.h.
* src/cat.c: Don't include getpagesize.h.
* src/copy.c: Likewise.
* src/dd.c: Likewise.
* src/shred.c: Likewise.
* src/split.c: Likewise.

17 years agoCopy a .po file into place also when the target doesn't exist.
Jim Meyering [Sun, 2 Dec 2007 20:02:26 +0000 (21:02 +0100)]
Copy a .po file into place also when the target doesn't exist.

* bootstrap (gnulib_tool): ... not just when the checksum differs.
So now, if I manually remove po/xx.po, rerunning bootstrap will
copy the latest into place.

Signed-off-by: Jim Meyering <meyering@redhat.com>
17 years agoMake my-distcheck depend on "check".
Jim Meyering [Sun, 2 Dec 2007 19:53:43 +0000 (20:53 +0100)]
Make my-distcheck depend on "check".

* Makefile.maint (my-distcheck): Also depend on "check", so I can't tag
and release something that fails "make check" (however harmless) when
run in a checked-out-from-git dir, but not in the distributed tarball.

Signed-off-by: Jim Meyering <meyering@redhat.com>
17 years ago* NEWS: Add the usual "Noteworthy changes in release 6.9.91..." line.
Jim Meyering [Sun, 2 Dec 2007 17:39:40 +0000 (18:39 +0100)]
* NEWS: Add the usual "Noteworthy changes in release 6.9.91..." line.

17 years agoRemove just-installed su, if unable to make it set-UID root.
Jim Meyering [Sun, 2 Dec 2007 15:19:04 +0000 (16:19 +0100)]
Remove just-installed su, if unable to make it set-UID root.

Normally, su isn't even installed.  However, if you configure with
--enable-install-program=su, and then install with insufficient
privileges, we now make sure to remove the just-installed binary.
* src/Makefile.am (install-exec-hook): Rename from install-exec-local,
so that this rule is guaranteed to be run *after* installation.
If unable to chown and chmod the installed "su" program, remove it.
Reported by Greg Schaefer.

17 years agoMake test script, existing-perm-race, executable.
Bob Proulx [Sun, 2 Dec 2007 07:57:38 +0000 (08:57 +0100)]
Make test script, existing-perm-race, executable.

* tests/cp/existing-perm-race: Update file mode.

17 years ago.prev-version: Record previous version: 6.9.90.
Jim Meyering [Sat, 1 Dec 2007 22:11:13 +0000 (23:11 +0100)]
.prev-version: Record previous version: 6.9.90.

17 years agoVersion 6.9.90. v6.9.90
Jim Meyering [Sat, 1 Dec 2007 21:46:33 +0000 (22:46 +0100)]
Version 6.9.90.

17 years agoNEWS: Remove the now-untrue statement about cp vs. dangling symlinks
Jim Meyering [Sat, 1 Dec 2007 21:45:56 +0000 (22:45 +0100)]
NEWS: Remove the now-untrue statement about cp vs. dangling symlinks

17 years agoChange release procedure: tag *before* running e.g., "make stable".
Jim Meyering [Sat, 1 Dec 2007 18:52:45 +0000 (19:52 +0100)]
Change release procedure: tag *before* running e.g., "make stable".

* Makefile.maint (vc-dist): Don't tag.  Now, you must apply the tag
before running "make beta", "make stable", etc.
(vc-tag-check): Remove rule.  No longer makes sense.

17 years ago* Makefile.maint (vc-tag-check): Correct check for existing git tag.
Jim Meyering [Sat, 1 Dec 2007 18:03:00 +0000 (19:03 +0100)]
* Makefile.maint (vc-tag-check): Correct check for existing git tag.

17 years agoDefer NEWS and ChangeLog checks until after the version-changing tag.
Jim Meyering [Sat, 1 Dec 2007 17:50:40 +0000 (18:50 +0100)]
Defer NEWS and ChangeLog checks until after the version-changing tag.

* Makefile.maint (alpha beta major): Don't depend on the
news-date-check changelog-check targets.  They must fail before
applying the version-changing tag.  Instead, run them after "vc-dist".

17 years ago* NEWS: Mention some of the SELinux changes.
Jim Meyering [Sat, 1 Dec 2007 17:05:53 +0000 (18:05 +0100)]
* NEWS: Mention some of the SELinux changes.

Record release date and new version number.
* src/stat.c (main): Adjust a comment.

17 years agoTODO: Add entries (documentation needed); remove the "add mktemp program" one.
Jim Meyering [Sat, 1 Dec 2007 16:42:40 +0000 (17:42 +0100)]
TODO: Add entries (documentation needed); remove the "add mktemp program" one.

17 years agoAdd "extern" keyword to declaration of cp_options_default.
Jim Meyering [Sat, 1 Dec 2007 16:04:30 +0000 (17:04 +0100)]
Add "extern" keyword to declaration of cp_options_default.

* src/copy.c (cp_options_default): Mark as "extern", so the
"sc_tight_scope" part of "make distcheck" passes.

17 years agoChange comments: say bug present up to coreutils-6.9, not fixed in 6.10.
Jim Meyering [Sat, 1 Dec 2007 15:18:00 +0000 (16:18 +0100)]
Change comments: say bug present up to coreutils-6.9, not fixed in 6.10.

* tests/cut/Test.pm: Adjust comment.
* tests/misc/cut: Likewise.
* tests/misc/ls-misc: Likewise.
* tests/misc/od: Likewise.
* tests/misc/stty-invalid: Likewise.
* tests/tr/Test.pm: Likewise.

17 years agoAdd a test for cp -p and existing file permissions.
Paul Eggert [Sat, 1 Dec 2007 09:10:52 +0000 (10:10 +0100)]
Add a test for cp -p and existing file permissions.

* tests/cp/Makefile.am (TESTS): Add existing-perm-race.
* tests/cp/existing-perm-race: New test.  It isn't much of a
test yet, since it's hard to catch the race, but it has a FIXME
that will let us do a better test later.

17 years agoFix a security race with "cp -p A B" when B already exists.
Paul Eggert [Sat, 1 Dec 2007 09:09:57 +0000 (10:09 +0100)]
Fix a security race with "cp -p A B" when B already exists.

* src/copy.h (struct cp_options): New member owner_privileges.
* src/copy.c (USE_ACL): Define to 0 if not defined, for convenience.
(owner_failure_ok): New function.
(set_owner): Avoid a security-related race by doing an extra chmod
first if it looks like there might be trouble right after a chown.
Accept a source struct stat rather than a uid and gid, and
accept a boolean NEW_DST and destination struct stat.
All callers changed.
* src/copy.h (cp_options_default): New function, replacing the
old chown_privileges.
* src/copy.c (cp_options_default): Likewise.
* src/cp.c (cp_option_init): Use it.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.

17 years agoAvoid a spurious test failure when build directory is set-GID.
Jim Meyering [Fri, 30 Nov 2007 16:05:07 +0000 (17:05 +0100)]
Avoid a spurious test failure when build directory is set-GID.

* tests/cp/fail-perm: Ensure that '.'s set-GID bit is off.

17 years agoBe extra careful to quote $abs_top_builddir-derived names.
Jim Meyering [Fri, 30 Nov 2007 12:45:38 +0000 (13:45 +0100)]
Be extra careful to quote $abs_top_builddir-derived names.

* tests/misc/ls-misc (shell_quote): New function.
Use it to quote file names derived from $abs_top_builddir,
in case it contains shell meta-characters.  This is not currently
needed, since CuTmpdir detects the fishy name and skips the test.
But it's important enough to add the extra protection.
Reported by Ralf Wildenhues.

17 years agoInclude test name in the "unsafe working directory name" diagnostic.
Jim Meyering [Fri, 30 Nov 2007 12:40:25 +0000 (13:40 +0100)]
Include test name in the "unsafe working directory name" diagnostic.

* tests/CuTmpdir.pm (import): If $ME is '-', use $prefix.

17 years agoAdd quotes to protect against white space in build dir name.
Ralf Wildenhues [Fri, 30 Nov 2007 11:14:57 +0000 (12:14 +0100)]
Add quotes to protect against white space in build dir name.

* tests/check.mk (TESTS_ENVIRONMENT): Quote $(abs_srcdir).
* tests/chmod/setgid: Quote absolute names.
* tests/misc/help-version: Likewise.
* tests/misc/pwd-unreadable-parent: Likewise.
* tests/rmdir/ignore: Likewise.
* tests/test-lib.sh: Likewise.

17 years agoDefine `tst', for CU_TEST_NAME.
Ralf Wildenhues [Fri, 30 Nov 2007 09:25:09 +0000 (10:25 +0100)]
Define `tst', for CU_TEST_NAME.

* build-aux/check.mk (am__check_pre): Set `tst', for
CU_TEST_NAME in tests/check.mk.

17 years ago* tests/CuTmpdir.pm (END): Do not do the cleanup if $dir is not
Ralf Wildenhues [Fri, 30 Nov 2007 07:53:38 +0000 (08:53 +0100)]
* tests/CuTmpdir.pm (END): Do not do the cleanup if $dir is not

defined, because it then goes wild and changes the mode of all
directories below $HOME.  Undefined $dir can happen if the test
is to be skipped because of an unsafe working directory name.

17 years agoClose a file descriptor leak when cp --preserve=context fails.
Paul Eggert [Thu, 29 Nov 2007 07:32:54 +0000 (08:32 +0100)]
Close a file descriptor leak when cp --preserve=context fails.

* src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon
or fsetfilecon fail.

17 years agoREADME: Document the known problem with gettext <= 0.17.
Jim Meyering [Wed, 28 Nov 2007 21:44:24 +0000 (22:44 +0100)]
README: Document the known problem with gettext <= 0.17.

17 years ago* gl/modules/randread (Depends-on): Remove nonexistent rand-isaac.
Paul Eggert [Wed, 28 Nov 2007 21:29:38 +0000 (22:29 +0100)]
* gl/modules/randread (Depends-on): Remove nonexistent rand-isaac.

17 years agoDon't block use of 'cat' or 'wc' in "make check".
Jim Meyering [Tue, 27 Nov 2007 18:50:27 +0000 (19:50 +0100)]
Don't block use of 'cat' or 'wc' in "make check".

* Makefile.maint (my-distcheck): Add "cat" and "wc" to the list
of programs that we can't blacklist.

17 years agoFix md5sum+sha*sum on sparc: regenerate files with latest autoconf.
Jim Meyering [Tue, 27 Nov 2007 18:26:25 +0000 (19:26 +0100)]
Fix md5sum+sha*sum on sparc: regenerate files with latest autoconf.

* configure et al: Regenerate with very latest version of autoconf
(v2.61a-312-gb524b0f), to fix md5sum and sha*sum miscompilation
on big-endian systems (like sparc) due to lack of the required
definition in of WORDS_BIGENDIAN in lib/config.h.

17 years agosetuidgid.c: more cleanup
Jim Meyering [Mon, 26 Nov 2007 15:34:58 +0000 (16:34 +0100)]
setuidgid.c: more cleanup
* src/setuidgid.c: Include "mgetgroups.h".
(main): Don't presume there's a fixed limit on the maximum number
of group IDs.  Don't use NGROUPS; it's artificially low.
Change the name of a local: s/gids_count/n_gids/.
Remove non-portable "const": s/const int tmp =.../int tmp =.../

17 years agoDocument install's -D option.
Jim Meyering [Sun, 25 Nov 2007 17:39:47 +0000 (18:39 +0100)]
Document install's -D option.

* doc/coreutils.texi (install invocation): Document -D.
Reported by Akim Demialle.

17 years agosetuidgid: Update --help output.
Jim Meyering [Sun, 25 Nov 2007 17:26:03 +0000 (18:26 +0100)]
setuidgid: Update --help output.

* src/setuidgid.c (usage): Describe -g GID[,GID1...] option.
Mention that USER may be a numeric ID or a user name.

17 years agoTweak new test.
Jim Meyering [Sat, 24 Nov 2007 09:57:05 +0000 (10:57 +0100)]
Tweak new test.

* tests/cp/preserve-gid: Split some long lines.
Prepend "+" to numeric uid and gid chown arguments, on principle.
Use skip_test_.

17 years agosetuidgid: minor clean-up.
Jim Meyering [Fri, 23 Nov 2007 12:36:01 +0000 (13:36 +0100)]
setuidgid: minor clean-up.

* setuidgid.c: Include "xstrtoul.h".
(main): Detect overflow in string-to-gid_t and -to-uid_t conversions.
Improve diagnostics.

17 years agosetuidgid.c: Normalize leading white space: no more TABs
Jim Meyering [Fri, 23 Nov 2007 12:30:28 +0000 (13:30 +0100)]
setuidgid.c: Normalize leading white space: no more TABs

17 years agoTest the new feature: cp -p preserves the GID whenever possible.
Lasse Collin [Fri, 23 Nov 2007 12:51:10 +0000 (13:51 +0100)]
Test the new feature: cp -p preserves the GID whenever possible.

* tests/cp/preserve-gid: New file.  Test for today's change.
* tests/cp/Makefile.am (TESTS): Add preserve-gid.
* tests/Makefile.am (all_t): Add tc.
(tc): New target.

17 years agosetuidgid: accept numeric UID, and new option -g GID,GID1,GID2,...
Lasse Collin [Thu, 22 Nov 2007 09:25:24 +0000 (11:25 +0200)]
setuidgid: accept numeric UID, and new option -g GID,GID1,GID2,...

* src/setuidgid.c: Add functionality for the new test above.

17 years ago"cp -p" tries to preserve GID even if preserving the UID fails.
Lasse Collin [Fri, 9 Nov 2007 23:07:37 +0000 (01:07 +0200)]
"cp -p" tries to preserve GID even if preserving the UID fails.

* NEWS: Mention this new feature.
* src/copy.c (set_owner): Try to preserve just the GID,
when initial fchown/lchown fails.
* src/cp.c (re_protect): Likewise.

17 years ago* src/runcon.c (main): Remove unused parameter, "envp".
Jim Meyering [Fri, 23 Nov 2007 08:03:23 +0000 (09:03 +0100)]
* src/runcon.c (main): Remove unused parameter, "envp".

17 years agoAdd tests to show new class of strings accepted by date -d.
Jim Meyering [Thu, 22 Nov 2007 21:44:51 +0000 (22:44 +0100)]
Add tests to show new class of strings accepted by date -d.

* tests/misc/date (rel-1day, rel-plus1): New tests for the recent
change in gnulib's getdate.y.
* NEWS: Mention the fix.

17 years agoQuiet warnings about unused parameters.
Jim Meyering [Thu, 22 Nov 2007 08:24:17 +0000 (09:24 +0100)]
Quiet warnings about unused parameters.

* src/copy.c (set_author) [!HAVE_STRUCT_STAT_ST_AUTHOR]:
"Use" each of the parameters.

17 years ago* GNUmakefile: Correct the "rerunning..." diagnostic.
Jim Meyering [Thu, 22 Nov 2007 07:44:38 +0000 (08:44 +0100)]
* GNUmakefile: Correct the "rerunning..." diagnostic.

17 years agoMake it easier to diagnose PATH-induced "make distcheck" failures.
Jim Meyering [Thu, 22 Nov 2007 07:42:32 +0000 (08:42 +0100)]
Make it easier to diagnose PATH-induced "make distcheck" failures.

* Makefile.maint (write_loser): Define.
(my-distcheck): Use an always-failing wrapper script, that gives
a diagnostic, not "false".
Run only "make -C tests check" with the restrictive PATH.
Run the new gnulib-tests/ with the usual PATH.

17 years agocp: by default, refuse to copy through a dangling destination symlink
Jim Meyering [Fri, 16 Nov 2007 08:31:15 +0000 (09:31 +0100)]
cp: by default, refuse to copy through a dangling destination symlink

* NEWS: Mention this change.
* doc/coreutils.texi (cp invocation): Describe the new behavior.
* src/copy.c: No longer include "canonicalize.h".
(copy_reg): Upon failure to open a dangling destination symlink, don't
canonicalize the name, but rather fail (default) or, with POSIXLY_CORRECT,
repeat the open call without O_EXCL (potentially dangerous).
* src/copy.h (struct cp_options) [open_dangling_dest_symlink]:
New member.  Reorder the others, grouping "bool" and "enum"
members together.
* tests/cp/thru-dangling: Test for changed and new behavior.
* src/cp.c (cp_option_init): Initialize new member.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
17 years agoFix Pádraig's name in ChangeLog.
Jim Meyering [Wed, 21 Nov 2007 21:13:17 +0000 (22:13 +0100)]
Fix Pádraig's name in ChangeLog.

17 years agoImprove the descriptions of the split command options.
Pádraig Brady [Wed, 21 Nov 2007 19:45:51 +0000 (20:45 +0100)]
Improve the descriptions of the split command options.

* doc/coreutils.texi (split invocation):

17 years ago* src/c99-to-c89.diff: Adjust seq.c offsets.
Jim Meyering [Wed, 21 Nov 2007 17:41:06 +0000 (18:41 +0100)]
* src/c99-to-c89.diff: Adjust seq.c offsets.

17 years ago* src/seq.c (print_numbers): Rewrite in an attempt to avoid the
Paul Eggert [Wed, 21 Nov 2007 17:37:08 +0000 (18:37 +0100)]
* src/seq.c (print_numbers): Rewrite in an attempt to avoid the

more-general rounding issues exposed by the previous patch.

17 years ago* src/c99-to-c89.diff: Adjust seq.c offsets.
Jim Meyering [Sun, 18 Nov 2007 20:20:37 +0000 (21:20 +0100)]
* src/c99-to-c89.diff: Adjust seq.c offsets.

17 years agoRemove unused parameter in remove.c.
Jim Meyering [Sun, 18 Nov 2007 20:19:33 +0000 (21:19 +0100)]
Remove unused parameter in remove.c.

* src/remove.c (fd_to_subdirp): Remove unused parameter.
(remove_cwd_entries, remove_dir): Update callers.

17 years agobootstrap: work also with 4-argument variant of AC_INIT (from gnulib)
Jim Meyering [Sun, 18 Nov 2007 10:55:45 +0000 (11:55 +0100)]
bootstrap: work also with 4-argument variant of AC_INIT (from gnulib)

2007-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>
* bootstrap (gnulib_extra_files): Adjust sed command.

17 years agoCorrect preceding patch.
Jim Meyering [Sat, 17 Nov 2007 09:04:07 +0000 (10:04 +0100)]
Correct preceding patch.

* src/seq.c (print_numbers): Also handle first < last && step < 0.
* tests/misc/seq [empty-rev]: New test for this case.

17 years ago"seq .1 .1" would mistakenly generate no output on some systems
Jim Meyering [Sat, 17 Nov 2007 08:39:42 +0000 (09:39 +0100)]
"seq .1 .1" would mistakenly generate no output on some systems

* NEWS: Say this.
* src/seq.c (print_numbers): Handle another floating point corner case.
This avoids failure of seq's eq-wid-7 test on FreeBSD 6.1.

17 years agoPort tests/rmdir/ignore away from GNU/Linux.
Paul Eggert [Fri, 16 Nov 2007 23:04:08 +0000 (00:04 +0100)]
Port tests/rmdir/ignore away from GNU/Linux.

* tests/rmdir/ignore: Don't assume that rmdir($PWD) will fail
with errno==ENOTEMPTY when $PWD is not empty; Posix also allows
rmdir to fail with errno==EBUSY.

17 years agoAvoid an obscure new "make distcheck" failure.
Jim Meyering [Fri, 16 Nov 2007 10:08:19 +0000 (11:08 +0100)]
Avoid an obscure new "make distcheck" failure.

* Makefile.maint (my-distcheck): Also allow 'mv', for its use
in gnulib-tests/Makefile.

17 years agoPort readlink-fp-loop to Solaris.
Paul Eggert [Fri, 16 Nov 2007 10:04:31 +0000 (11:04 +0100)]
Port readlink-fp-loop to Solaris.

* tests/misc/readlink-fp-loop (symlink_loop_msg): New var,
which records the symlink-loop message, whose wording is
not standardized by Posix.  Do not rely on "echo x > p/1"
to work when p/1 has a lot of indirect symlinks.  (I'm surprised
that it works on Linux.  Perhaps a Linux bug?)

17 years agoPort to Solaris 'make' and use a Posixish shell on Solaris.
Jim Meyering [Fri, 16 Nov 2007 10:03:03 +0000 (11:03 +0100)]
Port to Solaris 'make' and use a Posixish shell on Solaris.

* bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell.
* build-aux/check.mk (SHELL): Set to $(PREFERABLY_POSIX_SHELL),
so that commands can assume Posix syntax.
(ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax.
(SH_E_WORKAROUND): New macro.
(am__check_pre, $(TEST_SUITE_LOG)): Use it.
(am__check_pre): Fail if "mkdir" fails.  Use $(SHELL)
rather than relying on the "#!/bin/sh" in the file, so that tests
can use Posix syntax.
(am__check_pre, am__tty_colors): Use $$src rather than $$<, to
support the Posix-make $(TEST_LOGS) rule.
(%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules
that rely on a GNU Make extension and cause Solaris 'make' to fail.
(SUFFIXES): New macro, so that we can use Posix style inference rules.
(%.log: %): Use this rule only if GNU_MAKE.
Set $$src so that macros can use $$src rather than $$<.
(CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules,
which rely only on Posix 'make' semantics, and are used only with
non-GNU 'make' implementations.  $(TEST_LOGS) invokes 'make'
recursively (and a bit inefficiently) to simulate the GNU 'make'
rules.
(.log.html): Renamed from "%.html: %.log", so that it relies only
on Posix 'make' semantics.
(check-clean, .PHONY): Do not depend on check-clean-local, since
Solaris 'make' complains about nonexistent rules like that.
* src/Makefile.am (SUFFIXES): Remove; no longer needed.
(groups): Use a specific rule rather than an inference rule that
is only instantiated once.  The inference-rule approach does not
work with Solaris 'make', which gets confused by the "groups:
Makefile" line.  It's not clear from the Posix spec that Solaris
'make' is buggy here, so instead of worrying about it, rewrite
the makefile so that it clearly conforms to Posix.
* tests/check.mk (TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT.
GNU 'make' does this automatically for us, but Solaris 'make'
doesn't.

2007-11-15  Paul Eggert  <eggert@cs.ucla.edu>

17 years agoPort to Solaris 8 perl, which does not support "use warnings;".
Paul Eggert [Fri, 16 Nov 2007 08:35:54 +0000 (09:35 +0100)]
Port to Solaris 8 perl, which does not support "use warnings;".

* tests/dd/skip-seek: Skip test if "use warnings;" fails.
* tests/du/files0-from: Likewise.
* tests/misc/base64: Likewise.
* tests/misc/basename: Likewise.
* tests/misc/cut: Likewise.
* tests/misc/date: Likewise.
* tests/misc/dircolors: Likewise.
* tests/misc/dirname: Likewise.
* tests/misc/expand: Likewise.
* tests/misc/expr: Likewise.
* tests/misc/factor: Likewise.
* tests/misc/fmt: Likewise.
* tests/misc/fold: Likewise.
* tests/misc/head-elide-tail: Likewise.
* tests/misc/ls-misc: Likewise.
* tests/misc/md5sum: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/mktemp: Likewise.
* tests/misc/od: Likewise.
* tests/misc/paste-no-nl: Likewise.
* tests/misc/pr: Likewise.
* tests/misc/seq: Likewise.
* tests/misc/sha1sum: Likewise.
* tests/misc/sha1sum-vec: Likewise.
* tests/misc/sha224sum: Likewise.
* tests/misc/sha256sum: Likewise.
* tests/misc/sha384sum: Likewise.
* tests/misc/sha512sum: Likewise.
* tests/misc/sort-merge: Likewise.
* tests/misc/stat-printf: Likewise.
* tests/misc/sum: Likewise.
* tests/misc/test-diag: Likewise.
* tests/misc/tsort: Likewise.
* tests/misc/unexpand: Likewise.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/xstrtol: Likewise.
* tests/mv/i-1: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Likewise.

17 years ago* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix syntax error.
Andreas Schwab [Thu, 15 Nov 2007 13:06:12 +0000 (14:06 +0100)]
* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix syntax error.

Remove trailing space from result.

17 years agoAvoid misbehavior of a cross-device "mv" or "install".
Jim Meyering [Thu, 15 Nov 2007 12:04:13 +0000 (13:04 +0100)]
Avoid misbehavior of a cross-device "mv" or "install".

Those programs must not dereference a destination symlink.
* src/copy.c (copy_reg): Don't treat a dangling destination symlink
differently in move mode.  In move mode, the only way the added
O_EXCL can cause failure is when some other process has recreated
the file this code unlinked a few instructions before.

17 years agoAnother bootstrap kludge.
Jim Meyering [Wed, 14 Nov 2007 22:52:42 +0000 (23:52 +0100)]
Another bootstrap kludge.

* bootstrap: Ensure gnulib-tests/test-*.sh are executable

17 years agosrc/install.c (setdefaultfilecon): Stub-out the entire function.
Jim Meyering [Wed, 14 Nov 2007 22:34:19 +0000 (23:34 +0100)]
src/install.c (setdefaultfilecon): Stub-out the entire function.

17 years ago#ifdef-out matchpathcon-related code, for now.
Jim Meyering [Wed, 14 Nov 2007 21:36:10 +0000 (22:36 +0100)]
#ifdef-out matchpathcon-related code, for now.

* src/install.c (setdefaultfilecon): #ifdef-out all of the
matchpathcon-related code, until it's more efficient.

17 years agoUse gnulib's stpncpy module, now required by install.c
Jim Meyering [Wed, 14 Nov 2007 19:37:06 +0000 (20:37 +0100)]
Use gnulib's stpncpy module, now required by install.c

* bootstrap.conf (gnulib_modules): Add stpncpy.

17 years agoEnable gnulib-tool's --with-tests option.
Jim Meyering [Sat, 10 Nov 2007 17:33:07 +0000 (18:33 +0100)]
Enable gnulib-tool's --with-tests option.

* bootstrap: After all is done, transform the generated gnulib-tests/gnulib.mk.
* bootstrap.conf (gnulib_tool_option_extras): Set it here.
* gnulib-tests/Makefile.am: New file.
* Makefile.am (SUBDIRS): Add gnulib-tests.
* configure.ac (AC_CONFIG_FILES): Add gnulib-tests/Makefile.
* m4/jm-macros.m4 (coreutils_MACROS) [ARGMATCH_DIE_DECL]: Omit the
"extern " prefix to "void usage ()", so that the macro string value can
be used to construct a function definition in gnulib's test-argmatch.c.

17 years agoLikewise for description of cp -a in doc/coreutils.texi: s/-dpPR/-dpR/.
Benno Schulenberg [Mon, 12 Nov 2007 23:00:53 +0000 (00:00 +0100)]
Likewise for description of cp -a in doc/coreutils.texi: s/-dpPR/-dpR/.

17 years agoClarify description of cp's -a option.
Benno Schulenberg [Mon, 12 Nov 2007 18:13:32 +0000 (19:13 +0100)]
Clarify description of cp's -a option.

* src/cp.c (usage) [-a]: Remove unnecessary 'P'.
Since option -d of 'cp' includes the function of -P, mentioning the
latter in the description of option -a is redundant and therefore
slightly confusing, as the reader tries to figure out what it adds.

17 years agobootstrap: fix typo to enable use of $gnulib_tool_option_extras.
Jim Meyering [Sat, 10 Nov 2007 16:36:55 +0000 (17:36 +0100)]
bootstrap: fix typo to enable use of $gnulib_tool_option_extras.

* bootstrap (gnulib_tool_options): Add a space before the use
of $gnulib_tool_option_extras, so that it's separated from the
preceding argument.

Signed-off-by: Jim Meyering <meyering@redhat.com>
17 years agoinstall+SELinux: reduce a 12x performance hit to ~1.5x
Jim Meyering [Sat, 10 Nov 2007 16:31:31 +0000 (17:31 +0100)]
install+SELinux: reduce a 12x performance hit to ~1.5x

* src/install.c (setdefaultfilecon): Call matchpathcon_init_prefix,
to mitigate what would otherwise be a large performance hit due to
the use of matchpathcon.
Dan Walsh suggested the use of matchpathcon_init_prefix.
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.

Signed-off-by: Jim Meyering <meyering@redhat.com>
17 years agoAdapt to gnulib's s/jm_/gl_/ cache variable renaming.
Jim Meyering [Thu, 1 Nov 2007 17:35:04 +0000 (18:35 +0100)]
Adapt to gnulib's s/jm_/gl_/ cache variable renaming.

* configure.ac: Change the cache variable name prefix "jm_" to "gl_",
to match today's change in gnulib.

17 years agoFix bootstrap failure to handle files like lib/uniwidth/cjk.h.
Jim Meyering [Mon, 5 Nov 2007 17:06:38 +0000 (18:06 +0100)]
Fix bootstrap failure to handle files like lib/uniwidth/cjk.h.

* bootstrap (cp_mark_as_generated): Create any required parent
destination directories before copying a file into place.

17 years ago* src/c99-to-c89.diff: Adjust offsets.
Jim Meyering [Mon, 5 Nov 2007 13:57:09 +0000 (14:57 +0100)]
* src/c99-to-c89.diff: Adjust offsets.

17 years agoDon't use GNU-sed-specific \< \> operators here, either.
Jim Meyering [Mon, 5 Nov 2007 11:03:08 +0000 (12:03 +0100)]
Don't use GNU-sed-specific \< \> operators here, either.

* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Use a loop, as below.

17 years agoUse tighter regexps when performing name substitution.
Jim Meyering [Mon, 5 Nov 2007 10:05:55 +0000 (11:05 +0100)]
Use tighter regexps when performing name substitution.

* man/Makefile.am (mapped_name): Add ^ and $$ anchors.

Signed-off-by: Jim Meyering <meyering@redhat.com>
17 years agoDon't use GNU-sed-specific \< \> operators.
Jim Meyering [Mon, 5 Nov 2007 10:03:55 +0000 (11:03 +0100)]
Don't use GNU-sed-specific \< \> operators.

* configure.ac (MAN): Transform ginstall.1 to install.1 using
a loop, rather than sed with \<...\>.
Problem reported by Bruno Haible.
Andreas Schwab reminded me that \< and \> are not portable.