summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-11-17build: update gnulib for Solaris 10 unsetenv work-aroundJim Meyering
2009-11-17doc: mention the du/fts vs. NFSv4 mount-point work-aroundJim Meyering
* NEWS (Changes in behavior): Mention it.
2009-11-17build: update from gnulib for (un)setenv fixesJim Meyering
2009-11-16build: update gnulib submodule to latestJim Meyering
2009-11-16true, false: perform initialization only when argc == 2Jim Meyering
* src/true.c (main): There is no reason to examine argv[0], call atexit, etc., in the usual case in which we're about to exit. This has the side effect of making it so that these programs no longer segfault when subjected to execve abuse. Before this change, these commands would make "true" segfault: printf '%s\n' '#include <unistd.h>' 'int main(int c, char**v)' \ '{ execve (v[1], 0, 0); }' > k.c && gcc k.c && ./a.out $PWD/true Now it succeeds. Reported by Tetsuo Handa and Bart Van Assche via Ondřej Vašík in http://bugzilla.redhat.com/537684.
2009-11-16tail -F can fail to track a file after it's been rotatedJim Meyering
Tailing forever and by-name (--follow=name, -F), tail would sometimes fail to follow a file that had been removed via rename. If you can't apply this patch and have tail 7.6 or newer, you can work around the bug via the undocumented --disable-inotify option. * src/tail.c (tail_forever_inotify): When tailing by name (-F), do not un-watch a file upon receipt of the IN_MOVE_SELF event. Reported by Arjan Opmeer in http://bugs.debian.org/548439. * NEWS (Bug fixes): Mention it. Also see http://marc.info/?l=coreutils-bug&m=125829031916515 * tests/Makefile.am (TESTS): Add tail-2/inotify-rotate. * tests/tail-2/inotify-rotate: New test.
2009-11-14tests: help-version: exit nonzero when $built_programs is emptyJim Meyering
* tests/misc/help-version: Use "Exit 1", rather than "Exit $fail" with fail defined to 0 when $built_programs is empty.
2009-11-14build: do use AM_GNU_GETTEXT's "need-formatstring-macros" optionJim Meyering
* configure.ac: Revert commit 49741b61 and add a comment. Reported by Eric Blake.
2009-11-14tests: avoid a spurious failure on a loaded systemPádraig Brady
* tests/misc/timeout-parameters: This test could fail due to the 1-second timeout expiring before a command of "no_such" could be exec'd and fail. Increase to 10 seconds.
2009-11-13build: require gettext-0.17Jim Meyering
* configure.ac: Require gettext-0.17; it was released two years ago.
2009-11-13build: correct gettext configure-time supportJim Meyering
* configure.ac: Use AM_GNU_GETTEXT([external], [need-ngettext]), rather than AM_GNU_GETTEXT([external], [need-formatstring-macros]). Reported by Martin Jacobs in http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3181 * THANKS: Add his name.
2009-11-13build: update gnulib to latest, for fixed test-getgroups.cJim Meyering
2009-11-13tests: avoid a spurious timeout on a heavily-loaded systemJim Meyering
* tests/misc/timeout-parameters: This test would fail due to the 1-second timeout expiring before a command of "." could be exec'd and fail. Increase to 10 seconds.
2009-11-13build: update gnulib, for getgroups improvementsEric Blake
A replacement getgroups is now guaranteed to exist, but it may fail with ENOSYS. mgetgroups is moved to gnulib, and now takes gid_t instead of GETGROUPS_T (but setgroups still needs GETGROUPS_T). * gnulib: Update to latest. * gl/modules/mgetgroups: Delete, moved to gnulib. * gl/m4/mgetgroups.m4: Likewise. * gl/lib/mgetgroups.h: Likewise. * gl/lib/mgetgroups.c: Likewise. * src/group-list.c (print_group_list): Adjust callers. * src/id.c (print_full_info): Likewise.
2009-11-12build: bootstrap: add a comment; generalize autoheader checkJim Meyering
* bootstrap: Sync from gnulib and diff.
2009-11-12build: update gnulib to latest; more *BSD and Solaris work-aroundsJim Meyering
2009-11-11bootstrap: use git_modules_config in one more placeJim Meyering
* bootstrap: Make bootstrap's --gnulib-srcdir more useful (for testing).
2009-11-10doc: fix typoEric Blake
* doc/coreutils.texi (mktemp invocation): Quote shell variable.
2009-11-09build: update gnulib submodule to latest for its FreeBSD fixesJim Meyering
2009-11-09ls: fix capability coloringPádraig Brady
Capability checking was incorrectly done on just the base name rather than on the whole path. Consequently there could be both false positives and negatives when coloring files with capabilities. Also capability checking was not done at all in certain cases for non executable files. Note passing absolute rather than relative names to cap_get_file() reduces the has_capability() overhead from around 33% to 30%. I.E. ls --color is now around 3% faster. * src/ls.c (struct fileinfo): Add a has_capability member. (print_color_indicator): Refactor to pass just a fileinfo pointer and a flag to say if we're dealing with a symlink target. (print_name_with_quoting): Likewise. (gobble_file): Set has_capability in the fileinfo struct. Also do a capability check even if executable coloring is disabled. Ditto for SETUID and SETUID coloring. Comment on how expensive has_capability() is. (print_long_format): Adjust to refactored print_name_with_quoting. (quote_name): Likewise. (print_file_name_and_frills): Likewise. * tests/ls/capability: Test the various false positive and negatives. * THANKS: Add reporter (Ivan Labath). * NEWS: Mention the fix.
2009-11-07build: consistently use freopen-saferEric Blake
cat, head, ptx, shuf, tac, tail, tee, tr, and uniq used freopen on stdout, and were potentially vulnerable. dircolors, du, and tsort only used it on stdin, which is unaffected by freopen_safer, but this covers all uses for consistency. * cfg.mk (sc_require_stdio_safer): New rule. * gl/modules/xfreopen (Depends-on): Add freopen-safer. * gl/lib/xfreopen.c (includes): Use stdio--.h. * src/ptx.c (includes): Likewise. * src/shuf.c (includes): Likewise. * src/uniq.c (includes): Likewise. * src/dircolors.c (includes): Likewise. * src/du.c (includes): Likewise. * src/tsort.c (includes): Likewise.
2009-11-07mktemp: fix bug with -q and closed stdoutEric Blake
If stdin or stdout is closed, then freopen(,stderr) can violate the premise that STDERR_FILENO==fileno(stderr), which in turn breaks mktemp -q. * bootstrap.conf (gnulib_modules): Add freopen-safer. * src/mktemp.c (includes): Use stdio--.h. * tests/misc/close-stdout: Enhance test to catch bug.
2009-11-07maint: make du's cycle-detection code consistentJim Meyering
* src/du.c (process_file): Revert the du.c-changing part of commit 8ba5d1a7. Use cycle_warning_required instead.
2009-11-07chcon, chgrp, chmod and chown now diagnose a directory cycleJim Meyering
* lib/xfts.c (cycle_warning_required): New function. * lib/xfts.h: Declare it. * src/chown-core.c (change_file_owner): Diagnose a cycle. * src/chmod.c (process_file): Likewise. * src/chcon.c (process_file): Likewise. * NEWS (Bug fixes): Mention this.
2009-11-06nproc: A new program to count the available processorsGiuseppe Scrivano
* AUTHORS: Add my name. * NEWS: Mention it. * README: Likewise. * bootstrap.conf (gnulib_modules): Add nproc. * doc/coreutils.texi (nproc invocation): Add nproc info. * man/Makefile.am (nproc.1): Add dependency. * man/nproc.x: New template. * man/.gitignore: Ignore generated man page. * po/POTFILES.in: Add src/nproc.c. * src/.gitignore: Exclude nproc. * src/Makefile.am (EXTRA_PROGRAMS): Add nproc. * src/nproc.c: New file. * tests/Makefile.am (TESTS): Add misc/nproc-{avail,positive}. * tests/misc/nproc-avail: New file. * tests/misc/nproc-positive: New file.
2009-11-06build: move do-release-commit-and-tag to gnulibJim Meyering
* bootstrap.conf (gnulib_modules): Add do-release-commit-and-tag. * build-aux/do-release-commit-and-tag: Remove file. Now it's in gnulib. * gnulib: Update submodule to the latest, to get the just-moved script.
2009-11-05mktemp: use more robust means to avoid double-close of stdoutEric Blake
Reverts earlier patch - fflush() can succeed but fclose() fail for some cases of write failures, and we want to catch those. * src/mktemp.c (stdout_closed): New variable. (maybe_close_stdout): New function, borrowed from dd.c. (main): Track whether stdout has been closed.
2009-11-05mktemp: enhance test to catch just-fixed typo behaviorEric Blake
Penance for botching the conflict resolution while rebasing my series. * tests/misc/mktemp (check_tmp): Test for the bug when wrong parameter is used.
2009-11-05mktemp: don't try to close stdout twiceJim Meyering
* src/mktemp.c (main): Rather than calling close_stream (which would make atexit-called close_stdout try to close it a second time), check for write failure via ferror and fflush.
2009-11-05mktemp: don't use suff_len in place of #-of-`X's variableJim Meyering
* src/mktemp.c (mkstemp_len, mkdtemp_len): Pass x_len as final argument, and not suff_len.
2009-11-05mktemp: add suffix handlingEric Blake
Now that mkstemps is supported, we might as well use it. * src/mktemp.c (TMPDIR_OPTION): New enum value. (longopts): Add new option. (usage): Document it. (count_trailing_X_s): Rename... (count_consecutive_X_s): ...to this, and add parameter. (mkstemp_len, mkdtemp_len): Add parameter. (main): Implement new option. (AUTHORS): Add myself. * AUTHORS (mktemp): Likewise. * tests/misc/mktemp: Test new option. * doc/coreutils.texi (mktemp invocation): Document it. * NEWS: Likewise. Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548316.
2009-11-05build: reflect gnulib changes to tempnameEric Blake
In glibc 2.11 and gnulib, gen_tempname added a parameter suffixlen (unfortunately, it is typed as int rather than size_t, for historical compatibility to a poor choice by BSD). * gnulib: Import latest changes. * gl/lib/tempname.h.diff: Accommodate new suffixlen parameter. * gl/lib/tempname.c.diff (check_x_suffix): Allow for X in suffix beyond x_suffix_len. (gen_tempname_len): Add suffixlen parameter. (__gen_tempname): Update caller. * src/mktemp.c (mkstemp_len, mkdtemp_len): Update callers.
2009-11-05build: override gnulib tempname via diffEric Blake
Diffs are more robust than wholesale replacement, because bootstrap will inform us of any incompatible changes made in upstream gnulib. * gl/lib/tempname.h: Change... * gl/lib/tempname.h.diff: ...to diff. * gl/lib/tempname.c: Change... * gl/lib/tempname.c.diff: ...to diff.
2009-11-05mktemp: rearrange --help outputEric Blake
* src/mktemp.c (usage): Align indentation and sort by long options. Describe valid templates. Suggested by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548316.
2009-11-05tests: enhance mktemp testEric Blake
* tests/misc/mktemp: Add more coverage.
2009-11-05doc: document mktempEric Blake
* doc/coreutils.texi (mktemp invocation): New node. * TODO: Delete completed task.
2009-11-05mktemp: don't leave file behind on write failureEric Blake
* src/mktemp.c (main): Remove just-created file if stdout had problems. * bootstrap.conf (gnulib_modules): Add remove. * tests/misc/close-stdout: Test it. * NEWS: Document it.
2009-11-05du: cleanup: remove dead-code vestige of already-removed optionJim Meyering
* src/du.c (MEGABYTES_LONG_OPTION, main): Remove vestiges of already-removed long option, --megabytes.
2009-11-05du now diagnoses cycles, rather than ignoring themJim Meyering
* src/du.c (symlink_deref_bits): New global, decl moved from ... (main): ...here. (process_file): When fts detects a directory cycle that can't be due to symlinks, report it and arrange to exit nonzero. * NEWS (Bug fixes): Mention it.
2009-11-05maint: factor out cycle warning, now that du will use it, tooJim Meyering
* src/system.h (emit_cycle_warning): Define. Factored out of... * src/remove.c (rm_fts): ...here. Use the new macro.
2009-11-03tests: rm: add test for today's change in behaviorJim Meyering
* tests/Makefile.am (root_tests): Add rm/read-only to the list. * tests/rm/read-only: New file.
2009-11-03rm -f: ignore EROFS when it's really ENOENTJim Meyering
rm -f must not print a diagnostic for a nonexistent file. However, most linux-based kernel unlinkat functions set errno to EROFS when the named file (regardless of whether it exists) would lie on a read-only file system. remove.c now performs an extra fstatat call in that case, to determine whether the file exists. * src/remove.c (excise): Map EROFS to ENOENT, if a file is nonexistent. Reported by Steven Drake in <http://savannah.gnu.org/bugs/?27923>. * NEWS (Changes in behavior): Mention it.
2009-11-03tests: inotify-race: don't let malfunctioning gdb hang the testJim Meyering
* tests/tail-2/inotify-race: Apply timeout to each gdb invocation.
2009-11-02build: avoid some warningsEric Blake
* gl/lib/mbsalign.c (mbsalign): Mark unused parameter. * bootstrap.conf (gnulib_modules): Remove obsolete rename-dest-slash. * gnulib-tests/Makefile.am (AM_CFLAGS): Reduce set of warnings for gnulib tests. * gl/modules/rename-tests.diff (Makefile.am): New file, to add LIBINTL to LDADD, since we avoid canonicalize-lgpl module. * gl/lib/regcomp.c.diff (regerror, calc_next) (build_collating_symbol, parse_bracket_element, build_equiv_class) (free_tree): Mark unused parameters. * gl/lib/regex_internal.h.diff (re_string_elem_size_at): New file, to mark unused parameters. * gl/lib/printf-args.c.diff (PRINTF_FETCHARGS): New file, to avoid type mismatch. * gl/lib/vasnprintf.c (VASNPRINTF): New file, to avoid shadowing local variable name. * .gitignore: Ignore temporary build artifacts.
2009-11-02build: update gnulib submodule to latest, for fewer compiler warningsEric Blake
2009-10-31admin: automate one more part of the release processJim Meyering
This script automates the process of updating NEWS, performs the resulting final commit (thus with a consistent log message), and applies a signed tag (v$VERSION) to the result. * build-aux/do-release-commit-and-tag: New script. * README-release: Document it.
2009-10-31admin: fix typo in release procedureJim Meyering
* README-release: s/gzip/coreutils/
2009-10-30tests: prohibit fail=0 initializationJim Meyering
* cfg.mk (sc_prohibit_fail_0): New rule. * .x-sc_prohibit_fail_0: New file. * Makefile.am (syntax_check_exceptions): Distribute the new file.
2009-10-30tests: factor 350 fail=0 initializations into test-lib.shJim Meyering
Run this command to remove the factored-out "fail=0" lines. perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$') * tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts. * tests/...: nearly all bourne shell scripts Suggested by Eric Blake.
2009-10-30tests: remove the less-regular fail=0 assignments manuallyJim Meyering
* tests/tail-2/assert-2: * tests/tail-2/assert: * tests/cp/file-perm-race: * tests/misc/df: * tests/misc/truncate-dir-fail: