2007-06-22 Pádraig Brady
(trivial change)
* tests/seq/basic: Add test cases for seq off-by-one problem.
2007-06-22 Jim Meyering
* src/stat.c (long_options): Add a FIXME comment to help ensure
that the deprecated and undocumented "--filesystem" option is
removed someday.
2007-06-18 Paul Eggert
A few more symlink-related fixes. Fix a bug triggered by cp
--parents and symlinks. Close some race conditions possible when
the destination replaces a newly-created file with a symlink.
* NEWS: Document that 'cp --parents' no longer mishandles
symlinks in file name components of source.
* src/copy.c (HAVE_LCHOWN): Default to false.
(lchown) [!defined HAVE_LCHOWN]: Define to chown, for convenience.
* src/cp.c (lchown) [!HAVE_LCHOWN]: Likewise.
* src/install.c (lchown [!HAVE_LCHOWN]: Likewise.
* src/copy.c (set_owner): Use lchown instead of chown, for safety
in case the file got replaced by a symlink in the meantime.
* src/cp.c (re_protect): Likewise.
* src/install.c (change_attributes): Likewise.
* src/copy.c (copy_internal): Use ordinary C rather than an #if.
* src/cp.c (lchown) [!HAVE_LCHOWN]: Define to chown, for convenience.
(struct dir_attr): Cache the entire struct stat of the directory,
rather than just its mode, so that we needn't stat the directory
twice (which can lead to races).
(re_protect): Don't use XSTAT as that's not appropriate in
this context (symlinks should be followed here). Instead, use
the cached stat value.
(make_dir_parents_private): Save dir's entire struct stat, not
just its mode.
* tests/cp/cp-parents: Add test to check against bug with
cp --parents and symlinks.
2007-06-18 Jim Meyering
Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
* bootstrap.conf (gnulib_modules): Add readlink-with-size.
Remove xreadlink and xreadlink-with-size.
* src/copy.c (copy_internal): Use mreadlink_with_size,
not xreadlink_with_size.
* src/ls.c (get_link_name): Likewise.
* src/readlink.c (main): Likewise.
* src/stat.c (print_stat): Likewise.
* README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out.
2007-06-16 Jim Meyering
Make chgrp and chown diagnostics consistent.
* src/chown.c (main): Emit the diagnostic before the file name,
not after it, to be consistent with chgrp's diagnostic.
* src/chgrp.c (parse_group): Emit a ":" between the diagnostic
and the file name.
Reported by Egmont Koblinger.
* THANKS: Add Egmont Koblinger.
2007-06-15 Paul Eggert
Correct cp's handling of destination symlinks in some cases.
* NEWS: "cp" no longer considers a destination symlink to be the
same as the referenced file when copying links or making backups.
* src/copy.c (copy_reg): When following a symlink, use the
followed name in later chown etc. requests, so that the created
file is affected, rather than the symlink. Use O_NOFOLLOW on
source when not dereferencing symlinks; this avoids a race.
Preserve errno correctly when doing multiple open attempts on the
destination.
(copy_internal): Follow destination symlinks only when copying a
regular file and only when we don't intend to remove or rename the
destination first, regardless of whether following source
symlinks; this is because since POSIX and tradition (e.g.,
FreeBSD) say we should ordinarily follow destination symlinks if
the system calls would ordinarily do so.
* src/copy.h (struct cp_options): Add comment that 'dereference'
is only for source files.
* src/cp.c (usage): Note that --derereference etc. are only for
source files.
(make_dir_parents_private): Follow symlinks, regardless of whether
--dereference is specified, because these are destination symlinks.
* tests/cp/same-file: Adjust tests to match revised behavior.
Filter out perror output since it might vary from host to host.
Use sed alone instead of also using echo.
* doc/coreutils.texi (cp invocation): Document the behavior better when
the destination is a symlink. Clarify source versus destination
symlinks. Describe the new behavior for destination symlinks.
2007-06-15 Jim Meyering
* src/copy.c: Include "canonicalize.h".
(copy_reg): Use canonicalize_filename_mode to follow the symlink,
so that we can always open with O_EXCL and avoid a race.
2007-06-15 Jim Meyering
Don't include "quote.h" when it is not used.
* src/md5sum.c: Remove unnecessary inclusion of "quote.h".
* src/expr.c: Likewise.
* src/shred.c: Likewise.
* Makefile.maint (sc_prohibit_quote_without_use): New rule.
* src/c99-to-c89.diff: Adjust offsets.
2007-06-14 Paul Eggert
Clarify what "cat" documentation means by "blank" lines.
* doc/coreutils.texi (cat invocation): "Blank" lines actually mean
empty lines.
* src/cat.c (usage): Say that "nonblank" means nonempty. Clarify
--squeeze-blank.
2007-06-13 Jim Meyering
rmdir: give better diagnostics
* src/rmdir.c (remove_parents): Give a more descriptive/consistent
diagnostic upon failure.
(main): Likewise.
Suggestion from Joey Hess.
* THANKS: Add Joey Hess.
Don't include "quotearg.h" when it is not used.
* Makefile.maint (sc_prohibit_quotearg_without_use): New rule.
* src/cp.c: Don't include "quotearg.h". It wasn't used.
* README-hacking: List Gperf as a build-requirement, too.
Reported by Steve Ward.
2007-06-11 Jim Meyering
* README: Mention README-hacking, for whose who start from
cloned/checked-out sources rather than from a distribution tarball.
Reported by Steve Ward.
* THANKS: Add Steve Ward.
2007-06-10 Jim Meyering
bug-fix: cp would fail to write through a dangling symlink
* NEWS: Mention the bug fix.
* src/copy.c (copy_reg): When open fails with EEXIST, the destination
is lstat'able, and a symlink, call open again, but now without O_EXCL.
* tests/cp/thru-dangling: New file, to test for the above fix.
* tests/cp/Makefile.am (TESTS): Add thru-dangling.
* THANKS: Add Michael McLagan.
Bug report from Michael McLagan in .
2007-06-04 Paul Eggert
* doc/coreutils.texi (Common options): Mention that -h and
--human-readable are equivalent to --block-size=human-readable.
Documentation problem reported by Steve Ward in
.
(du invocation): Use optSi rather than duplicating the macro's
contents (incorrectly, since we claimed a "B" was output).
2007-05-31 Jim Meyering
Pull printf-related code from gnulib, rather than using forked copy.
* bootstrap.conf (gnulib_modules): Don't avoid size_max and xsize
modules. While I dislike xsize-style overflow avoidance, maintaining
a forked version of e.g., vasnprintf.c was too much work.
2007-05-29 Jim Meyering
* src/dircolors.hin: Add screen-256color.
Suggested by sdl.web@gmail.com in .
2007-05-26 Jim Meyering
* TODO: Add an entry for comm --output-delimiter=STR
2007-05-25 James Youngman
wc: ignore multibyte-character decoding errors
* src/wc.c (wc): Don't issue an error message when mbrtowc
indicates that we have seen an invalid byte sequence. This
makes "wc /bin/sh" bearable (though the word and line counts
are likely not to be useful).
* NEWS: Mention the change.
2007-05-22 Jim Meyering
Check for an up-to-date copyright year in coreutils.texi.
* Makefile.maint (copyright-check): Also check for an up-to-date
copyright year in doc/$().texi, if that file exists.
* doc/coreutils.texi: Add 2007 to list of Copyright years.
Reported by Karl Berry.
cut: diagnose a range starting with 0 (-f 0-2) as invalid, and
give a better diagnostic for a field-number/offset of 0.
* NEWS: Mention the fix.
* src/cut.c (ADD_RANGE_PAIR): Add an explicit check.
Based on a patch from James Youngman.
* tests/misc/cut: Add tests for the above.
"cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"
Also, diagnose the '-' in "cut -f -" as an invalid range, rather
than interpreting it as the unlimited range, "1-".
* NEWS: Mention these changes.
* src/cut.c (set_fields): Don't interpret an accumulator "value"
of 0 as an unspecified range endpoint.
Give better diagnostics.
Adjust a comment so that it is true also for 64-bit size_t.
* tests/cut/Test.pm: Add tests for the above.
stty: fix a harmless syntax nit
* src/stty.c (visible): Use ";" as the statement terminator
between two assignments, not ",".
(integer_arg): Join an unnecessarily wrapped line.
2007-05-20 Jim Meyering
stty: diagnose an invalid hex value in 35-colon commmand-line argument
* NEWS: Mention this.
* src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions.
(recover_mode): Use those functions (not sscanf), to parse the
string robustly.
* tests/stty/invalid: New file. Test for the above.
* tests/stty/Makefile.am (TESTS): Add invalid.
* .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check.
Add tests/stty/invalid so we don't have to obfuscate the comment
about sscanf therein.
* Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the
diagnostic, too.
* TODO: Remove some now-completed or no longer relevant items.
2007-05-19 Jim Meyering
Rename uses of futimens -> gl_futimens; glibc now declares the former.
* src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens.
* src/touch.c (touch): Likewise.
2007-05-18 Jim Meyering
* Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS)
for now, to avoid c89-check failure due to use of #include_next.
2007-05-15 Jim Meyering
Generate a dozen test-related Makefile.am files at bootstrap-time.
* README-hacking: Build-from-checkout now require Perl, too.
* bootstrap: Now that these generated Makefile.am files are no longer
under version control, they must be created at bootstrap time.
2007-05-14 Paul Eggert
* man/chmod.x: Document chmod's behavior with setuid and setgid bits.
Remove misleading implication about leading zero. Problem
reported by Jan Engelhardt in
.
2007-05-13 Jim Meyering
Remove the generated tests/*/Makefile.am files from version control.
* tests/cut/Makefile.am: git-remove this generated file.
* tests/head/Makefile.am: Likewise.
* tests/join/Makefile.am: Likewise.
* tests/pr/Makefile.am: Likewise.
* tests/sort/Makefile.am: Likewise.
* tests/tac/Makefile.am: Likewise.
* tests/tail/Makefile.am: Likewise.
* tests/test/Makefile.am: Likewise.
* tests/tr/Makefile.am: Likewise.
* tests/uniq/Makefile.am: Likewise.
* tests/wc/Makefile.am: Likewise.
* .cvsignore, .gitignore: Ignore these generated files.
* src/.cvsignore, src/.gitignore: Add chcon here, ...
* .cvsignore, .gitignore: ... not here.
Test uniq's new --zero-terminated (-z) option.
* tests/uniq/Test.pm: When possible, create a "-z"-testing variant
of each existing test.
(2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman.
2007-05-12 James Youngman
Add -z option to uniq. Originally proposed by Egmont Koblinger.
* NEWS: Mention uniq's new option: --zero-terminated (-z).
* src/uniq.c: Add new option, --zero-terminated (-z), to make
uniq use the NUL byte as separator/delimiter rather than newline.
(check_file): Add a parameter: delimiter. Update caller.
Use readlinebuffer_delim in place of readlinebuffer everywhere.
(main): Handle the new option.
(usage): Describe new option the same way sort does.
* doc/coreutils.texi (uniq invocation): Describe the new option.
2007-05-07 Jim Meyering
* NEWS: Mention that last week's tr bug dates back to 1992.
2007-05-04 Jim Meyering
Avoid test failure when run with an unusual umask.
* tests/ls/color-dtype-dir: Set umask to 022.
Suggestion from AIDA Shinra.
Avoid failure of root-only test when run with a restrictive umask.
* tests/rm/no-give-up: Ensure that non-root can access "d/" through
root-owned ".". Reported by AIDA Shinra.
tr -c: don't abort when translating with S2 larger than complement of S1
* src/tr.c (main): Remove invalid assertion triggered by e.g.,
tr -c a '[b*256]'. There's nothing wrong with having Set2 larger
than Set1. Reported by Guntram Blohm.
* tests/tr/Test.pm (no-abort-1): Test for the above.
* NEWS: Mention this bug fix.
* THANKS: Add Guntram Blohm.
2007-05-03 Jim Meyering
Avoid test failure when run with a permissive umask.
* tests/rm/no-give-up: Set permissions of test directory properly,
i.e., not depending on umask prohibiting go=w.
Reported by AIDA Shinra.
2007-05-02 Paul Eggert
The following commands and options now support the standard size
suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
head -c, head -n, od -j, od -N, od -S, split -b, split -C,
tail -c, tail -n.
* doc/coreutils.texi (od invocation, head invocation, tail invocation):
Document support for new size suffixes.
(head invocation, tail invocation):
Document that -n uses the same suffixes as -c.
(tail invocation): More-clearly document what leading "+" does.
* src/head.c (usage, string_to_integer): Support new suffixes.
* src/od.c (usage, main): Likewise.
* src/split.c (usage, main): Likewise.
* src/tail.c (usage, parse_options): Likewise.
Prompted by a patch from Evan Hunt.
2007-05-02 Jim Meyering
* src/du.c (usage): Tweak description of --dereference-args (-D) again.
Prompted by another request for clarification from Justin Pryzby.
Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm.
* tests/rm/fail-2eperm: Patch from AIDA Shinra.
Reported by Peter Dyballa.
* THANKS: Add AIDA Shinra and Peter Dyballa.
2007-04-28 Paul Eggert
* src/nohup.c (usage): Describe how standard input and output
are redirected.
2007-04-25 Jim Meyering
* src/du.c (usage): Clarify description of --dereference-args (-D).
Prompted by a report from Justin Pryzby.
* bootstrap.conf (gnulib_modules): Add fseeko and ftello.
(gnulib_modules): Add autobuild.
2007-04-24 Jim Meyering
* THANKS: Add Andreas Frische.
* NEWS: Mention today's ls --color fix.
* tests/ls-2/tests (sl-dangle): Add a test for today's fix.
2007-04-24 Eric Blake
ls --color once again colors dangling symlinks correctly
* src/ls.c (gobble_file): Much like the 2007-04-07 fix,
add a term to the expression that decides whether we need
stat and/or lstat calls. Reported by Andreas Frische.
2007-04-16 Jim Meyering
* src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
Reported by Rudolf Kastl.
* THANKS: Add Rudolf Kastl.
2007-04-11 Paul Eggert
split --line-bytes=N (-C N): don't create an empty file.
* src/split.c (line_bytes_split): Don't create an empty line
afterwards if the last buffer happens to be exactly full.
* tests/misc/split-fail: Add a test case for this.
* NEWS: mention this.
2007-04-10 Jim Meyering
ls: don't form or compute the length of strings that won't be used.
* src/ls.c (gobble_file): Form and compute length of strings for
block size, owner, group, author, major+minor numbers and file size
only if they'll actually be used. I.e., don't form most of them
when not producing long format output.
2007-04-07 Jim Meyering
Add a test for, and document, today's fix.
* NEWS: Mention today's ls --color fix.
* tests/ls-2/tests (sl-target): Add a test for today's fix.
* THANKS: Add Kirk Kelsey.
2007-04-07 Eric Blake
Fix a bug in how the LS_COLORS ln=target attribute is handled.
* src/ls.c (gobble_file): Use "stat" (not lstat) also when the
ln=target attribute applies. Reported by Kirk Kelsey.
2007-04-02 Jim Meyering
* src/copy.c (copy_reg): Initialize local "con", before calling
getfscreatecon, in case that function (or its inline stub) does
not set it.
2007-04-01 Paul Eggert
* 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.
gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt
* bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of
md5 to crypt/md5 and sha1 to crypt/sha1.
2007-03-30 Jim Meyering
* NEWS: Mention these SELinux changes.
* ChangeLog-selinux: Remove file.
Move its contents into this file, removing old dates.
* src/runcon.c (main): Don't reorder arguments. Reported by
Ulrich Drepper in .
* tests/misc/runcon-no-reorder: New file. Test for the above.
* tests/misc/Makefile.am (TESTS): Add runcon-no-reorder.
* src/runcon.c (main): Remove "." at end of a diagnostic.
* src/runcon.c: New program.
* src/Makefile.am (bin_PROGRAMS): Add runcon.
(runcon_LDADD): Define.
* README: Add runcon to the list of programs.
* AUTHORS: Add this: runcon: Russell Coker
* tests/help-version: Add runcon as an exception.
* man/Makefile.am (dist_man_MANS): Add runcon.1.
(runcon.1): New dependency.
mkfifo, mknod: Accept new "-Z, --context=C" option.
* src/mkfifo.c, src/mknod.c: Include .
(main): Honor it.
* src/Makefile.am (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX).
mkdir: Accept new "-Z, --context=C" option.
* src/mkdir.c: Include .
(main): Honor it.
* src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX).
* tests/cp/cp-a-selinux: New file. Test for the bug reported in
.
* tests/cp/Makefile.am (TESTS): Add cp-a-selinux.
* tests/selinux: New file.
* tests/Makefile.am (EXTRA_DIST): Add selinux.
* tests/misc/selinux: Source the new script, rather than open coding it.
Change how "cp -a" and "cp --preserve=context" work with SELinux.
Now, cp -a attempts to preserve context, but failure to do so does
not change cp's exit status. However "cp --preserve=context" is
similar, but failure *does* cause cp to exit with nonzero status.
* src/copy.h (struct cp_options) [require_preserve_context]: New member.
* src/copy.c (copy_reg, copy_internal): Implement the above.
* src/mv.c (cp_option_init): Initialize the new member.
* src/install.c (cp_option_init): Likewise.
* src/cp.c (cp_option_init): Likewise.
(decode_preserve_arg): Set it or reset it.
cp, mv, install: add SELinux support, but unlike with the Red Hat
patch, mv and cp do not provide the "-Z context" option.
* src/copy.c: Include .
(restore_default_fscreatecon): New function.
(copy_reg): Make cp --preserve=context work for existing destination.
(copy_internal): Likewise for new destinations.
* src/copy.h (cp_options) [preserve_security_context]: New member.
* src/cp.c: Include .
(selinux_enabled): New global.
(usage): Mention new --preserve=context option.
(PRESERVE_CONTEXT): Define/use.
(decode_preserve_arg): Handle PRESERVE_CONTEXT.
(main): Remove an obsolete comment.
If --preserve=context is specified on a system without SELinux
enabled, give a diagnostic and fail.
* src/mv.c: Include .
Set x->preserve_security_context if SELinux is enabled.
* src/install.c: Accept new "-Z, --context=C" option.
Accept --preserve-context option (but not -P option).
Accept alternate spelling: --preserve_context, for now.
Include and "quotearg.h".
(selinux_enabled, use_default_selinux_context): New globals.
(PRESERVE_CONTEXT_OPTION): Define.
(cp_option_init): Default: do not preserve security context.
(setdefaultfilecon): New function.
(main): Honor new options.
* src/Makefile.am (mv_LDADD, cp_LDADD, ginstall_LDADD):
Add $(LIB_SELINUX).
* src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define.
* tests/misc/selinux [VERBOSE]: Print version info for each
of the tested tools, not just ls.
* src/c99-to-c89.diff: Remove the ls.c patch, now that I've
temporarily removed the offending c99'ism.
* src/chcon.c (usage): Split a string literal that was longer than 509.
* src/ls.c (gobble_file): Don't call getfilecon unless print_scontext.
Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA.
* src/c99-to-c89.diff: Adjust offsets.
* AUTHORS: Add chcon.
* src/c99-to-c89.diff: Remove trailing blanks.
* src/chcon.c: Don't include "dirname.h". system.h already includes it.
* gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H.
* src/c99-to-c89.diff: Handle a new c99'ism in ls.c.
* src/id.c (main): Tweak id -Z diagnostic.
id: Add SELinux support: -Z option.
* src/id.c (main): Apply patches from Fedora, with these changes:
Remove #ifdef WITH_SELINUX.
Use error (EXIT_FAILURE, not fprintf+exit(1).
* src/Makefile.am (id_LDADD): Define, so as to add $(LIB_SELINUX).
stat: Add support for SELinux in the form of a %C format directive.
* src/stat.c (follow_links): Make this variable file-global.
(out_file_context): New function.
(print_statfs): Honor %C.
(print_stat): Honor %C.
(do_stat): Remove follow_links parameter.
(usage): Document the two %C directives.
(main): Accept -Z (though it's a no-op).
* src/Makefile.am (stat_LDADD): Define.
ls: Add support for SELinux and a slightly modified -Z option.
I started with the patches from Red Hat.
The entries below tell how the code evolved.
* src/ls.c (print_long_format, print_file_name_and_frills): When
there is no security context (due to getfilecon/lgetfilecon failing
with e.g. ENOTSUP), print it as "?", not "".
* src/ls.c (print_file_name_and_frills): Make -Z work without -l.
(length_of_file_name_and_frills): Likewise.
* src/ls.c: Remove the --lcontext and --scontext options.
Change the way -Z, --context work so that it no longer implies -l.
Thus, -Z -l will work like -lcontext and -Z without -l will work
like --scontext.
Adjust tests to reflect new 'ls -l' syntax -- affects only
systems with SELinux when operating on a file with no ACL.
These tests assumed that everything before the first space on
each line is the 10-byte mode string. But there may also be a "+"
in the 11th column, just before the space. However, note that this
is not new. The same thing would have happened even without the
change below, when listing a file with an ACL.
* tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm:
* tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod:
* tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm:
Don't make compilation depend on USE_ACL. An SELinux security
context counts as an "alternate access control method", so ls
must output a "+" for each file with a security context.
* src/ls.c [struct fileinfo] (have_acl): Declare unconditionally.
(FILE_HAS_ACL): Remove macro definition. Use f->have_acl directly.
(gobble_file): Record whether a file has a security context, and
update the condition used to determine whether to print the "+".
(gobble_file): Call getfilecon/lgetfilecon also when
format == long_format, so that we get the "+".
* src/ls.c (gobble_file): Add a comment explaining why (with a
security context option) ls doesn't exit nonzero due to e.g.,
getfilecon failing with errno == ENOTSUP.
* src/ls.c (gobble_file): Ignore failure of getfilecon if it's due
to ENOTSUP.
* src/ls.c (gobble_file): Factor out three small blocks using
getfilecon and lgetfilecon.
Don't ignore return value from getfilecon and lgetfilecon.
* src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C
ternary operator).
(print_scontext_format): Likewise.
(print_scontext): Declare to be "bool", not int. Adjust uses.
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX).
* tests/misc/chcon: New file.
* tests/misc/chcon-fail: New file.
* tests/Makefile.am (check-root): Run new, root-only misc/chcon test.
* tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail.
* tests/misc/Makefile.am (TESTS): Add selinux.
* tests/misc/selinux: New file.
* tests/help-version: Skip chcon.
* man/chcon.x: New file.
* man/Makefile.am: Build chcon.1.
New program: chcon
* gl/modules/selinux-at: New module. Check for libselinux and set
LIB_SELINUX here, unconditionally, rather than depending on
the configure-time --enable-selinux option.
* gl/modules/selinux-h: New module.
* bootstrap.conf (gnulib_modules): Add selinux-at.
* gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files.
* gl/lib/se-selinux_.h: New file.
* gl/lib/se-context_.h: New file.
* gl/m4/selinux-selinux-h.m4: New file.
* gl/m4/selinux-context-h.m4: New file.
* src/Makefile.am (bin_PROGRAMS): Add chcon.
(chcon_LDADD): Define.
* README: Add chcon to the list of programs.
* src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
2007-03-29 Jim Meyering
* .vg-suppressions: Add libc-getpwuid-leak.
2007-03-28 Jim Meyering
Help translators include translation team's web or email address.
* src/system.h (emit_bug_reporting_address): New function.
* src/base64.c: Use it rather than a literal printf.
* src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
* src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
* src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
* src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
* src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
* src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
* src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
* src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
* src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
* src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
* src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
* src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
* src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
* src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
* src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
* src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
* src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
* src/who.c, src/whoami.c, src/yes.c: Likewise.
* src/stty.c: Don't include "vasprintf.h", now that its
declarations are guaranteed to be in gnulib's stdio.h.
* src/who.c: Likewise.
2007-03-27 Jim Meyering
* README: Use "install", not "ginstall" in the list of program names.
* src/Makefile.am (check-README): Substitute s/ginstall/install/.
2007-03-25 Jim Meyering
* src/c99-to-c89.diff: Regenerate.
2007-03-25 Paul Eggert
Avoid the need for euidaccess and/or lstat on every directory entry
with 'rm -r dir' (without -f), if we are root, or if we are removing
a directory tree that is full of symbolic links.
* bootstrap.conf (gnulib_modules): Add write-any-file.
* src/copy.c: Include write-any-file.h.
(UNWRITABLE): Remove macro, replacing with....
(writable_destination): New function, which uses can_write_any_file
to avoid the need for euidaccess when we are privileged.
(overwrite_prompt, abandon_move): Use it.
* src/remove.c: Include write-any-file.h.
(D_TYPE): New macro.
(DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros.
(write_protected_non_symlink): Don't bother to stat if we can write
any file.
(prompt): New arg PDIRENT_TYPE. All callers changed.
Use readdir dirent type to avoid the need for 'lstat' on each directory
entry in cases like 'rm -r dir', if we are root, or if the tree is
full of symbolic links.
(DT_IS_KNOWN, DT_MUST_BE): Remove.
(remove_entry): New arg DIRENT_TYPE_ARG. All callers changed.
2007-03-24 Jim Meyering
If strace malfunctions, skip the test rather than failing it.
* tests/mv/atomic: Required on a mips-unknown-linux-gnu system
running the aging linux-2.4.27-mipscvs-20040814.
2007-03-23 Paul Eggert
* src/pathchk.c: Don't include euidaccess.h, as we don't call
euidaccess.
2007-03-23 Jim Meyering
* README-package-renamed-to-coreutils: Add a URL for the FAQ,
and a couple more archive links.
2007-03-22 Jim Meyering
Post-release version change.
* NEWS: Add a line for 6.9+.
* configure.ac (AC_INIT): Set new version string.
Version 6.9.
* NEWS: Record release date and new version number.
* configure.ac (AC_INIT): New version number.
* tests/mv/hard-3: Correct the preceding change: $3 -> $2.
2007-03-22 Paul Eggert
Improve a test script.
* tests/mv/hard-3: Check for 'ls' failure, too.
Generate more-useful debugging output when 'ls' fails.
2007-03-21 Jim Meyering
Fix a test script not to claim an ext2 file system is of type xfs.
* tests/du/slink: When using df --local and df --type=TYPE,
test only the exit code. Don't bother with stdout.
Prompted by a report by Thomas Schwinge of an inaccurate diagnostic.
* gl/lib/savewd.c: Remove this file, since the savewd_save change
is now in gnulib. The other wasn't useful.
2007-03-20 Jim Meyering
* gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it.
Skip part of this test when "." is not a local file system.
* tests/install/basic-1: Otherwise, it would fail on some NFS
file systems.
* tests/mkdir/p-3: Likewise.
2007-03-19 Paul Eggert
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD):
Add $(LIB_ACL_TRIVIAL).
2007-03-18 Jim Meyering
Fix a generic NFS-related test failure.
* tests/mkdir/p-3: When setting up an unreadable "." in an
inaccessible parent, make the parent inaccessible *after* making "."
unreadable. Otherwise, running "chmod a-r ." in an already-
inaccessible parent would fail on NFS with "Stale NFS file handle".
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-17 Jim Meyering
Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
* bootstrap: Put ""s around use of $build_aux, in case
someone uses a name containing shell meta-characters.
Reported by Alfred M. Szmidt.
* tests/misc/tty-eof: Add shuf to the list of tested commands.
Avoid test failure on NFS-mounted Solaris ZFS file system.
* tests/du/basic: Skip a test if "." is on a non-local file system.
Avoid an obscure build failure, prefer waitpid over wait.
* src/install.c (strip): Use waitpid, not wait. It's equivalent,
but feels less obsolescent.
* bootstrap: Don't use \> in grep regexp. For HP-UX.
2007-03-16 Jim Meyering
Begin adding support for Solaris ZFS (4 entries per trivial ACL)
* gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro.
(file_has_acl, copy_acl): Use it, rather than enumerating errno values.
(is_trivial_acl): New function. Incomplete, for now.
(file_has_acl, copy_acl): Use the new function, rather than
counting the number of entries in an ACL.
* bootstrap: Update from gnulib.
* .x-sc_prohibit_atoi_atof: Add TODO here, too.
2007-03-16 Paul Eggert
* src/copy.c: Include filemode.h.
(overwrite_prompt): Say "try to overwrite", not "overwrite", to
make it clearer that the attempt may fail. Problem reported by
Dan Jacobson in:
http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html
Output symbolic mode as well as numeric.
* tests/mv/i-2 (fail): Adjust to new prompt format.
2007-03-15 Jim Meyering
Enforce policy: don't use *scanf functions.
* Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic.
* .x-sc_prohibit_atoi_atof: Give stty a temporary pass.
* TODO: note that stty.c needs this small clean-up.
2007-03-13 Jim Meyering
Prepare to work on ACL-related failure when using Solaris ZFS.
* gl/lib/acl.c: New file, copied from gnulib.
Work around a failing test due to an NFS-based race condition.
* tests/cp/sparse: Accept a report that the copy is *smaller*.
2007-03-12 Jim Meyering
Make bootstrap.conf a tiny bit more generic.
* bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4
files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac.
2007-03-10 Jim Meyering
Try to fix today's NFS-related failure: Treat ESTALE like EACCES.
* gl/lib/savewd.c: Copy this file from gnulib, then change
"errno != EACCES" to (errno != EACCES && errno != ESTALE).
The symptom was this failure in tests/install/basic-1:
ginstall: cannot create directory `rel/a': Stale NFS file handle
The preceding change solved part of the problem. Now ginstall fails.
* tests/install/basic-1: Temporarily, don't redirect ginstall's
stderr to /dev/null, so I can see why the NFS autobuilder's NFS test
is failing.
* tests/install/basic-1: When setting up an unreadable "." in an
inaccessible parent, make the parent inaccessible *after* making "."
unreadable. Otherwise, running "chmod a-r ." in an already-
inaccessible parent would fail on NFS with "Stale NFS file handle".
Reported by Bob Proulx.
* Makefile.maint (po-check): Exclude c99-to-c89.diff.
2007-03-09 Jim Meyering
Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9)
* tests/chgrp/basic: Don't let failure by chgrp to set the
group of a symlink make this test fail. Do give a diagnostic.
In the chgrp-no-change-ctime test, add darwin7.9.0 as another
known-failing system.
When failing on some other system, print $host_triplet, too.
Also avoid test failures on Darwin 8.8.x (MacOS X 10.4).
Reported by Peter Fales.
2007-03-08 Jim Meyering
* src/c99-to-c89.diff: Reflect the new c99'ism, update offsets.
2007-03-08 Paul Eggert
rm without -f: give a better diagnostic when euidaccess fails.
* src/remove.c (write_protected_non_symlink): Return int, not bool,
so that we can indicate failure too (as a postive error number).
(prompt): If write_protected_non_symlink fails, report that error
number and fail rather than charging ahead and removing the dubious
entry. Redo the logic of printing a diagnostic so that we need to
invoke quote (full_filename (...)) only once. More details at:
2007-03-08 Jim Meyering
Generalize a few more cvs-isms.
* bootstrap (checkout_only_file): Rename from CVS_only_file.
Change comments and diagnostics not to say "CVS".
* bootstrap: Run libtool, if necessary.
Make bootstrap a little more general.
* bootstrap (build_aux): Factor out/use this definition.
Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac.
(insert_sorted_if_absent): Move function definition "up", to
precede new first use.
If $build_aux/ doesn't exist initially, create it, and
mark it as ignored.
2007-03-03 Andrew Church (tiny change)
Paul Eggert
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 Jim Meyering
pwd-unreadable-parent: Skip test on ia64/Linux, too.
* tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD.
Reported by Bob Proulx.
2007-03-02 Jim Meyering
pwd-unreadable-parent: Skip test on non-Linux/GNU systems.
* tests/misc/pwd-unreadable-parent: Rather than trying to decide
whether this test has a chance of succeeding, run it only when
$(host_os) is linux-gnu. It was failing on powerpc-apple-darwin8.8.0
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os).
* tests/misc/pwd-long: Also allow "+" in $PWD.
Remove another coreutils-ism. Formatting cleanup.
* Makefile.maint (my-distcheck): Update an outdated comment.
(emit_upload_commands): Use $(PACKAGE) rather than "coreutils".
(my-distcheck): Skip the c99/c89 check if there's no such .diff file.
2007-03-01 Jim Meyering
* Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O".
(my-distcheck): Use the new variable, instead of too-long literal.
Make "make syntax-check" rules less coreutils-specific.
* Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT.
(sc_cast_of_alloca_return_value): Likewise.
(sc_root_tests): Do nothing if there is no check-root target
in tests/Makefile.am.
Run the writable-files check only for release-building targets.
* Makefile.maint (local-checks-available): Remove writable-files.
(alpha beta major): Put it here, instead.
"make syntax-check" now runs only Makefile.cfg-selected tests
* Makefile.maint (syntax-check-rules): Hoist this definition so that
it precedes the indirect use in the definition of $(local-check).
(local-check): Use :=, not just "=".
(syntax-check): Depend on $(local-check), not $(syntax-check-rules).
2007-02-28 Bruno Haible
* bootstrap.conf (gnulib_modules): Replace xreadlink with
xreadlink-with-size. Add xreadlink.
* src/copy.c (copy_internal): Update.
* src/ls.c (is_directory): Update.
* src/stat.c (print_stat): Update.
* src/readlink.c (main): Use the one-argument xreadlink function.
2007-02-28 Paul Eggert
* doc/coreutils.texi (Common options): --si outputs "M", not "MB".
Problem reported by Philip Rowlands in
.
2007-02-28 Jim Meyering
* .x-sc_file_system: Add the new test, tests/misc/df-P, to this
list of exceptions, for the "make distcheck" sc_file_system rule.
* Makefile.maint (gnulib_snapshot_date): Remove now-unused definition.
2007-02-27 Paul Eggert
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.
2007-02-27 Jim Meyering
Add a test for the above.
* tests/misc/df-P: New file.
* tests/misc/Makefile.am (TESTS): Add df-P.
2007-02-25 Jim Meyering
* Makefile.maint (announcement): Adjust so that it works with
announce-gen's --gnulib-snapshot-time-stamp option.
Indent one of the command lines using TAB, not 8 spaces.
Post-release version change.
* NEWS: Add a line for 6.8+.
* configure.ac (AC_INIT): Set new version string.
2007-02-24 Jim Meyering
Version 6.8.
* NEWS: Record release date and new version number.
* configure.ac (AC_INIT): New version number.
Don't skip this test on new-enough Linux/GNU systems.
* tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0,
rather than for __GETCWD_PREFIX in config.h (the latter is no
longer defined, ever, due to gnulib changes).
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD.
Remove the "gnits" option; it prohibits my using "+" as a version
string suffix, and all it does (beyond the default "gnu" option)
is to _require_ the THANKS file.
* configure.ac (AM_INIT_AUTOMAKE): Remove it.
Remove all AUTOMAKE_OPTIONS settings in Makefile.am files.
* tests/chgrp/Makefile.am, tests/chmod/Makefile.am:
* tests/chown/Makefile.am, tests/cp/Makefile.am:
* tests/du/Makefile.am, tests/expr/Makefile.am:
* tests/factor/Makefile.am, tests/general/Makefile.am:
* tests/install/Makefile.am, tests/ln/Makefile.am:
* tests/ls/Makefile.am, tests/mkdir/Makefile.am:
* tests/mv/Makefile.am, tests/readlink/Makefile.am:
* tests/rm/Makefile.am, tests/rmdir/Makefile.am:
* tests/seq/Makefile.am, tests/stty/Makefile.am:
* tests/tee/Makefile.am, tests/touch/Makefile.am:
* README: Document the OSF/1 4.0d build failure and work-around.
Reported by Bruno Haible.
* 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 Paul Eggert
* 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 Jim Meyering
Avoid a shell syntax error, when building with an inadequate Perl.
* man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since
it can expand to "/.../missing perl".
* man/Makefile.am (.x.1): Warn when unable to update a man page.
Suggestion from Bruno Haible.
2007-02-23 Bruno Haible
Handle better the combination of old Perl and a pre-c99 compiler.
* man/Makefile.am (.x.1): If the autoconf test has determined that
perl is missing or not a sufficient version, do nothing.
* tests/readlink/can-e: Put the closing double-quote at the end of a
backquoted word, not in the middle. Works around a bug in sh on
OSF/1 4.0d.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
* tests/du/slink: Skip the test if executing on an nfsv3 file system.
This avoids a test failure at least on OSF/1 4.0d.
2007-02-23 Jim Meyering
* src/date.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
2007-02-23 Ed Santiago
* src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
for a separator. Include sample RFC 2822 and 3339 output.
2007-02-23 Jim Meyering
With -Dlint, make shuf free all heap-allocated storage.
* src/shuf.c (main): Move declaration of input_lines to
function scope, and initialize to NULL, so we can free it.
[lint]: Free all malloc'd memory.
* tests/misc/shuf: Also test shuf's -e and -i options.
2007-02-22 Jim Meyering
Merge in a change from some other incarnation of this file (gzip?)
* bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.
Adjust preceding change not to perform an unaligned access.
* src/copy.c (copy_reg): Undo previous change. Instead, make
it clearer that we're using a single-byte sentinel, and
[lint]: Initialize sizeof (uintptr_t) - 1 bytes after the sentinel.
Reported by Andreas Schwab.
Placate valgrind, wrt ./cp --sparse=always
* src/copy.c (copy_reg): Place the sentinel by setting a
full word's worth of bits, not just a single byte's worth.
This avoids a harmless (but distracting) case of memory being
used-uninitialized.
2007-02-21 Paul Eggert
Honor dd's noatime flag if possible, even if not supported on build fs
* doc/coreutils.texi (dd invocation): Warn that noatime might not be
reliable.
* src/dd.c (flags, usage): Look at O_NOATIME, not
HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
flag, so that dd attempts O_NOATIME even if the build file system
does not support it. Problem reported by Jim Meyering today in
bug-coreutils.
* tests/dd/misc: Generate a warning, not a failure, if noatime
exists but fails.
2007-02-21 Jim Meyering
* tests/misc/date: Remove vestigial use of Data::Dumper.
2007-02-20 Paul Eggert
* src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
about out-of-range initializer with Sun C 5.8.
2007-02-20 Jim Meyering
* bootstrap (CVS_only_file): Use README-hacking.
Now that we use GIT, not cvs, rename README-cvs.
* README-hacking: Renamed from...
Update to reflect that we now use git.
* README-cvs: ...this.
* src/env.c (main): When invoked with no arguments (i.e. when printing
the environment), use a local variable to iterate through the global
"environ" array, rather than "environ" itself. This is solely to
avoid changing the environment for an LD_PRELOAD-substituted "puts"
or "exit" function. Tiny patch by Harvey Eneman. See
.
* THANKS: Update.
* bootstrap: Move definitions of temporary directory names and the
new bt_regex "up" to precede all uses, so it's clearer what their
scope is. Also, use [.], rather than \\., since the former works
even if eval'd.
* bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
Based on the bison 2007-02-19 change by Joel E. Denny.
2007-02-19 Paul Eggert
* 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 Jim Meyering
* bootstrap: Fix typo s/dowloading/downloading/ in --help output.
2007-02-18 Jim Meyering
* src/system.h: Don't include exit.h, now that it's subsumed
by the gnulib-generated stdlib.h.
* tests/rm/fail-eacces: Skip this test when running as root.
Reported by Matthew Woehlke.
* bootstrap: Use "._bootmp" as the temporary directory name,
not ".#bootmp". The latter's "#" caused trouble with the new,
gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.
2007-02-14 Paul Eggert
* bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
* src/dircolors.c: Include c-strcase.h.
(dc_parse_stream): Use c_strcasecmp rather than
strcasecmp to avoid unreliable results in locales like Turkish
where strcasecmp is incompatible with the C locale.
2007-02-13 Jim Meyering
Also check for and print stderr output, in case a program fails.
* tests/misc/tty-eof: Occasionally (not reproducible), this
test would fail, with one or more programs exiting nonzero, e.g.,
tty-eof: sha224sum exited with status 1 (expected 0)
Now, maybe we'll get a clue, the next time that happens.
2007-02-12 Jim Meyering
* .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.
* tests/misc/pwd-unreadable-parent: Skip the test if we're
definitely using the replacement.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
2007-02-10 Jim Meyering
Remove excess leading spaces that would make help2man misbehave.
* src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
* src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
* src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
* src/date.c (usage): Use two spaces after each optional flag, not one.
Reported by Thomas Huriaux in .
* Makefile.maint (longopt_re): Relax the regexp, making square
brackets optional, so it matches the newly reported violations, too.
* src/csplit.c (usage): Use two spaces (not one) to separate
each option string from its description, so help2man formats
the derived man page properly. Reported by Thomas Huriaux in
.
* src/df.c (usage): Likewise.
* src/du.c (usage): Likewise.
* src/install.c (usage): Likewise.
* src/ls.c (usage): Likewise.
2007-02-03 Jim Meyering
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-02 Paul Eggert
* 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.
* 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-02 Jim Meyering
* src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".
* src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
consistent, so this can be applied with patch -p0.
Reported by Matthew Woehlke.
Arrange for "make check-root" to run the new root-only test.
* tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux.
(all_t): Add t9.
* Makefile.maint (patch-check): Use patch with its -p2 option,
since that makes this check slightly more strict.
Use a directory on a loopback device mounted with -o context=...
* tests/cp/cp-a-selinux: Since this test now runs mount and umount,
it is a root-only one.
2007-01-29 Jim Meyering
Plug a leak in ls.
* src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
determine dev/inode or upon detecting a symlink loop.
* src/ls.c: Rename three global variables.
(cwd_file): Rename from 'files'.
(cwd_n_alloc): Rename from 'nfiles'.
(cwd_n_used): Rename from 'files_index'.
Shave 8 bytes off the size of "struct fileinfo".
* src/ls.c (fileinfo): Put all members of type "bool" together.
2007-01-28 Paul Eggert
Modify "ls" to sort its data faster, using the new gnulib mpsort
module rather than qsort. This is particularly a win in
environments where strcoll is slow, since mpsort typically calls
strcoll less often than qsort does.
* bootstrap.conf (gnulib_modules): Add mpsort.
* src/ls.c: Include mpsort.h.
(sorted_file, sorted_file_alloc): New vars, for a new vector of
pointers to the file info, for speed.
(clear_files, extract_dirs_from_files, sort_files, print_current_files):
(print_many_per_line, print_horizontal, print_with_commas):
(calculate_columns): Set and use new vector.
(initialize_ordering_vector): New function.
2007-01-26 Paul Eggert
Adjust to today's change to gnulib, which added a module for
string.h to replace the little include files like strcase.h.
* src/dircolors.c: Don't include strcase.h.
* src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.
2007-01-26 Jim Meyering
* src/dd.c (advance_input_after_read_error): Change diagnostic to
say "invalid file offset" rather than "screwy file offset".
* .x-sc_cast_of_argument_to_free: Remove this file.
* Makefile.am (EXTRA_DIST): Likewise.
2007-01-25 Dan Hipschman
* src/sort.c (create_temp): Remove superfluous access-X_OK
check. find_in_path does this for us.
2007-01-24 Jim Meyering
Remove usually-skipped test.
* tests/cp/open-perm-race: Remove this file. It is subsumed
by parent-perm-race.
* tests/cp/Makefile.am (TESTS): Remove open-perm-race.
* tests/sort/Makefile.am: Regenerate.
Pass "make distcheck" again.
* src/sort.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
* .x-sc_cast_of_argument_to_free: New file. Allow a cast in sort.c.
FIXME: this is just temporary, while we wait to remove the offending
access-calling code.
* Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
* Makefile.maint (sc_cast_of_argument_to_free): Use the
canonical, $$($(CVS_LIST_EXCEPT)).
* m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.
2007-01-24 Paul Eggert
* 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 Jim Meyering
Fix a typo.
* tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
Don't depend on "which".
* tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.
2007-01-24 Dan Hipschman
Test sort compression.
* tests/misc/Makefile.am: Add the test.
* tests/misc/sort-compress: New file containing the tests.
2007-01-24 Jim Meyering
* NEWS: sort temp file compression: tweak wording.
* src/sort.c (struct sortfile) [name]: Declare member to be const.
2007-01-21 Jim Meyering
* 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
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
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.
The idea of compressing sorts temporary files was first
suggested/implemented by Jay Soffian in 1998, and again
by Charles Randall in 2001.
2007-01-20 Jim Meyering
* tests/misc/pwd-long: Work properly even when run from the
wrong one of two or more bind-mounted sibling directories.
Suggestion from Mike Stone in .
2007-01-20 Paul Eggert
Standardize on list of signals when an app catches signals.
* src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
* src/ls.c (main): Likewise (except SIGPIPE was already caught).
Note that ls.c is special, as it also catches SIGTSTP.
* src/sort.c (main): Likewise. Also catch SIGQUIT. More details in
.
2007-01-19 Dan Hipschman
and Paul Eggert
* src/sort.c (cleanup): Clear temphead at the end.
(exit_cleanup): New function.
(main): Don't invoke atexit until we're ready.
Invoke it with exit_cleanup, not with cleanup and close_stdout,
to avoid a race condition with cleanup and signal handling. More
details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508
2007-01-18 Jim Meyering
* src/c99-to-c89.diff: Adjust remove.c offsets.
2007-01-17 Jim Meyering
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-15 Jim Meyering
* bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
emit foo.h, for each foo_.h. This yields one false-positive, fts.h,
but that's ok, since fts_.h will eventually be renamed.
* src/remove.c (remove_dir): Don't use errno in diagnostic.
Root-only test failure reported by Alex van Hout and Jon Grosshart in
.
* bootstrap.conf (avoided_gnulib_modules): Fix my typo:
s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/
2007-01-14 Bruno Haible
Enable use of gnulib's new fchdir module.
* bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl,
since we use canonicalize.
(gnulib_modules): Add fchdir.
* m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub.
2007-01-13 Jim Meyering
* tests/cp/open-perm-race: Remove gdb-based test.
It would run only when compiled with -g, and besides is now
subsumed by file-perm-race.
* tests/cp/Makefile.am (TESTS): Remove open-perm-race.
* Transform all Makefile.am files so that when running "make check",
CU_TEST_NAME is set to the name of the test. This is so that when I
run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
on the entire package it is more convenient to map a leak or error
found in a valgrind log file back to the offending test.
Use this command:
(echo tests/Makefile.am.in; find tests -name Makefile.am) \
|xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
-e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
2007-01-11 Jim Meyering
Avoid a leak in expr's implementation of the ":" (match) operator.
* src/expr.c (docolon): Free the regexp buffer using regfree, rather
than doing it manually, being careful to set fastmap to NULL first.
Free any re_regs.start and .end members, if necessary.
* tests/misc/test-diag: Work also when libc's error function
reports the entire program name ("../../src/test"), rather than
just the final component.
2007-01-10 Jim Meyering
Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
* src/chown-core.c (FTSENT_IS_DIRECTORY): New macro.
(change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a
directory. Non-directory entries lack fts_statp data when using
the FTS_NOSTAT option.
2007-01-07 Jim Meyering
* tests/sample-test: Update copyright date to 2007.
* Makefile.maint (copyright-check): Also check the copyright date
in tests/sample-test.
2007-01-06 Jim Meyering
* tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
based on examples from G.P. Halkes in
.
2007-01-06 G.P. Halkes
* src/fmt.c (copy_rest): Correct prefix handling.
Don't elide a line with the prefix followed by only white space.
(get_line): Move EOF-check to loop-termination condition.
* tests/fmt/basic (pfx-1): Adjust test to expect desired result.
(pfx-2): Remove test; its premise was contrary to the documentation.
2007-01-05 Jim Meyering
Avoid a used-uninitialized bug for invalid input, i.e., when the size
of the input, not counting newlines, is 1 % 4.
* gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
It may be smaller when flushing.
2007-01-05 Mike Frysinger
* src/dircolors.hin: Add a TERM directive for cons25.
2007-01-04 Jim Meyering
* Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
case you don't have convenient access to glibc info documentation.
Use the release year, not the current year.
* src/groups.sh (version): Use a better name: @RELEASE_YEAR@.
* src/Makefile.am (RELEASE_YEAR): Define it.
(.sh): Use it.
Thanks to a prod from Eric Blake.
Ensure that "group --version" always prints the current year.
* src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006.
* src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@.
Suggestion from Eric Blake.
When decoding, always allow newlines in input, with almost no
performance impact.
* src/base64.c (do_decode): Initialize decode context.
Call base64_decode one more time, after all input is processed.
(usage): When decoding, newlines are always accepted.
* tests/misc/base64: Add a bunch of tests, for the above.
* gl/lib/base64.c: Include .
(base64_decode_ctx_init, get_4, decode_4): New functions.
(base64_decode): Efficiently handle interspersed newlines.
(base64_decode_alloc): Update signature.
* gl/lib/base64.h (struct base64_decode_context): Define.
(base64_decode_ctx_init): Add prototype.
(base64_decode, base64_decode_alloc): Update prototypes.
* gl/lib/base64.c: Copied from gnulib.
* gl/lib/base64.h: Likewise.
2007-01-03 Jim Meyering
* THANKS: Add Evan Hunt.
2007-01-03 Bruno Haible
Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
* tests/chown/deref: Apply lang-default.
* tests/misc/split-a: Likewise.
* tests/mv/reply-no: Likewise.
* src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
Needed on MacOS X.
2007-01-02 Paul Eggert
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.
2007-01-01 Jim Meyering
* tests/rm/fail-eperm: Revert last change. The PATH=... setting
is not honored at least on HP-UX 11.23 systems.
Instead, simply transform the actual output diagnostic.
Test failure reported by Bob Proulx.
2006-12-30 Jim Meyering
* bootstrap (gnulib_extra_files): Remove announce-gen.
* bootstrap.conf (gnulib_modules): Add it here instead, now that
it's a module.
* tests/misc/base64: Factor a long, repetitive string.
* src/c99-to-c89.diff: Adjust remove.c offsets.
Clean up after the change of 2006-12-28.
* 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.
* tests/rm/fail-eperm: Avoid spurious differences (the error function
from latest glibc no longer prints the full program_name): so don't
invoke rm via ../../src/rm. Instead, invoke it via "PATH=../../src rm".
* tests/mv/acl (skip): Skip this test also if the destination
directory, which is on a different file system, lacks ACL support.
* src/copy.c (copy_reg): Rewrite a comment that was rendered
inaccurate by the 2006-10-18 change.
2006-12-28 Jim Meyering
When moving "up" the hierarchy, be careful to remove a just-emptied
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:
2006-12-27 Jim Meyering
* src/tail.c (usage): Mention +N for --bytes and --lines.
Suggestion from Evan Hunt.
2006-12-26 Jim Meyering
* configure.ac: Require autoconf-2.61 and automake-1.10.
Without the former (even with autoconf-2.60), "make distcheck"
would fail (without the 2006-09-26 autoconf AC_CHECK_DECL fix),
due to an inttypes.h generated with CFLAGS including -pedantic.
With the old decl check, @HAVE_DECL_STRTOUMAX@ would be 0.
* Makefile.maint (VC-tag): Define, so as to gpg-sign each release
tag, using the release version number as the message.
(vc-dist): Use $(VC-tag), rather than "$(VC) tag".
2006-12-21 Paul Eggert
* 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-20 Jim Meyering
"rm -rf /etc/motd" (run by non-root) now prints a diagnostic.
* src/remove.c (remove_entry): Handle EACCES for a non-directory, too.
Don't let a non-directory get by with errno == EPERM, either.
Check the file type directly (using cached stat value), rather
than trying to guess it from errno values.
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.
"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 .
* NEWS: List this bug fix.
* THANKS: Mention him.
* tests/misc/cut: New file.
* tests/misc/Makefile.am (TESTS): Add cut.
2006-12-15 Jim Meyering
* tests/cp/open-perm-race: Correct the gdb-existence check.
Don't run either subsequent gdb command in a sub-shell.
Reported by Thomas Schwinge.
* THANKS: bring up to date.
2006-12-14 Paul Eggert
Make sure cp -p isn't too generous with file permissions.
* tests/cp/Makefile.am (TESTS): Add file-perm-race.
* tests/cp/file-perm-race: New file.
Ensure cp -pR --parents isn't too generous with parent permissions.
* tests/cp/Makefile.am (TESTS): Add parent-perm-race.
* tests/cp/parent-perm-race: New file.
2006-12-14 Jim Meyering
* tests/chgrp/default-no-deref: Don't assume that files are created
with the primary group by default. That's not true in a directory
with the set-GID bit set.
Don't hang when there's no input tty.
* tests/cp/open-perm-race: Skip this test if there is no
controlling input `terminal'.
Test for a hard-to-detect race fix, using gdb.
* tests/cp/open-perm-race: New file, to test for the
cp --preserve=ownership fix of 2006-12-06.
* tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir.
(TESTS): Add open-perm-race.
* 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.
* 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.
* NEWS: Mention the chmod fix induced by the 2006-12-11 change
to gnulib's m4/openat.m4.
2006-12-13 Andreas Schwab
Don't fail if mv/acl test succeeds.
* tests/mv/acl (skip): Check for acl support in the file system.
* tests/mv/Makefile.am (XFAIL_TESTS): Remove.
(TESTS_ENVIRONMENT): Pass CONFIG_HEADER.
2006-12-13 Paul Eggert
Remove some arbitrary restrictions on size fields, 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.
2006-12-13 Jim Meyering
* tests/chgrp/default-no-deref: New test.
* tests/chgrp/Makefile.am (TESTS): Add default-no-deref.
2006-12-12 Jim Meyering
* src/system.h (SETVBUF): Remove definition, now that the
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-09 Jim Meyering
* man/Makefile.am (.x.1): Make help2man use $(PACKAGE_STRING) as the
"source". I.e. "GNU coreutils 6.7".
* 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/.
* tests/uniq/Test.pm (test_vector): Skip the pipe-reading test
whenever uniq is expected to fail. This should catch the other case
[test #112] in which uniq emits "cat: write error: Broken pipe" on
some systems.
2006-12-08 Jim Meyering
Include bootstrap tool version info in the announcement form.
* Makefile.maint (gnulib_snapshot_date): Define.
(announcement): Use two new announce-gen options,
--bootstrap-tools and --gnulib-snapshot-date.
* Makefile.cfg (gnulib_dir): Set.
Post-release version change.
* NEWS: Add a line for 6.8-dirty.
* configure.ac (AC_INIT): Set new version string.
2006-12-07 Jim Meyering jim@meyering.net
Version 6.7.
* NEWS: Record release date. Remove '-pre' suffix.
* configure.ac (AC_INIT): Remove version string suffix.
2006-12-07 Jim Meyering
Make the output of "make check" more reproducible.
* tests/touch/empty-file: Use envvar-check, so "make check" doesn't
evoke diagnostics like this when COLUMNS=0 in the environment:
ls: ignoring invalid width in environment variable COLUMNS: 0
* tests/touch/no-rights: Likewise.
* tests/help-version: Likewise.
* tests/uniq/Test.pm: Don't perform the pipe-reading version of test
118, since it emits "cat: write error: Broken pipe" on some systems.
2006-12-06 Paul 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.
2006-12-06 Paul Eggert
* 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 Jim Meyering
Make the output of "make check" more reproducible.
* tests/misc/date-sec: Don't emit any diagnostic about sleeping.
2006-12-03 Paul Eggert
* src/install.c (install_file_in_file): Preserve time stamps
before changing owner or file mode bits, for consistency with
other coreutils programs.
2006-12-03 Jim Meyering
* tests/misc/date-sec: Output a fixed string.
* 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.
Reported by Mike Frysinger.
2006-12-02 Jim Meyering
* tests/du/basic: Generate 4KB file simply using printf, rather than
seq+head. This avoids a spurious "Broken pipe" diagnostic from seq.
2006-11-28 Jim Meyering
* tests/mv/no-target-dir: Detect a buggy rename syscall. If found,
skip this test. This happens at least on ia64 linux-2.4.19 w/ext3.
Reported by Matthew Woehlke.
* tests/mv/dir2dir: Also accept EBUSY.
Reported by Matthew Woehlke.
2006-11-27 Jim Meyering
* Makefile.maint (patch-check): Rewrite to diagnose failure.
* src/c99-to-c89.diff: Adjust shred.c offsets.
2006-11-26 Paul Eggert
Improve the check for departures from C89, and fix the departures
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-26 Mike Frysinger
Recognize new archive, audio and image formats.
Give audio files a separate color.
* 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 Jim Meyering
* Makefile.maint (patch-check): Compile patched sources with
CFLAGS='-Wdeclaration-after-statement -Werror', to ensure that
no violations remain.
* src/c99-to-c89.diff: Remove 3 bogus hunks.
* src/remove.c (fd_to_subdirp): Remove unused parameter, ds.
Update callers.
* src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c.
* src/rm.c (main): Remove unnecessary (assuming C99) braces.
2006-11-26 Paul Eggert
Port parts of the code to C89 to minimize the need for c99-to-c89.diff,
while trying to retain the readability of C99 as much as possible.
* src/remove.c (rm_1): Remove decl of local, fd_cwd.
Replace each of two uses with literal AT_FDCWD.
(cache_stat_init): Return its argument, for convenience.
Update the caller in remove_dir.
(AD_pop_and_chdir): Return prev_dir rather than storing through
a pointer argument. All uses changed.
(AD_ensure_initialized): New function.
(AD_mark_helper): Use it, to avoid the need for declaration
after statement.
(rm): Move cycle_check_init call into callee...
(rm_1): ...here.
Use an else clause in place of a "continue" statement.
(close_preserve_errno): Remove.
(fd_to_subdirp): Rewrite to avoid the need for decl after statement.
2006-11-25 Jim Meyering
* Makefile.am (EXTRA_DIST): Remove announce-gen from here, too.
2006-11-24 Theodoros V. Kalamatianos (tiny change)
* tests/du/inacc-dest: Skip this test when running as root.
2006-11-23 Jim Meyering
* announce-gen: Remove file. It's moving to gnulib.
* bootstrap: Pull it from gnulib/build-aux instead.
* Makefile.maint (announcement): Reflect move to ./build-aux.
* tests/du/deref-args: Use "printf %65536s x" to create a 64KB file,
rather than a pipeline that would sometimes evoke a diagnostic
like "seq: write error: Broken pipe".
* tests/help-version: Suppress dd transfer rate output.
* configure.ac (AC_INIT): Bump to 6.7-pre, not 6.6-pre.
2006-11-22 Jim Meyering
* announce-gen (print_news_deltas): Fix silly, but harmless typo:
change "(:?..." to "(?:..." in regexps.
Post-release version change.
* NEWS: Add a line for 6.7-pre.
* configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix.
Version 6.6.
* NEWS: Record release date. Remove "-pre" suffix.
* configure.ac (AC_INIT): Remove "-pre" suffix from version string.
* announce-gen: Remove unused --release-archive-directory option.
(print_news_deltas): Accept new adjective, "Noteworthy", in addition
to the old "Major".
Match version numbers in NEWS using tighter regular expressions.
(main): Require the --gpg-key-id=ID option.
* Makefile.maint (announcement): Don't use now-removed
--release-archive-directory=... option.
* NEWS: Mention the three noteworthy changes, all fixed via gnulib.
2006-11-21 Jim Meyering
* tests/rm/one-file-system: Upon setup failure (e.g., mount failure),
skip the test rather than failing. Reported by Michael Deutschmann.
* tests/rm/fail-eperm: Use the "(exit N); exit N" idiom,
rather than just "exit N".
Arrange for "make check-root" to run the new root-only test.
* tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid.
(all_t): Add t7.
2006-11-20 Jim Meyering
Add a root-only test for today's lib/idcache.c fix.
* tests/ls/nameless-uid: New file.
* tests/ls/Makefile.am (TESTS): Add nameless-uid.
(TESTS_ENVIRONMENT): Add PERL to the list.
2006-11-19 Jim Meyering
* tests/tail-2/assert-2: Mark as a very-expensive test, because I
find the 7-second sleep annoyingly long. Besides, this test is
probably far too specific and timing sensitive ever to trigger again.
* tests/tail-2/assert: Likewise.
Post-release version change.
* NEWS: Add a line for 6.6-pre.
* configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix.
Version 6.5.
* NEWS: Record release date. Remove "-cvs" suffix.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2006-11-18 Jim Meyering
"ln --backup f f" produces a misleading diagnostic:
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.
* NEWS: Mention this fix.
2006-11-16 Paul Eggert
* bootstrap.conf (gnulib_modules): Add sys_stat, since we use it
directly too.
* 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 Jim Meyering
* tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell
automake we're skipping this test), and give a diagnostic to tell
the user the same thing. Reported by Mike Grayson.
2006-11-16 Ralf Wildenhues
* man/Makefile.am (dist_man_MANS): Replace all optional manpages
with `$(MAN)', computed at configure time; also, list them ...
(optional_mans): ... in this new variable.
(max_aux, EXTRA_DIST): Ensure that we distribute all manpages.
2006-11-16 Jim Meyering
Help valgrind see that there is no leak in dd.c.
* 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.
* src/csplit.c (load_buffer): Plug an inconsequential leak.
2006-11-15 Jim Meyering
* .x-po-check: Exclude gl/ files. Otherwise, po-check would
complain that some of gl/lib/*.[ch] are not listed in POTFILES.in.
2006-11-14 Jim Meyering
* gl/m4/root-dev-ino.m4: Now that this is part of a real "module",
remove the now-unnecessary use of AC_LIBSOURCES.
Adapt to new version of gnulib-tool.
* gl/modules/root-dev-ino: New file.
* lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ...
* gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here.
* m4/root-dev-ino.m4: Move this file ...
* gl/m4/root-dev-ino.m4: ... to here.
* bootstrap.conf (gnulib_modules): Add root-dev-ino.
2006-11-13 Jim Meyering
* src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment.
From Paul Eggert.
Plug another technically-unimportant leak in sort.
* 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.
* src/sort.c (main): Plug a tiny memory leak.
Move declaration of local "minus" down to be nearer point of use.
2006-11-12 Jim Meyering
du would exit early, when encountering an inaccessible directory
Reported by Mike Frysinger, in
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831
* tests/du/inacc-dest: New test, based on an example from Mike Frysinger.
* tests/chgrp/no-x: Remove the "fts_read failed: ..."
diagnostic from the expected output when using native fdopendir.
* tests/chmod/no-x: Likewise.
* tests/du/no-x: Likewise.
* NEWS: Mention this bug fix.
* tests/du/Makefile.am (TESTS): Add inacc-dest.
* Makefile.maint (sc_cast_of_x_alloc_return_value): Add an exclusion
for xalloc.h itself.
Avoid false-positive when testing via valgrind.
* tests/mv/atomic: Grep strace output for a more specific pattern
than just "unlink", since that got a false positive when testing
under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0
* tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP.
2006-10-28 Jim Meyering
* Makefile.maint (patch-check): Make it easier to regenerate
the src/c99-to-c89.diff file. E.g., I do this:
make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff
* src/c99-to-c89.diff: Update to reflect new offsets in rm.c.
2006-10-26 Jim Meyering
* src/system.h (ftello): Add a compile-time check for the highly
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-25 Paul Eggert
* tests/chmod/c-option: When double-quoting part of a word, prefer
to double-quote the whole word. This is a bit easier to read (at
least for me), and in some cases it avoids a shell bug with Tru64
4.0 sh reported by Nelson H. F. Beebe. For example, instead of
"$abs_srcdir"/../setgid-check we now write
"$abs_srcdir/../setgid-check".
* tests/cp/cp-parents: Likewise.
* tests/du/inaccessible-cwd: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/install/basic-1: Likewise.
* tests/install/trap: Likewise.
* tests/misc/close-stdout: Likewise.
* tests/mkdir/concurrent-1: Likewise.
* tests/mkdir/p-1: Likewise.
* tests/mkdir/p-3: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
* tests/readlink/can-e: Likewise.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/unread3: Likewise.
* tests/touch/no-create-missing: Likewise.
* lib/.cvsignore: Add uinttostr.c.
2006-10-25 Jim Meyering
Portability to Tru64 V4.0.
* 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 Bruno Haible
* src/cat.c (infile): Add "const" to declaration.
* 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 Jim Meyering
* tests/sample-test: Update copyright year list to include only
the current year, since this is what I'll want in any new test.
2006-10-24 Jim Meyering
* src/c99-to-c89.diff: Update to reflect new offsets.
* NEWS: new feature: rm accepts new option: --one-file-system
Suggested by Steve McIntyre in .
* 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.
Don't let a failure in one test stop "make -k" from running the others.
* tests/Makefile.am (t1 t2 t3 t4 t5): New targets.
(check-root): Depend on them, rather than executing the five
commands in a single rule. Reported by Greg Schafer.
2006-10-23 Bob Proulx (tiny change)
* Makefile.maint (alpha beta major): Use a better log message for
the automatic commit of .prev-version.
2006-10-23 Jim Meyering
* tests/misc/pwd-long: Undo last change, since it made Perl invoke
pwd via a shell. Instead, ensure that the absolute name of the
pwd binary consists solely of reasonable characters.
Whoops. Don't exec the perl script. Otherwise, the sh-trap-based
clean-up code isn't run.
* NEWS: Add a line for 6.5-cvs.
* configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix.
2006-10-22 Jim Meyering
Version 6.4.
* NEWS: Record the 6.4 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
* Makefile.maint: Complete the adaptation to function with a working
directory that is using git (rather than cvs) for version control.
2006-10-22 Ralf Wildenhues
* tests/chmod/c-option: Double-quote instances of `$abs_srcdir'.
* tests/cp/cp-parents: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
* tests/sample-test: Quote variables containing absolute build
tree paths. In the cleanup trap, make sure `cd' succeeds before
`chmod'ing and `rm'ing the temporary files.
* tests/chgrp/basic: Likewise.
* tests/chgrp/deref: Likewise.
* tests/chgrp/no-x: Likewise.
* tests/chgrp/posix-H: Likewise.
* tests/chgrp/recurse: Likewise.
* tests/chmod/c-option: Likewise.
* tests/chmod/equal-x: Likewise.
* tests/chmod/equals: Likewise.
* tests/chmod/inaccessible: Likewise.
* tests/chmod/no-x: Likewise.
* tests/chmod/octal: Likewise.
* tests/chmod/setgid: Likewise.
* tests/chmod/umask-x: Likewise.
* tests/chmod/usage: Likewise.
* tests/chown/basic: Likewise.
* tests/chown/deref: Likewise.
* tests/chown/separator: Likewise.
* tests/cp/acl: Likewise.
* tests/cp/backup-1: Likewise.
* tests/cp/backup-dir: Likewise.
* tests/cp/backup-is-src: Likewise.
* tests/cp/cp-HL: Likewise.
* tests/cp/cp-deref: Likewise.
* tests/cp/cp-i: Likewise.
* tests/cp/cp-mv-backup: Likewise.
* tests/cp/cp-parents: Likewise.
* tests/cp/deref-slink: Likewise.
* tests/cp/dir-rm-dest: Likewise.
* tests/cp/dir-slash: Likewise.
* tests/cp/dir-vs-file: Likewise.
* tests/cp/fail-perm: Likewise.
* tests/cp/into-self: Likewise.
* tests/cp/link: Likewise.
* tests/cp/link-no-deref: Likewise.
* tests/cp/link-preserve: Likewise.
* tests/cp/no-deref-link1: Likewise.
* tests/cp/no-deref-link2: Likewise.
* tests/cp/no-deref-link3: Likewise.
* tests/cp/perm: Likewise.
* tests/cp/preserve-2: Likewise.
* tests/cp/r-vs-symlink: Likewise.
* tests/cp/same-file: Likewise.
* tests/cp/slink-2-slink: Likewise.
* tests/cp/sparse: Likewise.
* tests/cp/special-bits: Likewise.
* tests/cp/src-base-dot: Likewise.
* tests/cp/symlink-slash: Likewise.
* tests/dd/not-rewound: Likewise.
* tests/dd/skip-seek2: Likewise.
* tests/dd/unblock-sync: Likewise.
* tests/du/2g: Likewise.
* tests/du/8gb: Likewise.
* tests/du/basic: Likewise.
* tests/du/deref: Likewise.
* tests/du/deref-args: Likewise.
* tests/du/exclude: Likewise.
* tests/du/fd-leak: Likewise.
* tests/du/hard-link: Likewise.
* tests/du/inaccessible-cwd: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/du/long-sloop: Likewise.
* tests/du/no-deref: Likewise.
* tests/du/no-x: Likewise.
* tests/du/restore-wd: Likewise.
* tests/du/slash: Likewise.
* tests/du/slink: Likewise.
* tests/du/trailing-slash: Likewise.
* tests/du/two-args: Likewise.
* tests/fmt/long-line: Likewise.
* tests/install/basic-1: Likewise.
* tests/install/create-leading: Likewise.
* tests/install/d-slashdot: Likewise.
* tests/install/trap: Likewise.
* tests/ln/misc: Likewise.
* tests/ln/target-1: Likewise.
* tests/ls/color-dtype-dir: Likewise.
* tests/ls/dangle: Likewise.
* tests/ls/dired: Likewise.
* tests/ls/file-type: Likewise.
* tests/ls/follow-slink: Likewise.
* tests/ls/infloop: Likewise.
* tests/ls/inode: Likewise.
* tests/ls/m-option: Likewise.
* tests/ls/no-arg: Likewise.
* tests/ls/recursive: Likewise.
* tests/ls/rt-1: Likewise.
* tests/ls/stat-dtype: Likewise.
* tests/ls/stat-failed: Likewise.
* tests/ls/stat-vs-dirent: Likewise.
* tests/misc/cat-proc: Likewise.
* tests/misc/close-stdout: Likewise.
* tests/misc/csplit: Likewise.
* tests/misc/date-sec: Likewise.
* tests/misc/false-status: Likewise.
* tests/misc/head-c: Likewise.
* tests/misc/head-pos: Likewise.
* tests/misc/mknod: Likewise.
* tests/misc/nl: Likewise.
* tests/misc/nohup: Likewise.
* tests/misc/pathchk1: Likewise.
* tests/misc/printf: Likewise.
* tests/misc/printf-hex: Likewise.
* tests/misc/pwd-long: Likewise.
* tests/misc/shuf: Likewise.
* tests/misc/sort-rand: Likewise.
* tests/misc/split-a: Likewise.
* tests/misc/split-fail: Likewise.
* tests/misc/split-l: Likewise.
* tests/misc/stat-fmt: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/misc/wc-files0: Likewise.
* tests/mkdir/concurrent-1: Likewise.
* tests/mkdir/p-1: Likewise.
* tests/mkdir/p-2: Likewise.
* tests/mkdir/p-3: Likewise.
* tests/mkdir/p-slashdot: Likewise.
* tests/mkdir/p-thru-slink: Likewise.
* tests/mkdir/p-v: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
* tests/mkdir/t-slash: Likewise.
* tests/mv/acl: Likewise.
* tests/mv/atomic: Likewise.
* tests/mv/backup-dir: Likewise.
* tests/mv/childproof: Likewise.
* tests/mv/diag: Likewise.
* tests/mv/dir-file: Likewise.
* tests/mv/dir2dir: Likewise.
* tests/mv/dup-source: Likewise.
* tests/mv/hard-2: Likewise.
* tests/mv/hard-3: Likewise.
* tests/mv/hard-4: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/hard-verbose: Likewise.
* tests/mv/i-2: Likewise.
* tests/mv/i-3: Likewise.
* tests/mv/i-4: Likewise.
* tests/mv/i-5: Likewise.
* tests/mv/i-link-no: Likewise.
* tests/mv/into-self-4: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/no-target-dir: 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/perm-1: Likewise.
* tests/mv/reply-no: Likewise.
* tests/mv/trailing-slash: Likewise.
* tests/mv/update: Likewise.
* tests/od/od-N: Likewise.
* tests/od/x8: Likewise.
* tests/readlink/can-e: Likewise.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
* tests/readlink/rl-1: Likewise.
* tests/rm/cycle: Likewise.
* tests/rm/dangling-symlink: Likewise.
* tests/rm/deep-1: Likewise.
* tests/rm/dir-no-w: Likewise.
* tests/rm/dir-nonrecur: Likewise.
* tests/rm/dot-rel: Likewise.
* tests/rm/empty-inacc: Likewise.
* tests/rm/f-1: Likewise.
* tests/rm/fail-2eperm: Likewise.
* tests/rm/hash: Likewise.
* tests/rm/i-1: Likewise.
* tests/rm/i-no-r: Likewise.
* tests/rm/ignorable: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/interactive-always: Likewise.
* tests/rm/interactive-once: Likewise.
* tests/rm/ir-1: Likewise.
* tests/rm/isatty: Likewise.
* tests/rm/no-give-up: Likewise.
* tests/rm/r-1: Likewise.
* tests/rm/r-2: Likewise.
* tests/rm/r-3: Likewise.
* tests/rm/r-4: Likewise.
* tests/rm/readdir-bug: Likewise.
* tests/rm/rm1: Likewise.
* tests/rm/rm2: Likewise.
* tests/rm/rm3: Likewise.
* tests/rm/rm4: Likewise.
* tests/rm/rm5: Likewise.
* tests/rm/sunos-1: Likewise.
* tests/rm/unread2: Likewise.
* tests/rm/unread3: Likewise.
* tests/rmdir/fail-perm: Likewise.
* tests/rmdir/t-slash: Likewise.
* tests/shred/exact: Likewise.
* tests/shred/remove: Likewise.
* tests/sum/sysv: Likewise.
* tests/tail-2/append-only: Likewise.
* tests/tail-2/assert: Likewise.
* tests/tail-2/assert-2: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/tail-2/fflush: Likewise.
* tests/tail-2/infloop-1: Likewise.
* tests/tail-2/proc-ksyms: Likewise.
* tests/tail-2/start-middle: Likewise.
* tests/tail-2/tail-n0f: Likewise.
* tests/tee/basic: Likewise.
* tests/tee/dash: Likewise.
* tests/touch/fail-diag: Likewise.
* tests/touch/no-create-missing: Likewise.
* tests/touch/not-owner: Likewise.
* tests/touch/obsolescent: Likewise.
* tests/touch/read-only: Likewise.
* tests/touch/relative: Likewise.
2006-10-21 Jim Meyering
* NEWS: (cp --backup fix): Fix a typo.
* .gitignore: Remove some references to files in subdirectories.
* build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files.
* m4/.gitignore, po/.gitignore, src/.gitignore: Likewise.
* src/copy.c (copy_internal): Add a comment saying why we prefer
mknod over mkfifo.
Enable an fts optimization (call lstat only for directories,
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 Jim Meyering
* src/od.c (usage): Change description of default to use "-w16",
not the now-invalid "-w 16" syntax. From Dan Jacobson.
2006-10-19 Jim Meyering
* bootstrap: Add names to each .gitignore file (if it exists)
as well as to .cvsignore.
* Makefile.maint (po-check): This rule didn't detect the new use
of "gettext" (as opposed to the use of "_" everywhere else) in
lib/xstrtol.h. Adjust the grep regexp so that now it does.
2006-10-18 Paul Eggert
* src/copy.c (copy_reg): Rewrite slightly to avoid duplicate code
when opening dst_name.
(copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain
(SYSCALL) to test for failure in a system call.
* src/copy.c (copy_internal): Use mknod rather than mkfifo to copy
a fifo. This preserves the special mode bits on Solaris 10, which
is compatible with what Solaris 10 cp -R does.
* src/copy.c (copy_internal): Remove redundant and confusing local
variable src_type.
* src/copy.c (copy_internal): Don't pass mkdir a mode greater than
7777. This matches historical 'cp' behavior and avoids some
(though not all) implementation-defined behavior of mkdir.
* src/cp.c (make_dir_parents_private): Likewise.
* src/copy.c (copy_internal): Don't pass 'open' a mode greater
than 777. This is required by POSIX. It doesn't make any difference
in actual behavior on any host that I know of.
2006-10-17 Jim Meyering
* src/dd.c (usage): Use two spaces (not one) to separate the
"fdatasync" option string from its description, so help2man formats
the derived man page properly. Reported by Samuel Thibault
in .
2006-10-16 Jim Meyering
* .x-sc_trailing_blank: Remove names of files that are no longer
version-controlled.
2006-10-16 Paul Eggert
* src/groups.sh (version): Reword message to match the other programs.
Problem reported by Eric Blake.
2006-10-14 Jim Meyering
* Makefile.maint (headers_with_interesting_macro_defs): Define.
(.re-defmac, sc_always_defined_macros): New rules.
* src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions.
Instead, include "exit.h". This hereby retires the work-around for
"Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0".
* src/cksum.c (uint_fast32_t): Don't define.
Instead, include .
* src/pinky.c (S_IWGRP): Don't define.
It's already defined by "stat-macros.h" (included via system.h).
* Makefile.cfg: Remove cruft that's now handled via bootstrap.
* Makefile.maint: Likewise, remove these targets/rules/variables:
(local_updates, update, cvs-update, wget_files, get-targets): Remove.
(cvs_files, wget-update, automake_repo): Likewise.
Move the comment about cvsu to build-aux/vc-list-files,
where cvsu is actually used.
* Makefile.maint (cvs-update): Use $(CVS), not "cvs".
Work also when the working directory (with e.g. coreutils sources)
is version controlled with git, rather than CVS.
* bootstrap (CVS_only_file): Test for the existence of README-cvs,
rather than CVS.
In messages and comments, say e.g., "checked-out sources",
rather than "CVS sources".
(version_controlled_file): New function. Work for git as well as
for CVS. Don't use grep's -q option.
(slurp): Call it here, in place of CVS-specific code.
* 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
.
* tests/cp/backup-dir: New file. Test for the above.
* tests/cp/Makefile.am (TESTS): Add backup-dir.
2006-10-13 Jim Meyering
More chown/chgrp dereferencing-related fixes.
* src/chown-core.c (change_file_owner): Don't use fts_statp if
we're dereferencing symlinks.
Reverse conjuncts, so that we use dereference file_stats
(aka ent->fts_statp) only *after* we've confirmed that
chopt->affect_symlink_referent is true. Otherwise, we might
use ent->fts_statp uninitialized.
Don't turn on FTS_NOSTAT when dereferencing symlinks.
* tests/chown/deref: Update the expected diagnostic, now that
this test case (trying to use "chown --dereference ..." on a
dangling symlink) takes a different code path.
2006-10-13 Paul Eggert
Sync from Bison, as follows:
2006-10-01 Paul Eggert
Fix problems with translating English-language diagnostics.
* bootstrap: Fix bug introduced in recent bootstrap changes, with
respect to bison-runtime pot generation. The YY_ stuff
wasn't being captured.
2006-10-13 Jim Meyering
* src/chown-core.c (change_file_owner): Use fstatat, not stat,
now that we're using fts_open with FTS_CWDFD.
* tests/chgrp/posix-H: Add --preserve-root to an invocation of
chgrp, to exercise the above fix.
* NEWS: Mention the above.
* src/du-tests: Clean up a little, though it's still not portable.
* .vg-suppressions: Add 3 more for debian unstable.
* tests/ls/Test.pm: Remove long-unused file.
* Makefile.am (EXTRA_DIST): Add bootstrap.conf.
Suggestions from Bruno Haible.
2006-10-12 Ralf Wildenhues
* Makefile.am (THANKS-to-translators): Add missing $(srcdir).
(MAINTAINERCLEANFILES): Add .kludge-stamp.
* man/Makefile.am (MAINTAINERCLEANFILES): Typo $(dist_man_MANS)
instead of $(man_MANS).
2006-10-12 Ralf Wildenhues
* configure.ac: Avoid compiler warnings about default return
type in function definitions and unused variables in tests.
* src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed
if this is #defined.
2006-10-12 Jim Meyering
* configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming.
Call gl_INIT directly, rather than through the above.
2006-10-11 Paul Eggert
* bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
variable was sometimes used without being initialized. This
messed up the installation of the INSTALL file in some cases.
2006-10-11 Jim Meyering
* src/ls.c (usage): Correct description of -s, --size.
It works even without -l. Suggestion from Karl Berry.
2006-10-10 Paul Eggert
* src/ls.c (quote_name): Use initializer rather than memset to
initialize an object to zero. This is easier to read and is less
likely to introduce a runtime error due to a mixup. It causes
gcc -W to issue a warning, but you can work around this by
appending -Wno-missing-field-initializers.
* src/pathchk.c (portable_chars_only): Likewise.
* src/shred.c (main): Likewise.
* src/stty.c (main): Likewise.
* src/tr.c (card_of_complement): Likewise.
* src/wc.c (wc): Likewise.
2006-10-09 Paul Eggert
* src/sort.c (usage): Mention again that sort fields are origin 1.
* NEWS: Fix typo: iso-8602 -> iso-8601. Problem reported by
Bob Proulx.
* bootstrap (usage, main program, symlink_to_gnulib): Add option
--copy. Inspired by a suggestion from Bruno Haible.
2006-10-09 Jim Meyering
Avoid a compiler warning.
* src/pathchk.c (portable_chars_only): Initialize variable of type
mbstate_t via memset, rather than via '{0}'. Patch from Bruno Haible.
2006-10-06 Paul Eggert
Fix bug reported today by Mike Frysinger: mkdir -pv is logging the
wrong file name in some cases. Lars Wendler reported a bug in
my original fix.
* src/install.c (make_ancestor): New arg COMPONENT.
* src/mkdir.c (make_ancestor): Likewise.
* tests/install/basic-1: Check for install -Dv bug.
* tests/mkdir/Makefile.am (TESTS): Add p-v.
* tests/mkdir/p-v: New file, to test this bug.
2006-10-05 Paul Eggert
* src/chgrp.c: Don't include lchown.h; no longer needed.
* src/chown.c: Likewise.
* tests/ls/stat-dtype: Use a dynamic test to decide whether the
current file system has useful d_type info.
* src/dd.c (flags): noatime and nofollow now depend on
HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too.
(usage): Output info about noatime and nofollow only if
they are known to work.
* src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather
than O_NOFOLLOW, when testing whether it's possible to avoid a
race condition reliably.
2006-10-05 Jim Meyering
* src/c99-to-c89.diff: Update to reflect new offsets.
* tests/install/basic-1: Skip the latter part of this test if the
just-built dd binary is not readable. Otherwise, this test would fail
when binaries were created as root. Reported by Bauke Jan Douma in
.
2006-10-03 Paul Eggert
* src/system.h (ST_BLKSIZE): Ceiling at SIZE_MAX / 8 + 1, not at 4
MiB, since XFS hosts can legitimately have large values of
st_blksize. Problem reported by Tony Ernst in
.
2006-10-04 Jim Meyering
* src/remove.c (nonexistent_file_errno): Remove ENAMETOOLONG.
Paul Eggert pointed out that the specified file may exist,
in spite of such an errno value.
* tests/rm/Makefile.am (TESTS): Remove ignore-name-too-long.
* tests/rm/ignore-name-too-long: Remove file.
* NEWS: Update here, too.
2006-10-03 Jim Meyering
* tests/rm/fail-eperm: Report failure also if rm is terminated by
a signal.
* src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c
and one in shred.c -- that were added before coreutils-6.3.
Reported by Michael Deutschmann.
* src/c99-to-c89.diff: Update to reflect new offsets.
* src/remove.c (remove_entry): With -f, exit successfully in spite
of a missing file under some very unusual conditions (with errno
being any of ENOENT, ENOTDIR, ENAMETOOLONG).
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.
* bootstrap: Undo last change to this file, since now gnulib-tool
sticks with the automake default in generating dependencies.
* NEWS: Add a line for 6.4-cvs.
* configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix.
2006-09-30 Jim Meyering
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
* 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
* 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
* 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
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
* 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
* 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
* 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