summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2007-01-03* src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.Bruno Haible
Needed on MacOS X. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-02Now, "ls -FRL" always follows symbolic links on Linux.Paul Eggert
* 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>
2006-12-30* src/c99-to-c89.diff: Adjust remove.c offsets.Jim Meyering
2006-12-30Clean up after the change of 2006-12-28.Jim Meyering
* src/remove.c (AD_pop_and_chdir): Change **DIRP parameter to *DIRP, now that this function never modifies the pointer. Adjust comments and code accordingly. (remove_dir): Set "dirp" to NULL right after AD_pop_and_chdir call, now that AD_pop_and_chdir no longer does that.
2006-12-30* src/copy.c (copy_reg): Rewrite a comment that was renderedJim Meyering
inaccurate by the 2006-10-18 change.
2006-12-28When moving "up" the hierarchy, be careful to remove a just-emptiedJim Meyering
directory before opening ".", to avoid trouble with file system implementations that cache readdir results at opendir-time. * src/remove.c (AD_pop_and_chdir): Add a file descriptor parameter. Don't update **DIRP. Don't call fdopendir here. (remove_dir): Call fdopendir here instead. Report and patch from Mikulas Patocka: <http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00170.html>
2006-12-27* src/tail.c (usage): Mention +N for --bytes and --lines.Jim Meyering
Suggestion from Evan Hunt.
2006-12-22* NEWS: dd bs= operands now silently override later ibs= and obs=,Paul Eggert
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-21"rm -rf /etc/motd" (run by non-root) now prints a diagnostic.Jim Meyering
* 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-20"cut -f 2- A B" no longer triggers a double-free bugJim Meyering
* 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-14chgrp, chown: Don't prohibit -RLh, aka -RL with --no-dereference.Jim Meyering
* src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference. * src/chown.c (main): Likewise. * src/chown-core.c (change_file_owner): Add to a comment. * tests/chown/preserve-root: Add tests. * doc/coreutils.texi (Treating / specially): With --preserve-root, chgrp and chown will not modify "/", even through a symlink.
2006-12-14* NEWS: --preserve-root now works with chgrp, chmod, and chown.Jim Meyering
* 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-13Remove some arbitrary restrictions on size fields,Paul Eggert
so that commands like "sort -k 18446744073709551616" no longer fail merely because 18446744073709551616 doesn't fit in uintmax_t. The trick is that these fields can all be treated as effectively infinity; their exact values don't matter, since no internal buffer can be that long. * src/join.c (string_to_join_field): Verify that SIZE_MAX <= ULONG_MAX if the code assumes this. Silently truncate too-large values to SIZE_MAX, as the remaining code will do the right thing in this case. * src/sort.c (parse_field_count): Likewise. * src/uniq.c (size_opt, main): Likewise. * tests/join/Test.pm (bigfield): New test. * tests/sort/Test.pm (bigfield): New test. * tests/uniq/Test.pm (121): New test. Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-12* src/system.h (SETVBUF): Remove definition, now that theJim Meyering
autoconf macro, AC_FUNC_SETVBUF_REVERSED, does nothing. * src/tee.c (tee_files): s/SETVBUF/setvbuf/. * src/od.c (open_next_file): Likewise.
2006-12-07cp -p now clears special bits if it fails to preserve owner or groupPaul Eggert
* 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-06* NEWS: Document the cp --preserve=ownership fix.Paul Eggert
* 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-04install.c: Preserve time stamps before changing owner or file mode bits,Paul Eggert
for consistency with other coreutils programs.
2006-11-27* Makefile.maint (patch-check): Rewrite to diagnose failure.Jim Meyering
* src/c99-to-c89.diff: Adjust shred.c offsets.
2006-11-27Improve the check for departures from C89, and fix the departuresPaul Eggert
I found. * Makefile.maint (my-distcheck): Also check for C89 compatibility as best we can with GCC. * src/stat.c (PRINTF_OPTION): Omit comma before } in enum declaration; C89 doesn't allow this. * src/dcgen: Don't generate string literals longer than what C89 requires support for. * src/cut.c (usage): Don't use string literals longer than what C89 requires support for. * src/date.c (usage): Likewise. * src/dd.c (usage): Likewise. * src/du.c (usage): Likewise. * src/ls.c (usage): Likewise. * src/od.c (usage): Likewise. * src/readlink.c (usage): Likewise. * src/seq.c (usage): Likewise. * src/shred.c (usage): Likewise.
2006-11-27recognize new archive, audio, image formats; give audio files a separate colorMike Frysinger
* src/dircolors.hin: Add comments for common .sh and .csh scripts. Add .bz2, .tbz2, .tz, .rar, .ace, .zoo, .cpio, .7z, .rz as archive suffixes. Add .mng, .pcx, .m2v, .mkv, .ogm, .mp4, .m4v, .mp4v, .vob, .qt, .nuv, .wmv, .asf, .rm, .rmvb, .flc, .yuv as image formats. Add .aac, .au, .mid, .midi, .mka, .ra as audio suffixes. Change audio color to 00;36 to differentiate from image/video color.
2006-11-26* src/c99-to-c89.diff: Remove 3 bogus hunks.Jim Meyering
2006-11-26* src/remove.c (fd_to_subdirp): Remove unused parameter, ds.Jim Meyering
Update callers.
2006-11-26* src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c.Jim Meyering
2006-11-26* src/rm.c (main): Remove unnecessary (assuming C99) braces.Jim Meyering
2006-11-26Port parts of the code to C89 to minimize the need for c99-to-c89.diff,Paul Eggert
while trying to retain the readability of C99 as much as possible. * src/remove.c (close_preserve_errno): Remove. (fd_to_subdirp): Rewrite to avoid the need for decl after statement. Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26* src/remove.c (rm): Move cycle_check_init call into callee...Paul Eggert
Use an else clause in place of a "continue" statement. Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26* src/remove.c (AD_ensure_initialized): New function.Paul Eggert
after statement. Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26* src/remove.c (AD_pop_and_chdir): Return prev_dir rather than storing throughPaul Eggert
a pointer argument. All uses changed. Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26* src/remove.c (cache_stat_init): Return its argument, for convenience.Paul Eggert
Update the caller in remove_dir. Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26* src/remove.c (rm_1): Remove decl of local, fd_cwd.Paul Eggert
Replace each of two uses with literal AT_FDCWD. Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-18"ln --backup f f" produces a misleading diagnostic:Jim Meyering
ln: creating hard link `f' => `f': No such file or directory * src/ln.c (do_link): Give a better diagnostic in this unusual case. (do_link): Rename local: s/lstat_ok/dest_lstat_ok/. * tests/ln/Makefile.am (TESTS): Add hard-backup. * tests/ln/hard-backup: New test for the above.
2006-11-16* bootstrap.conf (gnulib_modules): Add sys_stat, since we use it directly too.Paul Eggert
* lib/.cvsignore, lib/.gitignore: Add root-dev-ino.c, root-dev-ino.h. * m4/.cvsignore, m4/.gitignore: Add root-dev-ino.m4. * src/ls.c (DIRED_FPUTS_LITERAL, PUSH_CURRENT_DIRED_POS): Omit unnecessary parenthesization of args. * src/od.c (EQUAL_BLOCKS): Likewise. * src/system.h (STREQ, ASSIGN_STRDUPA): Likewise.
2006-11-16* src/csplit.c (load_buffer): Plug an inconsequential leak.Jim Meyering
2006-11-16Help valgrind see that there is no leak in dd.c.Jim Meyering
* src/dd.c (dd_copy): Declare real_buf and real_obuf to be static, so we need not free them at all. This is easier than freeing both buffers at each of the early "return"s.
2006-11-13* src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment.Jim Meyering
From Paul Eggert.
2006-11-13Plug another technically-unimportant leak in sort.Jim Meyering
* src/sort.c (main): Don't allocate memory for each new key here. (insertkey): Allocate memory for each key here, instead. (key_init): Rename from new_key. Don't allocate.
2006-11-13* src/sort.c (main): Plug a tiny memory leak.Jim Meyering
Move declaration of local "minus" down to be nearer point of use.
2006-10-28* src/c99-to-c89.diff: Update to reflect new offsets in rm.c.Jim Meyering
2006-10-26* src/system.h (ftello): Add a compile-time check for the highlyJim Meyering
unlikely condition of off_t narrower than long int, rather than handling it at run time. Based on a patch from Paul Eggert.
2006-10-25Portability to Tru64 V4.0.Jim Meyering
* src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]: Define inline replacement function. This (along with a yesterday's fix for autoconf's _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils now builds once more on Tru64 V4.0. Reported by Nelson Beebe.
2006-10-25* src/cat.c (infile): Add "const" to declaration.Jim Meyering
* src/csplit.c (prefix): Likewise. * src/printf.c (cfcc_msg): Likewise. * src/tail.c (valid_file_spec): Likewise. * src/cut.c (cut_file): Likewise, for a parameter. * src/expr.c (str_value): Likewise. * src/fold.c (fold_file): Likewise. * src/pr.c (init_header): Likewise. * src/dircolors.c (dc_parse_stream): Likewise, for a local. * src/tr.c (make_printable_str): Likewise. * src/nl.c (body_type, header_type, footer_type, current_type): (separator_str, build_type_arg, nl_file): Likewise, for many. * src/paste.c (main): Don't assign a read-only string to 'optarg'. * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
2006-10-25* src/c99-to-c89.diff: Update to reflect new offsets.Jim Meyering
2006-10-25new feature: rm accepts new option: --one-file-systemJim Meyering
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-21* .gitignore: Remove some references to files in subdirectories.Jim Meyering
* build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files. * m4/.gitignore, po/.gitignore, src/.gitignore: Likewise.
2006-10-21* src/copy.c (copy_internal): Add a comment saying why we preferJim Meyering
mknod over mkfifo.
2006-10-20Enable an fts optimization (call lstat only for directories,Jim Meyering
on some file system types) also with the --preserve-root option of chown or chgrp. * src/chown-core.c (change_file_owner): Compare fts_statp-based dev/ino against root dev/ino only for directories. (chown_files): Don't let the root_dev_ino setting influence whether we use FTS_NOSTAT: fts always sets *fts_statp for a directory.
2006-10-20* src/od.c (usage): Change description of default to use "-w16",Jim Meyering
not the now-invalid "-w 16" syntax. From Dan Jacobson.
2006-10-19* src/copy.c (copy_reg): Rewrite slightly to avoid duplicte codePaul Eggert
when opening dst_name. (copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain (SYSCALL) to test for failure in a system call.
2006-10-18* src/copy.c (copy_internal): Use mknod rather than mkfifo to copyPaul Eggert
a fifo. This preserves the special mode bits on Solaris 10, which is compatible with what Solaris 10 cp -R does.
2006-10-18* src/copy.c (copy_internal): Remove redundant and confusing localPaul Eggert
variable src_type.