Commit Graph

485 Commits

Author SHA1 Message Date
Paul Eggert
a3b65a63a0 * src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
ls -x DIR would sometimes output the wrong string in place of the
first entry.
* NEWS: Mention the bug fix.
* tests/ls/x-option: New file.
* tests/ls/Makefile.am (TESTS): Add x-option.
2007-04-02 18:29:41 +02:00
Jim Meyering
a301ea6697 * NEWS: Mention these SELinux changes. 2007-03-30 16:02:54 +02:00
Jim Meyering
c3abd70c67 Post-release version change.
* NEWS: Add a line for 6.9+.
* configure.ac (AC_INIT): Set new version string.
2007-03-23 08:22:35 +01:00
Jim Meyering
804bdc3001 Version 6.9.
* NEWS: Record release date and new version number.
* configure.ac (AC_INIT): New version number.
2007-03-22 22:20:02 +01:00
Jim Meyering
553d347d3e Fix a bug in how pr -m -s works.
* NEWS: Describe how the fix affects pr.
* src/pr.c (init_parameters): The --merge (-m) option does
not imply --expand-tabs (-e), so don't set "untabify_input".
Reported by Wis Macomson.
* tests/misc/pr: New file.  Test for the above fix.
* tests/misc/Makefile.am (TESTS): Add pr.
* THANKS: Update.
2007-03-18 16:21:26 +01:00
Andrew Church
2871ad3b45 Fix a bug: cp -x would fail to set mount point permissions.
* NEWS: mention cp -x bug fix
* src/copy.c (copy_internal): Don't return immediately after
copying a mount point that we do not intend to recurse under.
Based on a patch by Andrew Church.
2007-03-03 23:00:18 +01:00
Paul Eggert
817d0261eb Make df -P immune to effects of e.g., the BLOCK_SIZE envvar.
* NEWS: With -P, the default block size and output format is not
affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE.
* src/df.c (main): Implement this.
* doc/coreutils.texi (df invocation): With -P, the default block size
and output format is not affected by DF_BLOCK_SIZE, BLOCK_SIZE, or
BLOCKSIZE.
2007-02-27 19:33:03 +01:00
Jim Meyering
9317cccb8f Post-release version change.
* NEWS: Add a line for 6.8+.
* configure.ac (AC_INIT): Set new version string.
2007-02-25 01:10:07 +01:00
Jim Meyering
cc2d4f6c46 Version 6.8.
* NEWS: Record release date and new version number.
* configure.ac (AC_INIT): New version number.
2007-02-24 21:16:52 +01:00
Jim Meyering
f92a08e171 * NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty".
Nicer connotations.
* configure.ac: Use 6.7+, not 6.7-dirty.
2007-02-24 13:13:45 +01:00
Paul Eggert
3ea177e3fa * NEWS: sort no longer compresses temporaries by default.
* bootstrap.conf: Remove findprog.
* doc/coreutils.texi (sort invocation): The default is to not
compress.  Don't treat "" specially.
* src/sort.c: Don't include findprog.h.
(create_temp): Compress only if the user specified --compress-program.
* tests/misc/sort-compress: Adjusts tests to match new behavior.
2007-02-24 12:24:27 +01:00
Paul Eggert
c363fcb9f0 * NEWS: sort now uses a --compress-program option rather than
an environment variable.
* doc/coreutils.texi (sort invocation): Document this.
* src/sort.c (usage): Likewise.
(COMPRESS_PROGRAM_OPTION): New const.
(long_options, create_temp, main): Support new option.
* tests/misc/sort-compress: Test it.
2007-02-19 22:11:18 +01:00
Jim Meyering
d282370566 Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
* NEWS: Mention the bug fix.
* tests/misc/pwd-unreadable-parent: New file.
* tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.
2007-02-03 20:02:48 +01:00
Paul Eggert
b28a8851ed * NEWS: Document fix for cp --preserve=mode.
* src/copy.c (copy_internal): Omit the group- or other-writeable
permissions when creating a directory, to avoid a race condition
if the special mode bits aren't right just after the directory is
created.
* src/cp.c (make_dir_parents_private): Likewise.
* tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
race fix in copy.c.
2007-02-03 18:45:46 +01:00
Paul Eggert
1c73876f5f * NEWS: Document fix for cp --parents.
* src/cp.c (make_dir_parents_private): Report the error sooner with
"cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
creating the directory, DEST/DIR.
* tests/cp/cp-parents: Test for the non-race-condition bug fixed
by the above change.
2007-02-03 18:12:11 +01:00
Paul Eggert
a0b2bc8de7 * NEWS: New option sort -C, proposed by XCU ERN 127, which looks
like it will be approved.  Also add --check=quiet, --check=silent
as long aliases, and --check=diagnose-first as an alias for -c.
* doc/coreutils.texi (sort invocation): Document this.
Also, mention that sort -c can take at most one file.
* src/sort.c: Implement this.
Include argmatch.h.
(usage): Document the change.
(CHECK_OPTION): New constant.
(long_options): --check now takes an optional argument, and is now
treated differently from 'c'.
(check_args, check_types): New constant arrays.
(check): New arg CHECKONLY, which suppresses diagnostic if -C.
(main): Parse the new options.
* tests/sort/Test.pm (02d, 02d, incompat5, incompat6):
New tests for -C.
2007-01-24 09:06:57 +01:00
Jim Meyering
1f7d56fda5 * NEWS: sort temp file compression: tweak wording.
* src/sort.c (struct sortfile) [name]: Declare member to be const.
2007-01-24 00:22:45 +01:00
Dan Hipschman
f33168da95 * src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
In pipe_fork callers, use these named constants, not "2" and "8".
(proctab, nprocs): Declare to be "static".
(pipe_fork) [lint]: Initialize local, pid,
to avoid unwarranted may-be-used-uninitialized warning.
(create_temp): Use the active voice.  Describe parameters, too.

2007-01-21  James Youngman  <jay@gnu.org>

Centralize all the uses of sigprocmask().  Don't restore an invalid
saved mask.
* src/sort.c (enter_cs, leave_cs): New functions for protecting
code sequences against signal delivery.
* (exit_cleanup): Use enter_cs and leave_cs instead of
calling sigprocmask directly.
(create_temp_file, pipe_fork, zaptemp): Likewise

2007-01-21  Dan Hipschman  <dsh@linux.ucla.edu>

Add compression of temp files to sort.
* NEWS: Mention this.
* bootstrap.conf: Import findprog.
* configure.ac: Add AC_FUNC_FORK.
* doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
variable.
* src/sort.c (compress_program): New global, holds the name of the
external compression program.
(struct sortfile): New type used by mergepfs and friends instead
of filenames to hold PIDs of compressor processes.
(proctab): New global, holds compressor PIDs on which to wait.
(enum procstate, struct procnode): New types used by proctab.
(proctab_hasher, proctab_comparator): New functions for proctab.
(nprocs): New global, number of forked but unreaped children.
(reap, reap_some): New function, wait for/cleanup forked processes.
(register_proc, update_proc, wait_proc): New functions for adding,
modifying and removing proctab entries.
(create_temp_file): Change parameter type to pointer to file
descriptor, and return type to pointer to struct tempnode.
(dup2_or_die): New function used in create_temp and open_temp.
(pipe_fork): New function, creates a pipe and child process.
(create_temp): Creates a temp file and possibly a compression
program to which we filter output.
(open_temp): Opens a compressed temp file and creates a
decompression process through which to filter the input.
(mergefps): Change FILES parameter type to struct sortfile array
and update access accordingly.  Use open_temp and reap_some.
(avoid_trashing_input, merge): Change FILES parameter like
mergefps and call create_temp instead of create_temp_file.
(sort): Call create_temp instead of create_temp_file.
Use reap_some.
(avoid_trashing_input, merge, sort, main): Adapt to mergefps.
2007-01-24 00:00:21 +01:00
Jim Meyering
0928c2414a Make "rm --interactive=never ..." never prompt.
* NEWS: Mention this.
* src/remove.h (enum rm_interactive): New ternary type.
(struct rm_options) [interactive]: Use it, here -- rather than bool.
* src/remove.c (prompt): Reflect type change.
* src/mv.c (rm_option_init): Initialize to RMI_NEVER now.
* src/rm.c (main): Add a FIXME comment for '-d' option.
Adapt to type change of rm_options.interactive.

* tests/rm/i-never: New file.  Test for the above fix.
* tests/rm/Makefile.am (TESTS): Add i-never.
2007-01-17 17:15:20 +01:00
Paul Eggert
f0b5e513d9 Now, "ls -FRL" always follows symbolic links on Linux.
* NEWS: Mention this bug fix.
* src/ls.c (gobble_file): Fix bug reported by
Nobuyuki Tsuchimura in
http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html
where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
* tests/ls/follow-slink: Add a test for this case.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-02 07:27:22 +01:00
Paul Eggert
f24ff8f42b * NEWS: dd bs= operands now silently override later ibs= and obs=,
as POSIX requires.
* src/dd.c (scanargs): Implement it.
* tests/dd/misc (outbytes): Test it.
* doc/coreutils.texi (dd invocation): Specify that bs=N
overrides later ibs and obs, undoing part of the
previous change.  (The behavior was wrong.)
2006-12-22 10:09:37 +01:00
Jim Meyering
c8ef95eaed "rm -rf /etc/motd" (run by non-root) now prints a diagnostic.
* src/remove.c (remove_entry): Handle EACCES for a non-directory, too.
Karl Berry reported that a cross-partition "mv /etc/issue ~"
failed with the um,... suboptimal diagnostic,
"mv: cannot remove `/etc/issue': Not a directory".
* tests/rm/Makefile.am (TESTS): Add fail-eacces.
* tests/rm/fail-eacces: New file.
* NEWS: Mention that both mv and rm are affected.
2006-12-21 08:58:11 +01:00
Jim Meyering
d69fc66d81 "cut -f 2- A B" no longer triggers a double-free bug
* src/cut.c (cut_fields): Set file-scoped global to NULL after
freeing it.  This avoids a double-free (and core dump on some systems)
for this usage: "echo 1>a; echo 2>b; cut -f2- a b".  Reported by
James Hunt in <http://bugzilla.redhat.com/220312>.
* NEWS: List this bug fix.
* THANKS: Mention him.
* tests/misc/cut: New file.
* tests/misc/Makefile.am (TESTS): Add cut.
2006-12-20 14:25:55 +01:00
Jim Meyering
24852bf5b5 * NEWS: --preserve-root now works with chgrp, chmod, and chown.
* src/chmod.c (process_file): Do honor the --preserve-root option.
* src/chown-core.c (change_file_owner): Likewise, but here, also
handle the case in which a traversal would go "through" a symlink
to root.  Reported by Matthew M. Boedicker
* tests/chown/preserve-root: Test for the above.
* tests/chown/Makefile.am (TESTS): Add preserve-root.
2006-12-14 11:14:25 +01:00
Jim Meyering
629214eaf8 * NEWS: Mention the chmod fix induced by the recent change to gnulib's openat.m4. 2006-12-14 00:22:50 +01:00
Jim Meyering
0473e718e6 * NEWS: With the change from "-pre" to "-dirty" suffix, also change
from NEXT_VER-pre to CUR_VER-dirty.  So, this is 6.7-dirty.
* configure.ac (AC_INIT): s/6.8-dirty/6.7-dirty/.
2006-12-09 15:57:06 +01:00
Jim Meyering
07af816554 Post-release version change.
* NEWS: Add a line for 6.8-dirty.
* configure.ac (AC_INIT): Set new version string.
2006-12-08 08:28:04 +01:00
Jim Meyering
f044d2d51c Version 6.7.
* NEWS: Record release date.  Remove '-pre' suffix.
* configure.ac (AC_INIT): Remove version string suffix.
2006-12-08 00:03:00 +01:00
Paul Eggert
fc92148eac cp -p now clears special bits if it fails to preserve owner or group
* NEWS: Document the cp -p fix for special bits.
* src/copy.c (set_owner): Now returns a three-way result, so
that the caller can clear the special bits.  All callers changed.
(copy_reg): Don't set the special bits if chown failed.
(copy_internal): Likewise.
* tests/cp/special-bits: Test this fix.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-07 08:10:35 +01:00
Paul Eggert
a4f7b723f0 * NEWS: Document the cp --preserve=ownership fix.
* m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod.
* src/copy.c (fchmod_or_lchmod): New function.
(copy_reg): New arg OMITTED_PERMISSIONS.  All uses changed.
Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT.
When creating a file, use O_EXCL, so we're more likely to detect
funny business by other processes.  At the end, if permissions
were omitted, chmod them back in.
(copy_internal): If the ownership might change, omit some permissions
at first, then restore them after chowning the file.
* src/cp.c (make_dir_parents_private): Likewise.
* src/copy.c (cached_umask): New function.
* src/copy.h (cached_umask): New decl.
2006-12-06 20:44:08 +01:00
Jim Meyering
545df07893 NEWS: the du bug affects coreutils-6.4, 6.5 and 6.6. 2006-12-06 13:18:43 +01:00
Jim Meyering
ba45154d8e * NEWS: du --one-file-system (-x) would skip subdirectories of any
directory listed as second or subsequent command line argument.
* tests/du/one-file-system: New file.  Test for today's fts.c fix.
* tests/du/Makefile.am (TESTS): Add one-file-system.
2006-12-03 11:17:35 +01:00
Jim Meyering
e750c5cac8 Post-release version change.
* NEWS: Add a line for 6.7-pre.
* configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix.
2006-11-22 16:15:02 +01:00
Jim Meyering
46710dd82a Version 6.6.
* NEWS: Record release date.  Remove "-pre" suffix.
* configure.ac (AC_INIT): Remove "-pre" suffix from version string.
2006-11-22 12:40:57 +01:00
Jim Meyering
b076de8551 * NEWS: Mention the three noteworthy changes, all fixed via gnulib. 2006-11-22 10:14:15 +01:00
Jim Meyering
318fb0502d Post-release version change.
* NEWS: Add a line for 6.6-pre.
* configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix.
2006-11-19 19:44:23 +01:00
Jim Meyering
497a5cf465 Version 6.5.
* NEWS: Record release date.  Remove "-cvs" suffix.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2006-11-19 10:58:55 +01:00
Jim Meyering
1efc5bda6c "ln --backup f f" now produces a sensible diagnostic 2006-11-18 20:19:16 +01:00
Jim Meyering
597bfeb851 * NEWS: Mention this bug fix. 2006-11-12 19:13:32 +01:00
Jim Meyering
5e42576c01 new feature: rm accepts new option: --one-file-system
Suggested by Steve McIntyre in <http://bugs.debian.org/392925>.
* src/remove.h (struct rm_options) [one_file_system]: New member.
* src/rm.c (rm_option_init): Initialize it.
(usage): Document the option.
* src/mv.c (rm_option_init): Likewise.
* src/remove.c (remove_dir): With --one-file-system and --recursive,
for each directory command line argument, do not affect a file system
different from that of the starting directory.  And give a diagnostic.
* src/rm.c (ONE_FILE_SYSTEM): New enum.
(main): Handle new option.
* tests/rm/one-file-system: Test the above.
* tests/rm/Makefile.am (TESTS): Add one-file-system.
* tests/Makefile.am (check-root): Add the rm/one-file-system
test to the list.
(EXTRA_DIST): Add other-fs-tmpdir.

* tests/mv/setup: Removed.  Renamed to...
* tests/other-fs-tmpdir: ...this new file.
* tests/mv/Makefile.am (EXTRA_DIST): Remove setup.
* tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir.
* tests/mv/backup-is-src: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/part-hardlink: Likewise.
* tests/mv/part-rename: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/partition-perm: Likewise.
* tests/mv/to-symlink: Likewise.
* tests/mv/into-self-2: Likewise.

[doc/ChangeLog]
* coreutils.texi (rm invocation): Describe --one-file-system.
2006-10-25 00:01:33 +02:00
Jim Meyering
0fdbf2e8c7 * NEWS: Add a line for 6.5-cvs.
* configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix.
2006-10-23 07:59:04 +02:00
Jim Meyering
7054512f14 Remove -cvs suffix here, too. 2006-10-22 23:41:05 +02:00
Jim Meyering
0c0121ed20 Version 6.4.
* NEWS: Record the 6.4 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2006-10-22 22:21:26 +02:00
Jim Meyering
b1289b8716 * NEWS: (cp --backup fix): Fix a typo. 2006-10-22 18:59:58 +02:00
Jim Meyering
0dc7f78986 * NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2
to dir1/dir2~.
* src/copy.c (copy_internal): Although we do create a backup of each
destination directory when in move mode, don't do that when copying.
Reported by Peter Breitenlohner, in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8616>.
* tests/cp/backup-dir: New file.  Test for the above.
2006-10-14 05:20:27 +00:00
Jim Meyering
f2c088fa10 * NEWS: Mention the above. 2006-10-13 19:05:07 +00:00
Paul Eggert
2983bf7c85 * NEWS: Fix typo: iso-8602 -> iso-8601. Problem reported by
Bob Proulx.
2006-10-09 20:38:56 +00:00
Jim Meyering
1d4ac49f9d * NEWS: Update here, too. 2006-10-03 22:07:36 +00:00
Jim Meyering
da9541f18e With --force (-f), rm no longer fails for ENOTDIR.
* src/remove.c (ignorable_missing): New function.
Use it everywhere, rather than open-coding the test.
Andreas Schwab reported the ENOTDIR problem.
(ignorable_missing): Similarly, don't fail for ENAMETOOLONG.
* NEWS: Mention the bug fix.
* tests/rm/ignorable: New file.  Test for the ENOTDIR case.
* tests/rm/ignore-name-too-long: New file. Test for ENAMETOOLONG.
* tests/rm/Makefile.am (TESTS): Add the new file names.
2006-10-03 13:13:09 +00:00
Jim Meyering
d2e7358a9b * NEWS: Add a line for 6.4-cvs.
* configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix.
2006-10-02 11:47:48 +00:00