1 2007-06-18 Paul Eggert <eggert@cs.ucla.edu>
3 A few more symlink-related fixes. Fix a bug triggered by cp
4 --parents and symlinks. Close some race conditions possible when
5 the destination replaces a newly-created file with a symlink.
6 * NEWS: Document that 'cp --parents' no longer mishandles
7 symlinks in file name components of source.
8 * src/copy.c (HAVE_LCHOWN): Default to false.
9 (lchown) [!defined HAVE_LCHOWN]: Define to chown, for convenience.
10 * src/cp.c (lchown) [!HAVE_LCHOWN]: Likewise.
11 * src/install.c (lchown [!HAVE_LCHOWN]: Likewise.
12 * src/copy.c (set_owner): Use lchown instead of chown, for safety
13 in case the file got replaced by a symlink in the meantime.
14 * src/cp.c (re_protect): Likewise.
15 * src/install.c (change_attributes): Likewise.
16 * src/copy.c (copy_internal): Use ordinary C rather than an #if.
17 * src/cp.c (lchown) [!HAVE_LCHOWN]: Define to chown, for convenience.
18 (struct dir_attr): Cache the entire struct stat of the directory,
19 rather than just its mode, so that we needn't stat the directory
20 twice (which can lead to races).
21 (re_protect): Don't use XSTAT as that's not appropriate in
22 this context (symlinks should be followed here). Instead, use
23 the cached stat value.
24 (make_dir_parents_private): Save dir's entire struct stat, not
26 * tests/cp/cp-parents: Add test to check against bug with
27 cp --parents and symlinks.
29 2007-06-18 Jim Meyering <jim@meyering.net>
31 Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
32 * bootstrap.conf (gnulib_modules): Add readlink-with-size.
33 Remove xreadlink and xreadlink-with-size.
34 * src/copy.c (copy_internal): Use mreadlink_with_size,
35 not xreadlink_with_size.
36 * src/ls.c (get_link_name): Likewise.
37 * src/readlink.c (main): Likewise.
38 * src/stat.c (print_stat): Likewise.
40 * README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out.
42 2007-06-16 Jim Meyering <jim@meyering.net>
44 Make chgrp and chown diagnostics consistent.
45 * src/chown.c (main): Emit the diagnostic before the file name,
46 not after it, to be consistent with chgrp's diagnostic.
47 * src/chgrp.c (parse_group): Emit a ":" between the diagnostic
49 Reported by Egmont Koblinger.
50 * THANKS: Add Egmont Koblinger.
52 2007-06-15 Paul Eggert <eggert@cs.ucla.edu>
54 Correct cp's handling of destination symlinks in some cases.
55 * NEWS: "cp" no longer considers a destination symlink to be the
56 same as the referenced file when copying links or making backups.
57 * src/copy.c (copy_reg): When following a symlink, use the
58 followed name in later chown etc. requests, so that the created
59 file is affected, rather than the symlink. Use O_NOFOLLOW on
60 source when not dereferencing symlinks; this avoids a race.
61 Preserve errno correctly when doing multiple open attempts on the
63 (copy_internal): Follow destination symlinks only when copying a
64 regular file and only when we don't intend to remove or rename the
65 destination first, regardless of whether following source
66 symlinks; this is because since POSIX and tradition (e.g.,
67 FreeBSD) say we should ordinarily follow destination symlinks if
68 the system calls would ordinarily do so.
69 * src/copy.h (struct cp_options): Add comment that 'dereference'
70 is only for source files.
71 * src/cp.c (usage): Note that --derereference etc. are only for
73 (make_dir_parents_private): Follow symlinks, regardless of whether
74 --dereference is specified, because these are destination symlinks.
75 * tests/cp/same-file: Adjust tests to match revised behavior.
76 Filter out perror output since it might vary from host to host.
77 Use sed alone instead of also using echo.
79 * doc/coreutils.texi (cp invocation): Document the behavior better when
80 the destination is a symlink. Clarify source versus destination
81 symlinks. Describe the new behavior for destination symlinks.
83 2007-06-15 Jim Meyering <jim@meyering.net>
85 * src/copy.c: Include "canonicalize.h".
86 (copy_reg): Use canonicalize_filename_mode to follow the symlink,
87 so that we can always open with O_EXCL and avoid a race.
89 2007-06-15 Jim Meyering <jim@meyering.net>
91 Don't include "quote.h" when it is not used.
92 * src/md5sum.c: Remove unnecessary inclusion of "quote.h".
93 * src/expr.c: Likewise.
94 * src/shred.c: Likewise.
95 * Makefile.maint (sc_prohibit_quote_without_use): New rule.
96 * src/c99-to-c89.diff: Adjust offsets.
98 2007-06-14 Paul Eggert <eggert@cs.ucla.edu>
100 Clarify what "cat" documentation means by "blank" lines.
101 * doc/coreutils.texi (cat invocation): "Blank" lines actually mean
103 * src/cat.c (usage): Say that "nonblank" means nonempty. Clarify
106 2007-06-13 Jim Meyering <jim@meyering.net>
108 rmdir: give better diagnostics
109 * src/rmdir.c (remove_parents): Give a more descriptive/consistent
110 diagnostic upon failure.
112 Suggestion from Joey Hess.
113 * THANKS: Add Joey Hess.
115 Don't include "quotearg.h" when it is not used.
116 * Makefile.maint (sc_prohibit_quotearg_without_use): New rule.
117 * src/cp.c: Don't include "quotearg.h". It wasn't used.
119 * README-hacking: List Gperf as a build-requirement, too.
120 Reported by Steve Ward.
122 2007-06-11 Jim Meyering <jim@meyering.net>
124 * README: Mention README-hacking, for whose who start from
125 cloned/checked-out sources rather than from a distribution tarball.
126 Reported by Steve Ward.
127 * THANKS: Add Steve Ward.
129 2007-06-10 Jim Meyering <jim@meyering.net>
131 bug-fix: cp would fail to write through a dangling symlink
132 * NEWS: Mention the bug fix.
133 * src/copy.c (copy_reg): When open fails with EEXIST, the destination
134 is lstat'able, and a symlink, call open again, but now without O_EXCL.
135 * tests/cp/thru-dangling: New file, to test for the above fix.
136 * tests/cp/Makefile.am (TESTS): Add thru-dangling.
137 * THANKS: Add Michael McLagan.
138 Bug report from Michael McLagan in <http://bugzilla.redhat.com/243588>.
140 2007-06-04 Paul Eggert <eggert@cs.ucla.edu>
142 * doc/coreutils.texi (Common options): Mention that -h and
143 --human-readable are equivalent to --block-size=human-readable.
144 Documentation problem reported by Steve Ward in
145 <http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00007.html>.
146 (du invocation): Use optSi rather than duplicating the macro's
147 contents (incorrectly, since we claimed a "B" was output).
149 2007-05-31 Jim Meyering <jim@meyering.net>
151 Pull printf-related code from gnulib, rather than using forked copy.
152 * bootstrap.conf (gnulib_modules): Don't avoid size_max and xsize
153 modules. While I dislike xsize-style overflow avoidance, maintaining
154 a forked version of e.g., vasnprintf.c was too much work.
156 2007-05-29 Jim Meyering <jim@meyering.net>
158 * src/dircolors.hin: Add screen-256color.
159 Suggested by sdl.web@gmail.com in <http://bugzilla.redhat.com/239266>.
161 2007-05-26 Jim Meyering <jim@meyering.net>
163 * TODO: Add an entry for comm --output-delimiter=STR
165 2007-05-25 James Youngman <jay@gnu.org>
167 wc: ignore multibyte-character decoding errors
168 * src/wc.c (wc): Don't issue an error message when mbrtowc
169 indicates that we have seen an invalid byte sequence. This
170 makes "wc /bin/sh" bearable (though the word and line counts
171 are likely not to be useful).
172 * NEWS: Mention the change.
174 2007-05-22 Jim Meyering <jim@meyering.net>
176 Check for an up-to-date copyright year in coreutils.texi.
177 * Makefile.maint (copyright-check): Also check for an up-to-date
178 copyright year in doc/$().texi, if that file exists.
179 * doc/coreutils.texi: Add 2007 to list of Copyright years.
180 Reported by Karl Berry.
182 cut: diagnose a range starting with 0 (-f 0-2) as invalid, and
183 give a better diagnostic for a field-number/offset of 0.
184 * NEWS: Mention the fix.
185 * src/cut.c (ADD_RANGE_PAIR): Add an explicit check.
186 Based on a patch from James Youngman.
187 * tests/misc/cut: Add tests for the above.
189 "cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"
190 Also, diagnose the '-' in "cut -f -" as an invalid range, rather
191 than interpreting it as the unlimited range, "1-".
192 * NEWS: Mention these changes.
193 * src/cut.c (set_fields): Don't interpret an accumulator "value"
194 of 0 as an unspecified range endpoint.
195 Give better diagnostics.
196 Adjust a comment so that it is true also for 64-bit size_t.
198 * tests/cut/Test.pm: Add tests for the above.
200 stty: fix a harmless syntax nit
201 * src/stty.c (visible): Use ";" as the statement terminator
202 between two assignments, not ",".
203 (integer_arg): Join an unnecessarily wrapped line.
205 2007-05-20 Jim Meyering <jim@meyering.net>
207 stty: diagnose an invalid hex value in 35-colon commmand-line argument
208 * NEWS: Mention this.
209 * src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions.
210 (recover_mode): Use those functions (not sscanf), to parse the
212 * tests/stty/invalid: New file. Test for the above.
213 * tests/stty/Makefile.am (TESTS): Add invalid.
214 * .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check.
215 Add tests/stty/invalid so we don't have to obfuscate the comment
216 about sscanf therein.
217 * Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the
220 * TODO: Remove some now-completed or no longer relevant items.
222 2007-05-19 Jim Meyering <jim@meyering.net>
224 Rename uses of futimens -> gl_futimens; glibc now declares the former.
225 * src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens.
226 * src/touch.c (touch): Likewise.
228 2007-05-18 Jim Meyering <jim@meyering.net>
230 * Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS)
231 for now, to avoid c89-check failure due to use of #include_next.
233 2007-05-15 Jim Meyering <jim@meyering.net>
235 Generate a dozen test-related Makefile.am files at bootstrap-time.
236 * README-hacking: Build-from-checkout now require Perl, too.
237 * bootstrap: Now that these generated Makefile.am files are no longer
238 under version control, they must be created at bootstrap time.
240 2007-05-14 Paul Eggert <eggert@cs.ucla.edu>
242 * man/chmod.x: Document chmod's behavior with setuid and setgid bits.
243 Remove misleading implication about leading zero. Problem
244 reported by Jan Engelhardt in
245 <http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00134.html>.
247 2007-05-13 Jim Meyering <jim@meyering.net>
249 Remove the generated tests/*/Makefile.am files from version control.
250 * tests/cut/Makefile.am: git-remove this generated file.
251 * tests/head/Makefile.am: Likewise.
252 * tests/join/Makefile.am: Likewise.
253 * tests/pr/Makefile.am: Likewise.
254 * tests/sort/Makefile.am: Likewise.
255 * tests/tac/Makefile.am: Likewise.
256 * tests/tail/Makefile.am: Likewise.
257 * tests/test/Makefile.am: Likewise.
258 * tests/tr/Makefile.am: Likewise.
259 * tests/uniq/Makefile.am: Likewise.
260 * tests/wc/Makefile.am: Likewise.
261 * .cvsignore, .gitignore: Ignore these generated files.
263 * src/.cvsignore, src/.gitignore: Add chcon here, ...
264 * .cvsignore, .gitignore: ... not here.
266 Test uniq's new --zero-terminated (-z) option.
267 * tests/uniq/Test.pm: When possible, create a "-z"-testing variant
268 of each existing test.
269 (2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman.
271 2007-05-12 James Youngman <jay@gnu.org>
273 Add -z option to uniq. Originally proposed by Egmont Koblinger.
274 * NEWS: Mention uniq's new option: --zero-terminated (-z).
275 * src/uniq.c: Add new option, --zero-terminated (-z), to make
276 uniq use the NUL byte as separator/delimiter rather than newline.
277 (check_file): Add a parameter: delimiter. Update caller.
278 Use readlinebuffer_delim in place of readlinebuffer everywhere.
279 (main): Handle the new option.
280 (usage): Describe new option the same way sort does.
281 * doc/coreutils.texi (uniq invocation): Describe the new option.
283 2007-05-07 Jim Meyering <jim@meyering.net>
285 * NEWS: Mention that last week's tr bug dates back to 1992.
287 2007-05-04 Jim Meyering <jim@meyering.net>
289 Avoid test failure when run with an unusual umask.
290 * tests/ls/color-dtype-dir: Set umask to 022.
291 Suggestion from AIDA Shinra.
293 Avoid failure of root-only test when run with a restrictive umask.
294 * tests/rm/no-give-up: Ensure that non-root can access "d/" through
295 root-owned ".". Reported by AIDA Shinra.
297 tr -c: don't abort when translating with S2 larger than complement of S1
298 * src/tr.c (main): Remove invalid assertion triggered by e.g.,
299 tr -c a '[b*256]'. There's nothing wrong with having Set2 larger
300 than Set1. Reported by Guntram Blohm.
301 * tests/tr/Test.pm (no-abort-1): Test for the above.
302 * NEWS: Mention this bug fix.
303 * THANKS: Add Guntram Blohm.
305 2007-05-03 Jim Meyering <jim@meyering.net>
307 Avoid test failure when run with a permissive umask.
308 * tests/rm/no-give-up: Set permissions of test directory properly,
309 i.e., not depending on umask prohibiting go=w.
310 Reported by AIDA Shinra.
312 2007-05-02 Paul Eggert <eggert@cs.ucla.edu>
314 The following commands and options now support the standard size
315 suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
316 head -c, head -n, od -j, od -N, od -S, split -b, split -C,
318 * doc/coreutils.texi (od invocation, head invocation, tail invocation):
319 Document support for new size suffixes.
320 (head invocation, tail invocation):
321 Document that -n uses the same suffixes as -c.
322 (tail invocation): More-clearly document what leading "+" does.
323 * src/head.c (usage, string_to_integer): Support new suffixes.
324 * src/od.c (usage, main): Likewise.
325 * src/split.c (usage, main): Likewise.
326 * src/tail.c (usage, parse_options): Likewise.
327 Prompted by a patch from Evan Hunt.
329 2007-05-02 Jim Meyering <jim@meyering.net>
331 * src/du.c (usage): Tweak description of --dereference-args (-D) again.
332 Prompted by another request for clarification from Justin Pryzby.
334 Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm.
335 * tests/rm/fail-2eperm: Patch from AIDA Shinra.
336 Reported by Peter Dyballa.
337 * THANKS: Add AIDA Shinra and Peter Dyballa.
339 2007-04-28 Paul Eggert <eggert@cs.ucla.edu>
341 * src/nohup.c (usage): Describe how standard input and output
344 2007-04-25 Jim Meyering <jim@meyering.net>
346 * src/du.c (usage): Clarify description of --dereference-args (-D).
347 Prompted by a report from Justin Pryzby.
349 * bootstrap.conf (gnulib_modules): Add fseeko and ftello.
350 (gnulib_modules): Add autobuild.
352 2007-04-24 Jim Meyering <jim@meyering.net>
354 * THANKS: Add Andreas Frische.
355 * NEWS: Mention today's ls --color fix.
356 * tests/ls-2/tests (sl-dangle): Add a test for today's fix.
358 2007-04-24 Eric Blake <ebb9@byu.net>
360 ls --color once again colors dangling symlinks correctly
361 * src/ls.c (gobble_file): Much like the 2007-04-07 fix,
362 add a term to the expression that decides whether we need
363 stat and/or lstat calls. Reported by Andreas Frische.
365 2007-04-16 Jim Meyering <jim@meyering.net>
367 * src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
368 Reported by Rudolf Kastl.
369 * THANKS: Add Rudolf Kastl.
371 2007-04-11 Paul Eggert <eggert@cs.ucla.edu>
373 split --line-bytes=N (-C N): don't create an empty file.
374 * src/split.c (line_bytes_split): Don't create an empty line
375 afterwards if the last buffer happens to be exactly full.
376 * tests/misc/split-fail: Add a test case for this.
377 * NEWS: mention this.
379 2007-04-10 Jim Meyering <jim@meyering.net>
381 ls: don't form or compute the length of strings that won't be used.
382 * src/ls.c (gobble_file): Form and compute length of strings for
383 block size, owner, group, author, major+minor numbers and file size
384 only if they'll actually be used. I.e., don't form most of them
385 when not producing long format output.
387 2007-04-07 Jim Meyering <jim@meyering.net>
389 Add a test for, and document, today's fix.
390 * NEWS: Mention today's ls --color fix.
391 * tests/ls-2/tests (sl-target): Add a test for today's fix.
392 * THANKS: Add Kirk Kelsey.
394 2007-04-07 Eric Blake <ebb9@byu.net>
396 Fix a bug in how the LS_COLORS ln=target attribute is handled.
397 * src/ls.c (gobble_file): Use "stat" (not lstat) also when the
398 ln=target attribute applies. Reported by Kirk Kelsey.
400 2007-04-02 Jim Meyering <jim@meyering.net>
402 * src/copy.c (copy_reg): Initialize local "con", before calling
403 getfscreatecon, in case that function (or its inline stub) does
406 2007-04-01 Paul Eggert <eggert@cs.ucla.edu>
408 * src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
409 ls -x DIR would sometimes output the wrong string in place of the
411 * NEWS: Mention the bug fix.
412 * tests/ls/x-option: New file.
413 * tests/ls/Makefile.am (TESTS): Add x-option.
415 gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt
416 * bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of
417 md5 to crypt/md5 and sha1 to crypt/sha1.
419 2007-03-30 Jim Meyering <jim@meyering.net>
421 * NEWS: Mention these SELinux changes.
423 * ChangeLog-selinux: Remove file.
424 Move its contents into this file, removing old dates.
426 * src/runcon.c (main): Don't reorder arguments. Reported by
427 Ulrich Drepper in <http://bugzilla.redhat.com/232652>.
428 * tests/misc/runcon-no-reorder: New file. Test for the above.
429 * tests/misc/Makefile.am (TESTS): Add runcon-no-reorder.
431 * src/runcon.c (main): Remove "." at end of a diagnostic.
433 * src/runcon.c: New program.
434 * src/Makefile.am (bin_PROGRAMS): Add runcon.
435 (runcon_LDADD): Define.
436 * README: Add runcon to the list of programs.
437 * AUTHORS: Add this: runcon: Russell Coker
438 * tests/help-version: Add runcon as an exception.
439 * man/Makefile.am (dist_man_MANS): Add runcon.1.
440 (runcon.1): New dependency.
442 mkfifo, mknod: Accept new "-Z, --context=C" option.
443 * src/mkfifo.c, src/mknod.c: Include <selinux/selinux.h>.
445 * src/Makefile.am (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX).
447 mkdir: Accept new "-Z, --context=C" option.
448 * src/mkdir.c: Include <selinux/selinux.h>.
450 * src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX).
452 * tests/cp/cp-a-selinux: New file. Test for the bug reported in
453 <http://bugzilla.redhat.com/219900>.
454 * tests/cp/Makefile.am (TESTS): Add cp-a-selinux.
456 * tests/selinux: New file.
457 * tests/Makefile.am (EXTRA_DIST): Add selinux.
458 * tests/misc/selinux: Source the new script, rather than open coding it.
460 Change how "cp -a" and "cp --preserve=context" work with SELinux.
461 Now, cp -a attempts to preserve context, but failure to do so does
462 not change cp's exit status. However "cp --preserve=context" is
463 similar, but failure *does* cause cp to exit with nonzero status.
464 * src/copy.h (struct cp_options) [require_preserve_context]: New member.
465 * src/copy.c (copy_reg, copy_internal): Implement the above.
466 * src/mv.c (cp_option_init): Initialize the new member.
467 * src/install.c (cp_option_init): Likewise.
468 * src/cp.c (cp_option_init): Likewise.
469 (decode_preserve_arg): Set it or reset it.
471 cp, mv, install: add SELinux support, but unlike with the Red Hat
472 patch, mv and cp do not provide the "-Z context" option.
473 * src/copy.c: Include <selinux/selinux.h>.
474 (restore_default_fscreatecon): New function.
475 (copy_reg): Make cp --preserve=context work for existing destination.
476 (copy_internal): Likewise for new destinations.
477 * src/copy.h (cp_options) [preserve_security_context]: New member.
478 * src/cp.c: Include <selinux/selinux.h>.
479 (selinux_enabled): New global.
480 (usage): Mention new --preserve=context option.
481 (PRESERVE_CONTEXT): Define/use.
482 (decode_preserve_arg): Handle PRESERVE_CONTEXT.
483 (main): Remove an obsolete comment.
484 If --preserve=context is specified on a system without SELinux
485 enabled, give a diagnostic and fail.
486 * src/mv.c: Include <selinux/selinux.h>.
487 Set x->preserve_security_context if SELinux is enabled.
488 * src/install.c: Accept new "-Z, --context=C" option.
489 Accept --preserve-context option (but not -P option).
490 Accept alternate spelling: --preserve_context, for now.
491 Include <selinux/selinux.h> and "quotearg.h".
492 (selinux_enabled, use_default_selinux_context): New globals.
493 (PRESERVE_CONTEXT_OPTION): Define.
494 (cp_option_init): Default: do not preserve security context.
495 (setdefaultfilecon): New function.
496 (main): Honor new options.
497 * src/Makefile.am (mv_LDADD, cp_LDADD, ginstall_LDADD):
499 * src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define.
501 * tests/misc/selinux [VERBOSE]: Print version info for each
502 of the tested tools, not just ls.
504 * src/c99-to-c89.diff: Remove the ls.c patch, now that I've
505 temporarily removed the offending c99'ism.
507 * src/chcon.c (usage): Split a string literal that was longer than 509.
509 * src/ls.c (gobble_file): Don't call getfilecon unless print_scontext.
510 Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA.
512 * src/c99-to-c89.diff: Adjust offsets.
514 * AUTHORS: Add chcon.
516 * src/c99-to-c89.diff: Remove trailing blanks.
518 * src/chcon.c: Don't include "dirname.h". system.h already includes it.
520 * gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H.
522 * src/c99-to-c89.diff: Handle a new c99'ism in ls.c.
524 * src/id.c (main): Tweak id -Z diagnostic.
526 id: Add SELinux support: -Z option.
527 * src/id.c (main): Apply patches from Fedora, with these changes:
528 Remove #ifdef WITH_SELINUX.
529 Use error (EXIT_FAILURE, not fprintf+exit(1).
530 * src/Makefile.am (id_LDADD): Define, so as to add $(LIB_SELINUX).
532 stat: Add support for SELinux in the form of a %C format directive.
533 * src/stat.c (follow_links): Make this variable file-global.
534 (out_file_context): New function.
535 (print_statfs): Honor %C.
536 (print_stat): Honor %C.
537 (do_stat): Remove follow_links parameter.
538 (usage): Document the two %C directives.
539 (main): Accept -Z (though it's a no-op).
540 * src/Makefile.am (stat_LDADD): Define.
542 ls: Add support for SELinux and a slightly modified -Z option.
543 I started with the patches from Red Hat.
544 The entries below tell how the code evolved.
546 * src/ls.c (print_long_format, print_file_name_and_frills): When
547 there is no security context (due to getfilecon/lgetfilecon failing
548 with e.g. ENOTSUP), print it as "?", not "".
549 * src/ls.c (print_file_name_and_frills): Make -Z work without -l.
550 (length_of_file_name_and_frills): Likewise.
552 * src/ls.c: Remove the --lcontext and --scontext options.
553 Change the way -Z, --context work so that it no longer implies -l.
554 Thus, -Z -l will work like -lcontext and -Z without -l will work
557 Adjust tests to reflect new 'ls -l' syntax -- affects only
558 systems with SELinux when operating on a file with no ACL.
559 These tests assumed that everything before the first space on
560 each line is the 10-byte mode string. But there may also be a "+"
561 in the 11th column, just before the space. However, note that this
562 is not new. The same thing would have happened even without the
563 change below, when listing a file with an ACL.
564 * tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm:
565 * tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod:
566 * tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm:
568 Don't make compilation depend on USE_ACL. An SELinux security
569 context counts as an "alternate access control method", so ls
570 must output a "+" for each file with a security context.
571 * src/ls.c [struct fileinfo] (have_acl): Declare unconditionally.
572 (FILE_HAS_ACL): Remove macro definition. Use f->have_acl directly.
573 (gobble_file): Record whether a file has a security context, and
574 update the condition used to determine whether to print the "+".
575 (gobble_file): Call getfilecon/lgetfilecon also when
576 format == long_format, so that we get the "+".
578 * src/ls.c (gobble_file): Add a comment explaining why (with a
579 security context option) ls doesn't exit nonzero due to e.g.,
580 getfilecon failing with errno == ENOTSUP.
582 * src/ls.c (gobble_file): Ignore failure of getfilecon if it's due
585 * src/ls.c (gobble_file): Factor out three small blocks using
586 getfilecon and lgetfilecon.
587 Don't ignore return value from getfilecon and lgetfilecon.
589 * src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C
591 (print_scontext_format): Likewise.
592 (print_scontext): Declare to be "bool", not int. Adjust uses.
594 * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX).
596 * tests/misc/chcon: New file.
597 * tests/misc/chcon-fail: New file.
598 * tests/Makefile.am (check-root): Run new, root-only misc/chcon test.
599 * tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail.
601 * tests/misc/Makefile.am (TESTS): Add selinux.
602 * tests/misc/selinux: New file.
603 * tests/help-version: Skip chcon.
604 * man/chcon.x: New file.
605 * man/Makefile.am: Build chcon.1.
608 * gl/modules/selinux-at: New module. Check for libselinux and set
609 LIB_SELINUX here, unconditionally, rather than depending on
610 the configure-time --enable-selinux option.
611 * gl/modules/selinux-h: New module.
612 * bootstrap.conf (gnulib_modules): Add selinux-at.
613 * gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files.
614 * gl/lib/se-selinux_.h: New file.
615 * gl/lib/se-context_.h: New file.
616 * gl/m4/selinux-selinux-h.m4: New file.
617 * gl/m4/selinux-context-h.m4: New file.
618 * src/Makefile.am (bin_PROGRAMS): Add chcon.
619 (chcon_LDADD): Define.
620 * README: Add chcon to the list of programs.
621 * src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
623 2007-03-29 Jim Meyering <jim@meyering.net>
625 * .vg-suppressions: Add libc-getpwuid-leak.
627 2007-03-28 Jim Meyering <jim@meyering.net>
629 Help translators include translation team's web or email address.
630 * src/system.h (emit_bug_reporting_address): New function.
631 * src/base64.c: Use it rather than a literal printf.
632 * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
633 * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
634 * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
635 * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
636 * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
637 * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
638 * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
639 * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
640 * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
641 * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
642 * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
643 * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
644 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
645 * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
646 * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
647 * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
648 * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
649 * src/who.c, src/whoami.c, src/yes.c: Likewise.
651 * src/stty.c: Don't include "vasprintf.h", now that its
652 declarations are guaranteed to be in gnulib's stdio.h.
653 * src/who.c: Likewise.
655 2007-03-27 Jim Meyering <jim@meyering.net>
657 * README: Use "install", not "ginstall" in the list of program names.
658 * src/Makefile.am (check-README): Substitute s/ginstall/install/.
660 2007-03-25 Jim Meyering <jim@meyering.net>
662 * src/c99-to-c89.diff: Regenerate.
664 2007-03-25 Paul Eggert <eggert@cs.ucla.edu>
666 Avoid the need for euidaccess and/or lstat on every directory entry
667 with 'rm -r dir' (without -f), if we are root, or if we are removing
668 a directory tree that is full of symbolic links.
669 * bootstrap.conf (gnulib_modules): Add write-any-file.
670 * src/copy.c: Include write-any-file.h.
671 (UNWRITABLE): Remove macro, replacing with....
672 (writable_destination): New function, which uses can_write_any_file
673 to avoid the need for euidaccess when we are privileged.
674 (overwrite_prompt, abandon_move): Use it.
675 * src/remove.c: Include write-any-file.h.
677 (DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros.
678 (write_protected_non_symlink): Don't bother to stat if we can write
680 (prompt): New arg PDIRENT_TYPE. All callers changed.
681 Use readdir dirent type to avoid the need for 'lstat' on each directory
682 entry in cases like 'rm -r dir', if we are root, or if the tree is
683 full of symbolic links.
684 (DT_IS_KNOWN, DT_MUST_BE): Remove.
685 (remove_entry): New arg DIRENT_TYPE_ARG. All callers changed.
687 2007-03-24 Jim Meyering <jim@meyering.net>
689 If strace malfunctions, skip the test rather than failing it.
690 * tests/mv/atomic: Required on a mips-unknown-linux-gnu system
691 running the aging linux-2.4.27-mipscvs-20040814.
693 2007-03-23 Paul Eggert <eggert@cs.ucla.edu>
695 * src/pathchk.c: Don't include euidaccess.h, as we don't call
698 2007-03-23 Jim Meyering <jim@meyering.net>
700 * README-package-renamed-to-coreutils: Add a URL for the FAQ,
701 and a couple more archive links.
703 2007-03-22 Jim Meyering <jim@meyering.net>
705 Post-release version change.
706 * NEWS: Add a line for 6.9+.
707 * configure.ac (AC_INIT): Set new version string.
710 * NEWS: Record release date and new version number.
711 * configure.ac (AC_INIT): New version number.
713 * tests/mv/hard-3: Correct the preceding change: $3 -> $2.
715 2007-03-22 Paul Eggert <eggert@cs.ucla.edu>
717 Improve a test script.
718 * tests/mv/hard-3: Check for 'ls' failure, too.
719 Generate more-useful debugging output when 'ls' fails.
721 2007-03-21 Jim Meyering <jim@meyering.net>
723 Fix a test script not to claim an ext2 file system is of type xfs.
724 * tests/du/slink: When using df --local and df --type=TYPE,
725 test only the exit code. Don't bother with stdout.
726 Prompted by a report by Thomas Schwinge of an inaccurate diagnostic.
728 * gl/lib/savewd.c: Remove this file, since the savewd_save change
729 is now in gnulib. The other wasn't useful.
731 2007-03-20 Jim Meyering <jim@meyering.net>
733 * gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it.
735 Skip part of this test when "." is not a local file system.
736 * tests/install/basic-1: Otherwise, it would fail on some NFS
738 * tests/mkdir/p-3: Likewise.
740 2007-03-19 Paul Eggert <eggert@cs.ucla.edu>
742 * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD):
743 Add $(LIB_ACL_TRIVIAL).
745 2007-03-18 Jim Meyering <jim@meyering.net>
747 Fix a generic NFS-related test failure.
748 * tests/mkdir/p-3: When setting up an unreadable "." in an
749 inaccessible parent, make the parent inaccessible *after* making "."
750 unreadable. Otherwise, running "chmod a-r ." in an already-
751 inaccessible parent would fail on NFS with "Stale NFS file handle".
753 Fix a bug in how pr -m -s works.
754 * NEWS: Describe how the fix affects pr.
755 * src/pr.c (init_parameters): The --merge (-m) option does
756 not imply --expand-tabs (-e), so don't set "untabify_input".
757 Reported by Wis Macomson.
758 * tests/misc/pr: New file. Test for the above fix.
759 * tests/misc/Makefile.am (TESTS): Add pr.
762 2007-03-17 Jim Meyering <jim@meyering.net>
764 Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
765 * bootstrap: Put ""s around use of $build_aux, in case
766 someone uses a name containing shell meta-characters.
767 Reported by Alfred M. Szmidt.
768 * tests/misc/tty-eof: Add shuf to the list of tested commands.
770 Avoid test failure on NFS-mounted Solaris ZFS file system.
771 * tests/du/basic: Skip a test if "." is on a non-local file system.
773 Avoid an obscure build failure, prefer waitpid over wait.
774 * src/install.c (strip): Use waitpid, not wait. It's equivalent,
775 but feels less obsolescent.
777 * bootstrap: Don't use \> in grep regexp. For HP-UX.
779 2007-03-16 Jim Meyering <jim@meyering.net>
781 Begin adding support for Solaris ZFS (4 entries per trivial ACL)
782 * gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro.
783 (file_has_acl, copy_acl): Use it, rather than enumerating errno values.
784 (is_trivial_acl): New function. Incomplete, for now.
785 (file_has_acl, copy_acl): Use the new function, rather than
786 counting the number of entries in an ACL.
788 * bootstrap: Update from gnulib.
790 * .x-sc_prohibit_atoi_atof: Add TODO here, too.
792 2007-03-16 Paul Eggert <eggert@cs.ucla.edu>
794 * src/copy.c: Include filemode.h.
795 (overwrite_prompt): Say "try to overwrite", not "overwrite", to
796 make it clearer that the attempt may fail. Problem reported by
798 http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html
799 Output symbolic mode as well as numeric.
800 * tests/mv/i-2 (fail): Adjust to new prompt format.
802 2007-03-15 Jim Meyering <jim@meyering.net>
804 Enforce policy: don't use *scanf functions.
805 * Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic.
806 * .x-sc_prohibit_atoi_atof: Give stty a temporary pass.
807 * TODO: note that stty.c needs this small clean-up.
809 2007-03-13 Jim Meyering <jim@meyering.net>
811 Prepare to work on ACL-related failure when using Solaris ZFS.
812 * gl/lib/acl.c: New file, copied from gnulib.
814 Work around a failing test due to an NFS-based race condition.
815 * tests/cp/sparse: Accept a report that the copy is *smaller*.
817 2007-03-12 Jim Meyering <jim@meyering.net>
819 Make bootstrap.conf a tiny bit more generic.
820 * bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4
821 files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac.
823 2007-03-10 Jim Meyering <jim@meyering.net>
825 Try to fix today's NFS-related failure: Treat ESTALE like EACCES.
826 * gl/lib/savewd.c: Copy this file from gnulib, then change
827 "errno != EACCES" to (errno != EACCES && errno != ESTALE).
828 The symptom was this failure in tests/install/basic-1:
829 ginstall: cannot create directory `rel/a': Stale NFS file handle
831 The preceding change solved part of the problem. Now ginstall fails.
832 * tests/install/basic-1: Temporarily, don't redirect ginstall's
833 stderr to /dev/null, so I can see why the NFS autobuilder's NFS test
836 * tests/install/basic-1: When setting up an unreadable "." in an
837 inaccessible parent, make the parent inaccessible *after* making "."
838 unreadable. Otherwise, running "chmod a-r ." in an already-
839 inaccessible parent would fail on NFS with "Stale NFS file handle".
840 Reported by Bob Proulx.
842 * Makefile.maint (po-check): Exclude c99-to-c89.diff.
844 2007-03-09 Jim Meyering <jim@meyering.net>
846 Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9)
847 * tests/chgrp/basic: Don't let failure by chgrp to set the
848 group of a symlink make this test fail. Do give a diagnostic.
849 In the chgrp-no-change-ctime test, add darwin7.9.0 as another
850 known-failing system.
851 When failing on some other system, print $host_triplet, too.
852 Also avoid test failures on Darwin 8.8.x (MacOS X 10.4).
853 Reported by Peter Fales.
855 2007-03-08 Jim Meyering <jim@meyering.net>
857 * src/c99-to-c89.diff: Reflect the new c99'ism, update offsets.
859 2007-03-08 Paul Eggert <eggert@cs.ucla.edu>
861 rm without -f: give a better diagnostic when euidaccess fails.
862 * src/remove.c (write_protected_non_symlink): Return int, not bool,
863 so that we can indicate failure too (as a postive error number).
864 (prompt): If write_protected_non_symlink fails, report that error
865 number and fail rather than charging ahead and removing the dubious
866 entry. Redo the logic of printing a diagnostic so that we need to
867 invoke quote (full_filename (...)) only once. More details at:
868 <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9952/focus=9996>
870 2007-03-08 Jim Meyering <jim@meyering.net>
872 Generalize a few more cvs-isms.
873 * bootstrap (checkout_only_file): Rename from CVS_only_file.
874 Change comments and diagnostics not to say "CVS".
876 * bootstrap: Run libtool, if necessary.
878 Make bootstrap a little more general.
879 * bootstrap (build_aux): Factor out/use this definition.
880 Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac.
881 (insert_sorted_if_absent): Move function definition "up", to
882 precede new first use.
883 If $build_aux/ doesn't exist initially, create it, and
886 2007-03-03 Andrew Church <achurch@achurch.org> (tiny change)
887 Paul Eggert <eggert@cs.ucla.edu>
889 Fix a bug: cp -x would fail to set mount point permissions.
890 * NEWS: mention cp -x bug fix
891 * src/copy.c (copy_internal): Don't return immediately after
892 copying a mount point that we do not intend to recurse under.
893 Based on a patch by Andrew Church.
895 2007-03-03 Jim Meyering <jim@meyering.net>
897 pwd-unreadable-parent: Skip test on ia64/Linux, too.
898 * tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD.
899 Reported by Bob Proulx.
901 2007-03-02 Jim Meyering <jim@meyering.net>
903 pwd-unreadable-parent: Skip test on non-Linux/GNU systems.
904 * tests/misc/pwd-unreadable-parent: Rather than trying to decide
905 whether this test has a chance of succeeding, run it only when
906 $(host_os) is linux-gnu. It was failing on powerpc-apple-darwin8.8.0
907 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os).
909 * tests/misc/pwd-long: Also allow "+" in $PWD.
911 Remove another coreutils-ism. Formatting cleanup.
912 * Makefile.maint (my-distcheck): Update an outdated comment.
913 (emit_upload_commands): Use $(PACKAGE) rather than "coreutils".
914 (my-distcheck): Skip the c99/c89 check if there's no such .diff file.
916 2007-03-01 Jim Meyering <jim@meyering.net>
918 * Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O".
919 (my-distcheck): Use the new variable, instead of too-long literal.
921 Make "make syntax-check" rules less coreutils-specific.
922 * Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT.
923 (sc_cast_of_alloca_return_value): Likewise.
924 (sc_root_tests): Do nothing if there is no check-root target
925 in tests/Makefile.am.
927 Run the writable-files check only for release-building targets.
928 * Makefile.maint (local-checks-available): Remove writable-files.
929 (alpha beta major): Put it here, instead.
931 "make syntax-check" now runs only Makefile.cfg-selected tests
932 * Makefile.maint (syntax-check-rules): Hoist this definition so that
933 it precedes the indirect use in the definition of $(local-check).
934 (local-check): Use :=, not just "=".
935 (syntax-check): Depend on $(local-check), not $(syntax-check-rules).
937 2007-02-28 Bruno Haible <bruno@clisp.org>
939 * bootstrap.conf (gnulib_modules): Replace xreadlink with
940 xreadlink-with-size. Add xreadlink.
941 * src/copy.c (copy_internal): Update.
942 * src/ls.c (is_directory): Update.
943 * src/stat.c (print_stat): Update.
944 * src/readlink.c (main): Use the one-argument xreadlink function.
946 2007-02-28 Paul Eggert <eggert@cs.ucla.edu>
948 * doc/coreutils.texi (Common options): --si outputs "M", not "MB".
949 Problem reported by Philip Rowlands in
950 <http://lists.gnu.org/archive/html/bug-coreutils/2007-02/msg00283.html>.
952 2007-02-28 Jim Meyering <jim@meyering.net>
954 * .x-sc_file_system: Add the new test, tests/misc/df-P, to this
955 list of exceptions, for the "make distcheck" sc_file_system rule.
957 * Makefile.maint (gnulib_snapshot_date): Remove now-unused definition.
959 2007-02-27 Paul Eggert <eggert@cs.ucla.edu>
961 Make df -P immune to effects of e.g., the BLOCK_SIZE envvar.
962 * NEWS: With -P, the default block size and output format is not
963 affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE.
964 * src/df.c (main): Implement this.
966 2007-02-27 Jim Meyering <jim@meyering.net>
968 Add a test for the above.
969 * tests/misc/df-P: New file.
970 * tests/misc/Makefile.am (TESTS): Add df-P.
972 2007-02-25 Jim Meyering <jim@meyering.net>
974 * Makefile.maint (announcement): Adjust so that it works with
975 announce-gen's --gnulib-snapshot-time-stamp option.
976 Indent one of the command lines using TAB, not 8 spaces.
978 Post-release version change.
979 * NEWS: Add a line for 6.8+.
980 * configure.ac (AC_INIT): Set new version string.
982 2007-02-24 Jim Meyering <jim@meyering.net>
985 * NEWS: Record release date and new version number.
986 * configure.ac (AC_INIT): New version number.
988 Don't skip this test on new-enough Linux/GNU systems.
989 * tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0,
990 rather than for __GETCWD_PREFIX in config.h (the latter is no
991 longer defined, ever, due to gnulib changes).
992 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD.
994 Remove the "gnits" option; it prohibits my using "+" as a version
995 string suffix, and all it does (beyond the default "gnu" option)
996 is to _require_ the THANKS file.
997 * configure.ac (AM_INIT_AUTOMAKE): Remove it.
999 Remove all AUTOMAKE_OPTIONS settings in Makefile.am files.
1000 * tests/chgrp/Makefile.am, tests/chmod/Makefile.am:
1001 * tests/chown/Makefile.am, tests/cp/Makefile.am:
1002 * tests/du/Makefile.am, tests/expr/Makefile.am:
1003 * tests/factor/Makefile.am, tests/general/Makefile.am:
1004 * tests/install/Makefile.am, tests/ln/Makefile.am:
1005 * tests/ls/Makefile.am, tests/mkdir/Makefile.am:
1006 * tests/mv/Makefile.am, tests/readlink/Makefile.am:
1007 * tests/rm/Makefile.am, tests/rmdir/Makefile.am:
1008 * tests/seq/Makefile.am, tests/stty/Makefile.am:
1009 * tests/tee/Makefile.am, tests/touch/Makefile.am:
1011 * README: Document the OSF/1 4.0d build failure and work-around.
1012 Reported by Bruno Haible.
1014 * NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty".
1016 * configure.ac: Use 6.7+, not 6.7-dirty.
1018 2007-02-24 Paul Eggert <eggert@cs.ucla.edu>
1020 * NEWS: sort no longer compresses temporaries by default.
1021 * bootstrap.conf: Remove findprog.
1022 * doc/coreutils.texi (sort invocation): The default is to not
1023 compress. Don't treat "" specially.
1024 * src/sort.c: Don't include findprog.h.
1025 (create_temp): Compress only if the user specified --compress-program.
1026 * tests/misc/sort-compress: Adjusts tests to match new behavior.
1028 2007-02-24 Jim Meyering <jim@meyering.net>
1030 Avoid a shell syntax error, when building with an inadequate Perl.
1031 * man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since
1032 it can expand to "/.../missing perl".
1034 * man/Makefile.am (.x.1): Warn when unable to update a man page.
1035 Suggestion from Bruno Haible.
1037 2007-02-23 Bruno Haible <bruno@clisp.org>
1039 Handle better the combination of old Perl and a pre-c99 compiler.
1040 * man/Makefile.am (.x.1): If the autoconf test has determined that
1041 perl is missing or not a sufficient version, do nothing.
1043 * tests/readlink/can-e: Put the closing double-quote at the end of a
1044 backquoted word, not in the middle. Works around a bug in sh on
1046 * tests/readlink/can-f: Likewise.
1047 * tests/readlink/can-m: Likewise.
1049 * tests/du/slink: Skip the test if executing on an nfsv3 file system.
1050 This avoids a test failure at least on OSF/1 4.0d.
1052 2007-02-23 Jim Meyering <jim@meyering.net>
1054 * src/date.c (usage): Split a diagnostic that had grown to be
1055 longer than the C89 maximum of 509 bytes.
1057 2007-02-23 Ed Santiago <ed@edsantiago.com>
1059 * src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
1060 for a separator. Include sample RFC 2822 and 3339 output.
1062 2007-02-23 Jim Meyering <jim@meyering.net>
1064 With -Dlint, make shuf free all heap-allocated storage.
1065 * src/shuf.c (main): Move declaration of input_lines to
1066 function scope, and initialize to NULL, so we can free it.
1067 [lint]: Free all malloc'd memory.
1068 * tests/misc/shuf: Also test shuf's -e and -i options.
1070 2007-02-22 Jim Meyering <jim@meyering.net>
1072 Merge in a change from some other incarnation of this file (gzip?)
1073 * bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.
1075 Adjust preceding change not to perform an unaligned access.
1076 * src/copy.c (copy_reg): Undo previous change. Instead, make
1077 it clearer that we're using a single-byte sentinel, and
1078 [lint]: Initialize sizeof (uintptr_t) - 1 bytes after the sentinel.
1079 Reported by Andreas Schwab.
1081 Placate valgrind, wrt ./cp --sparse=always
1082 * src/copy.c (copy_reg): Place the sentinel by setting a
1083 full word's worth of bits, not just a single byte's worth.
1084 This avoids a harmless (but distracting) case of memory being
1087 2007-02-21 Paul Eggert <eggert@cs.ucla.edu>
1089 Honor dd's noatime flag if possible, even if not supported on build fs
1090 * doc/coreutils.texi (dd invocation): Warn that noatime might not be
1092 * src/dd.c (flags, usage): Look at O_NOATIME, not
1093 HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
1094 flag, so that dd attempts O_NOATIME even if the build file system
1095 does not support it. Problem reported by Jim Meyering today in
1097 * tests/dd/misc: Generate a warning, not a failure, if noatime
1100 2007-02-21 Jim Meyering <jim@meyering.net>
1102 * tests/misc/date: Remove vestigial use of Data::Dumper.
1104 2007-02-20 Paul Eggert <eggert@cs.ucla.edu>
1106 * src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
1107 about out-of-range initializer with Sun C 5.8.
1109 2007-02-20 Jim Meyering <jim@meyering.net>
1111 * bootstrap (CVS_only_file): Use README-hacking.
1113 Now that we use GIT, not cvs, rename README-cvs.
1114 * README-hacking: Renamed from...
1115 Update to reflect that we now use git.
1117 * README-cvs: ...this.
1119 * src/env.c (main): When invoked with no arguments (i.e. when printing
1120 the environment), use a local variable to iterate through the global
1121 "environ" array, rather than "environ" itself. This is solely to
1122 avoid changing the environment for an LD_PRELOAD-substituted "puts"
1123 or "exit" function. Tiny patch by Harvey Eneman. See
1124 <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9735>.
1127 * bootstrap: Move definitions of temporary directory names and the
1128 new bt_regex "up" to precede all uses, so it's clearer what their
1129 scope is. Also, use [.], rather than \\., since the former works
1132 * bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
1133 Based on the bison 2007-02-19 change by Joel E. Denny.
1135 2007-02-19 Paul Eggert <eggert@cs.ucla.edu>
1137 * NEWS: sort now uses a --compress-program option rather than
1138 an environment variable.
1139 * doc/coreutils.texi (sort invocation): Document this.
1140 * src/sort.c (usage): Likewise.
1141 (COMPRESS_PROGRAM_OPTION): New const.
1142 (long_options, create_temp, main): Support new option.
1143 * tests/misc/sort-compress: Test it.
1145 2007-02-19 Jim Meyering <jim@meyering.net>
1147 * bootstrap: Fix typo s/dowloading/downloading/ in --help output.
1149 2007-02-18 Jim Meyering <jim@meyering.net>
1151 * src/system.h: Don't include exit.h, now that it's subsumed
1152 by the gnulib-generated stdlib.h.
1154 * tests/rm/fail-eacces: Skip this test when running as root.
1155 Reported by Matthew Woehlke.
1157 * bootstrap: Use "._bootmp" as the temporary directory name,
1158 not ".#bootmp". The latter's "#" caused trouble with the new,
1159 gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.
1161 2007-02-14 Paul Eggert <eggert@cs.ucla.edu>
1163 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1164 * src/dircolors.c: Include c-strcase.h.
1165 (dc_parse_stream): Use c_strcasecmp rather than
1166 strcasecmp to avoid unreliable results in locales like Turkish
1167 where strcasecmp is incompatible with the C locale.
1169 2007-02-13 Jim Meyering <jim@meyering.net>
1171 Also check for and print stderr output, in case a program fails.
1172 * tests/misc/tty-eof: Occasionally (not reproducible), this
1173 test would fail, with one or more programs exiting nonzero, e.g.,
1174 tty-eof: sha224sum exited with status 1 (expected 0)
1175 Now, maybe we'll get a clue, the next time that happens.
1177 2007-02-12 Jim Meyering <jim@meyering.net>
1179 * .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.
1181 * tests/misc/pwd-unreadable-parent: Skip the test if we're
1182 definitely using the replacement.
1183 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
1185 2007-02-10 Jim Meyering <jim@meyering.net>
1187 Remove excess leading spaces that would make help2man misbehave.
1188 * src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
1189 * src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
1190 * src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
1191 * src/date.c (usage): Use two spaces after each optional flag, not one.
1192 Reported by Thomas Huriaux in <http://bugs.debian.org/410407>.
1194 * Makefile.maint (longopt_re): Relax the regexp, making square
1195 brackets optional, so it matches the newly reported violations, too.
1197 * src/csplit.c (usage): Use two spaces (not one) to separate
1198 each option string from its description, so help2man formats
1199 the derived man page properly. Reported by Thomas Huriaux in
1200 <http://bugs.debian.org/410407>.
1201 * src/df.c (usage): Likewise.
1202 * src/du.c (usage): Likewise.
1203 * src/install.c (usage): Likewise.
1204 * src/ls.c (usage): Likewise.
1206 2007-02-03 Jim Meyering <jim@meyering.net>
1208 Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
1209 * NEWS: Mention the bug fix.
1210 * tests/misc/pwd-unreadable-parent: New file.
1211 * tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.
1213 2007-02-02 Paul Eggert <eggert@cs.ucla.edu>
1215 * NEWS: Document fix for cp --preserve=mode.
1216 * src/copy.c (copy_internal): Omit the group- or other-writeable
1217 permissions when creating a directory, to avoid a race condition
1218 if the special mode bits aren't right just after the directory is
1220 * src/cp.c (make_dir_parents_private): Likewise.
1221 * tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
1224 * NEWS: Document fix for cp --parents.
1225 * src/cp.c (make_dir_parents_private): Report the error sooner with
1226 "cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
1227 creating the directory, DEST/DIR.
1228 * tests/cp/cp-parents: Test for the non-race-condition bug fixed
1229 by the above change.
1231 2007-02-02 Jim Meyering <jim@meyering.net>
1233 * src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".
1235 * src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
1236 consistent, so this can be applied with patch -p0.
1237 Reported by Matthew Woehlke.
1239 Arrange for "make check-root" to run the new root-only test.
1240 * tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux.
1243 * Makefile.maint (patch-check): Use patch with its -p2 option,
1244 since that makes this check slightly more strict.
1246 Use a directory on a loopback device mounted with -o context=...
1247 * tests/cp/cp-a-selinux: Since this test now runs mount and umount,
1248 it is a root-only one.
1250 2007-01-29 Jim Meyering <jim@meyering.net>
1253 * src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
1254 determine dev/inode or upon detecting a symlink loop.
1256 * src/ls.c: Rename three global variables.
1257 (cwd_file): Rename from 'files'.
1258 (cwd_n_alloc): Rename from 'nfiles'.
1259 (cwd_n_used): Rename from 'files_index'.
1261 Shave 8 bytes off the size of "struct fileinfo".
1262 * src/ls.c (fileinfo): Put all members of type "bool" together.
1264 2007-01-28 Paul Eggert <eggert@cs.ucla.edu>
1266 Modify "ls" to sort its data faster, using the new gnulib mpsort
1267 module rather than qsort. This is particularly a win in
1268 environments where strcoll is slow, since mpsort typically calls
1269 strcoll less often than qsort does.
1270 * bootstrap.conf (gnulib_modules): Add mpsort.
1271 * src/ls.c: Include mpsort.h.
1272 (sorted_file, sorted_file_alloc): New vars, for a new vector of
1273 pointers to the file info, for speed.
1274 (clear_files, extract_dirs_from_files, sort_files, print_current_files):
1275 (print_many_per_line, print_horizontal, print_with_commas):
1276 (calculate_columns): Set and use new vector.
1277 (initialize_ordering_vector): New function.
1279 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1281 Adjust to today's change to gnulib, which added a module for
1282 string.h to replace the little include files like strcase.h.
1283 * src/dircolors.c: Don't include strcase.h.
1284 * src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.
1286 2007-01-26 Jim Meyering <jim@meyering.net>
1288 * src/dd.c (advance_input_after_read_error): Change diagnostic to
1289 say "invalid file offset" rather than "screwy file offset".
1291 * .x-sc_cast_of_argument_to_free: Remove this file.
1292 * Makefile.am (EXTRA_DIST): Likewise.
1294 2007-01-25 Dan Hipschman <dsh@linux.ucla.edu>
1296 * src/sort.c (create_temp): Remove superfluous access-X_OK
1297 check. find_in_path does this for us.
1299 2007-01-24 Jim Meyering <jim@meyering.net>
1301 Remove usually-skipped test.
1302 * tests/cp/open-perm-race: Remove this file. It is subsumed
1303 by parent-perm-race.
1304 * tests/cp/Makefile.am (TESTS): Remove open-perm-race.
1305 * tests/sort/Makefile.am: Regenerate.
1307 Pass "make distcheck" again.
1308 * src/sort.c (usage): Split a diagnostic that had grown to be
1309 longer than the C89 maximum of 509 bytes.
1310 * .x-sc_cast_of_argument_to_free: New file. Allow a cast in sort.c.
1311 FIXME: this is just temporary, while we wait to remove the offending
1312 access-calling code.
1313 * Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
1314 * Makefile.maint (sc_cast_of_argument_to_free): Use the
1315 canonical, $$($(CVS_LIST_EXCEPT)).
1316 * m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.
1318 2007-01-24 Paul Eggert <eggert@cs.ucla.edu>
1320 * NEWS: New option sort -C, proposed by XCU ERN 127, which looks
1321 like it will be approved. Also add --check=quiet, --check=silent
1322 as long aliases, and --check=diagnose-first as an alias for -c.
1323 * doc/coreutils.texi (sort invocation): Document this.
1324 Also, mention that sort -c can take at most one file.
1325 * src/sort.c: Implement this.
1327 (usage): Document the change.
1328 (CHECK_OPTION): New constant.
1329 (long_options): --check now takes an optional argument, and is now
1330 treated differently from 'c'.
1331 (check_args, check_types): New constant arrays.
1332 (check): New arg CHECKONLY, which suppresses diagnostic if -C.
1333 (main): Parse the new options.
1334 * tests/sort/Test.pm (02d, 02d, incompat5, incompat6):
1337 2007-01-24 Jim Meyering <jim@meyering.net>
1340 * tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
1341 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
1343 Don't depend on "which".
1344 * tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
1345 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.
1347 2007-01-24 Dan Hipschman <dsh@linux.ucla.edu>
1349 Test sort compression.
1350 * tests/misc/Makefile.am: Add the test.
1351 * tests/misc/sort-compress: New file containing the tests.
1353 2007-01-24 Jim Meyering <jim@meyering.net>
1355 * NEWS: sort temp file compression: tweak wording.
1356 * src/sort.c (struct sortfile) [name]: Declare member to be const.
1358 2007-01-21 Jim Meyering <jim@meyering.net>
1360 * src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
1361 In pipe_fork callers, use these named constants, not "2" and "8".
1362 (proctab, nprocs): Declare to be "static".
1363 (pipe_fork) [lint]: Initialize local, pid,
1364 to avoid unwarranted may-be-used-uninitialized warning.
1365 (create_temp): Use the active voice. Describe parameters, too.
1367 2007-01-21 James Youngman <jay@gnu.org>
1369 Centralize all the uses of sigprocmask(). Don't restore an invalid
1371 * src/sort.c (enter_cs, leave_cs): New functions for protecting
1372 code sequences against signal delivery.
1373 * (exit_cleanup): Use enter_cs and leave_cs instead of
1374 calling sigprocmask directly.
1375 (create_temp_file, pipe_fork, zaptemp): Likewise
1377 2007-01-21 Dan Hipschman <dsh@linux.ucla.edu>
1379 Add compression of temp files to sort.
1380 * NEWS: Mention this.
1381 * bootstrap.conf: Import findprog.
1382 * configure.ac: Add AC_FUNC_FORK.
1383 * doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
1385 * src/sort.c (compress_program): New global, holds the name of the
1386 external compression program.
1387 (struct sortfile): New type used by mergepfs and friends instead
1388 of filenames to hold PIDs of compressor processes.
1389 (proctab): New global, holds compressor PIDs on which to wait.
1390 (enum procstate, struct procnode): New types used by proctab.
1391 (proctab_hasher, proctab_comparator): New functions for proctab.
1392 (nprocs): New global, number of forked but unreaped children.
1393 (reap, reap_some): New function, wait for/cleanup forked processes.
1394 (register_proc, update_proc, wait_proc): New functions for adding,
1395 modifying and removing proctab entries.
1396 (create_temp_file): Change parameter type to pointer to file
1397 descriptor, and return type to pointer to struct tempnode.
1398 (dup2_or_die): New function used in create_temp and open_temp.
1399 (pipe_fork): New function, creates a pipe and child process.
1400 (create_temp): Creates a temp file and possibly a compression
1401 program to which we filter output.
1402 (open_temp): Opens a compressed temp file and creates a
1403 decompression process through which to filter the input.
1404 (mergefps): Change FILES parameter type to struct sortfile array
1405 and update access accordingly. Use open_temp and reap_some.
1406 (avoid_trashing_input, merge): Change FILES parameter like
1407 mergefps and call create_temp instead of create_temp_file.
1408 (sort): Call create_temp instead of create_temp_file.
1410 (avoid_trashing_input, merge, sort, main): Adapt to mergefps.
1412 The idea of compressing sorts temporary files was first
1413 suggested/implemented by Jay Soffian in 1998, and again
1414 by Charles Randall in 2001.
1416 2007-01-20 Jim Meyering <jim@meyering.net>
1418 * tests/misc/pwd-long: Work properly even when run from the
1419 wrong one of two or more bind-mounted sibling directories.
1420 Suggestion from Mike Stone in <http://bugs.debian.org/380552>.
1422 2007-01-20 Paul Eggert <eggert@cs.ucla.edu>
1424 Standardize on list of signals when an app catches signals.
1425 * src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
1426 SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
1427 * src/ls.c (main): Likewise (except SIGPIPE was already caught).
1428 Note that ls.c is special, as it also catches SIGTSTP.
1429 * src/sort.c (main): Likewise. Also catch SIGQUIT. More details in
1430 <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9510>.
1432 2007-01-19 Dan Hipschman <dsh@linux.ucla.edu>
1433 and Paul Eggert <eggert@cs.ucla.edu>
1435 * src/sort.c (cleanup): Clear temphead at the end.
1436 (exit_cleanup): New function.
1437 (main): Don't invoke atexit until we're ready.
1438 Invoke it with exit_cleanup, not with cleanup and close_stdout,
1439 to avoid a race condition with cleanup and signal handling. More
1440 details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508
1442 2007-01-18 Jim Meyering <jim@meyering.net>
1444 * src/c99-to-c89.diff: Adjust remove.c offsets.
1446 2007-01-17 Jim Meyering <jim@meyering.net>
1448 Make "rm --interactive=never ..." never prompt.
1449 * NEWS: Mention this.
1450 * src/remove.h (enum rm_interactive): New ternary type.
1451 (struct rm_options) [interactive]: Use it, here -- rather than bool.
1452 * src/remove.c (prompt): Reflect type change.
1453 * src/mv.c (rm_option_init): Initialize to RMI_NEVER now.
1454 * src/rm.c (main): Add a FIXME comment for '-d' option.
1455 Adapt to type change of rm_options.interactive.
1457 * tests/rm/i-never: New file. Test for the above fix.
1458 * tests/rm/Makefile.am (TESTS): Add i-never.
1460 2007-01-15 Jim Meyering <jim@meyering.net>
1462 * bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
1463 emit foo.h, for each foo_.h. This yields one false-positive, fts.h,
1464 but that's ok, since fts_.h will eventually be renamed.
1466 * src/remove.c (remove_dir): Don't use errno in diagnostic.
1467 Root-only test failure reported by Alex van Hout and Jon Grosshart in
1468 <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9415/focus=9415>.
1470 * bootstrap.conf (avoided_gnulib_modules): Fix my typo:
1471 s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/
1473 2007-01-14 Bruno Haible <bruno@clisp.org>
1475 Enable use of gnulib's new fchdir module.
1476 * bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl,
1477 since we use canonicalize.
1478 (gnulib_modules): Add fchdir.
1479 * m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub.
1481 2007-01-13 Jim Meyering <jim@meyering.net>
1483 * tests/cp/open-perm-race: Remove gdb-based test.
1484 It would run only when compiled with -g, and besides is now
1485 subsumed by file-perm-race.
1486 * tests/cp/Makefile.am (TESTS): Remove open-perm-race.
1488 * Transform all Makefile.am files so that when running "make check",
1489 CU_TEST_NAME is set to the name of the test. This is so that when I
1490 run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
1491 on the entire package it is more convenient to map a leak or error
1492 found in a valgrind log file back to the offending test.
1494 (echo tests/Makefile.am.in; find tests -name Makefile.am) \
1495 |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
1496 -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
1498 2007-01-11 Jim Meyering <jim@meyering.net>
1500 Avoid a leak in expr's implementation of the ":" (match) operator.
1501 * src/expr.c (docolon): Free the regexp buffer using regfree, rather
1502 than doing it manually, being careful to set fastmap to NULL first.
1503 Free any re_regs.start and .end members, if necessary.
1505 * tests/misc/test-diag: Work also when libc's error function
1506 reports the entire program name ("../../src/test"), rather than
1507 just the final component.
1509 2007-01-10 Jim Meyering <jim@meyering.net>
1511 Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
1512 * src/chown-core.c (FTSENT_IS_DIRECTORY): New macro.
1513 (change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a
1514 directory. Non-directory entries lack fts_statp data when using
1515 the FTS_NOSTAT option.
1517 2007-01-07 Jim Meyering <jim@meyering.net>
1519 * tests/sample-test: Update copyright date to 2007.
1520 * Makefile.maint (copyright-check): Also check the copyright date
1521 in tests/sample-test.
1523 2007-01-06 Jim Meyering <jim@meyering.net>
1525 * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
1526 based on examples from G.P. Halkes in
1527 <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>.
1529 2007-01-06 G.P. Halkes <buscom@ghalkes.nl>
1531 * src/fmt.c (copy_rest): Correct prefix handling.
1532 Don't elide a line with the prefix followed by only white space.
1533 (get_line): Move EOF-check to loop-termination condition.
1534 * tests/fmt/basic (pfx-1): Adjust test to expect desired result.
1535 (pfx-2): Remove test; its premise was contrary to the documentation.
1537 2007-01-05 Jim Meyering <jim@meyering.net>
1539 Avoid a used-uninitialized bug for invalid input, i.e., when the size
1540 of the input, not counting newlines, is 1 % 4.
1541 * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
1542 It may be smaller when flushing.
1544 2007-01-05 Mike Frysinger <vapier@gentoo.org>
1546 * src/dircolors.hin: Add a TERM directive for cons25.
1548 2007-01-04 Jim Meyering <jim@meyering.net>
1550 * Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
1551 case you don't have convenient access to glibc info documentation.
1553 Use the release year, not the current year.
1554 * src/groups.sh (version): Use a better name: @RELEASE_YEAR@.
1555 * src/Makefile.am (RELEASE_YEAR): Define it.
1557 Thanks to a prod from Eric Blake.
1559 Ensure that "group --version" always prints the current year.
1560 * src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006.
1561 * src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@.
1562 Suggestion from Eric Blake.
1564 When decoding, always allow newlines in input, with almost no
1566 * src/base64.c (do_decode): Initialize decode context.
1567 Call base64_decode one more time, after all input is processed.
1568 (usage): When decoding, newlines are always accepted.
1570 * tests/misc/base64: Add a bunch of tests, for the above.
1571 * gl/lib/base64.c: Include <string.h>.
1572 (base64_decode_ctx_init, get_4, decode_4): New functions.
1573 (base64_decode): Efficiently handle interspersed newlines.
1574 (base64_decode_alloc): Update signature.
1575 * gl/lib/base64.h (struct base64_decode_context): Define.
1576 (base64_decode_ctx_init): Add prototype.
1577 (base64_decode, base64_decode_alloc): Update prototypes.
1579 * gl/lib/base64.c: Copied from gnulib.
1580 * gl/lib/base64.h: Likewise.
1582 2007-01-03 Jim Meyering <jim@meyering.net>
1584 * THANKS: Add Evan Hunt.
1586 2007-01-03 Bruno Haible <bruno@clisp.org>
1588 Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
1589 * tests/chown/deref: Apply lang-default.
1590 * tests/misc/split-a: Likewise.
1591 * tests/mv/reply-no: Likewise.
1593 * src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
1596 2007-01-02 Paul Eggert <eggert@cs.ucla.edu>
1598 Now, "ls -FRL" always follows symbolic links on Linux.
1599 * NEWS: Mention this bug fix.
1600 * src/ls.c (gobble_file): Fix bug reported by
1601 Nobuyuki Tsuchimura in
1602 http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html
1603 where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
1604 * tests/ls/follow-slink: Add a test for this case.
1606 2007-01-01 Jim Meyering <jim@meyering.net>
1608 * tests/rm/fail-eperm: Revert last change. The PATH=... setting
1609 is not honored at least on HP-UX 11.23 systems.
1610 Instead, simply transform the actual output diagnostic.
1611 Test failure reported by Bob Proulx.
1613 2006-12-30 Jim Meyering <jim@meyering.net>
1615 * bootstrap (gnulib_extra_files): Remove announce-gen.
1616 * bootstrap.conf (gnulib_modules): Add it here instead, now that
1619 * tests/misc/base64: Factor a long, repetitive string.
1621 * src/c99-to-c89.diff: Adjust remove.c offsets.
1623 Clean up after the change of 2006-12-28.
1624 * src/remove.c (AD_pop_and_chdir): Change **DIRP parameter to *DIRP,
1625 now that this function never modifies the pointer. Adjust comments
1626 and code accordingly.
1627 (remove_dir): Set "dirp" to NULL right after AD_pop_and_chdir call,
1628 now that AD_pop_and_chdir no longer does that.
1630 * tests/rm/fail-eperm: Avoid spurious differences (the error function
1631 from latest glibc no longer prints the full program_name): so don't
1632 invoke rm via ../../src/rm. Instead, invoke it via "PATH=../../src rm".
1634 * tests/mv/acl (skip): Skip this test also if the destination
1635 directory, which is on a different file system, lacks ACL support.
1637 * src/copy.c (copy_reg): Rewrite a comment that was rendered
1638 inaccurate by the 2006-10-18 change.
1640 2006-12-28 Jim Meyering <jim@meyering.net>
1642 When moving "up" the hierarchy, be careful to remove a just-emptied
1643 directory before opening ".", to avoid trouble with file system
1644 implementations that cache readdir results at opendir-time.
1645 * src/remove.c (AD_pop_and_chdir): Add a file descriptor parameter.
1646 Don't update **DIRP. Don't call fdopendir here.
1647 (remove_dir): Call fdopendir here instead.
1648 Report and patch from Mikulas Patocka:
1649 <http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00170.html>
1651 2006-12-27 Jim Meyering <jim@meyering.net>
1653 * src/tail.c (usage): Mention +N for --bytes and --lines.
1654 Suggestion from Evan Hunt.
1656 2006-12-26 Jim Meyering <jim@meyering.net>
1658 * configure.ac: Require autoconf-2.61 and automake-1.10.
1659 Without the former (even with autoconf-2.60), "make distcheck"
1660 would fail (without the 2006-09-26 autoconf AC_CHECK_DECL fix),
1661 due to an inttypes.h generated with CFLAGS including -pedantic.
1662 With the old decl check, @HAVE_DECL_STRTOUMAX@ would be 0.
1664 * Makefile.maint (VC-tag): Define, so as to gpg-sign each release
1665 tag, using the release version number as the message.
1666 (vc-dist): Use $(VC-tag), rather than "$(VC) tag".
1668 2006-12-21 Paul Eggert <eggert@cs.ucla.edu>
1670 * NEWS: dd bs= operands now silently override later ibs= and obs=,
1672 * src/dd.c (scanargs): Implement it.
1673 * tests/dd/misc (outbytes): Test it.
1674 * doc/coreutils.texi (dd invocation): Specify that bs=N
1675 overrides later ibs and obs, undoing part of the
1676 previous change. (The behavior was wrong.)
1678 2006-12-20 Jim Meyering <jim@meyering.net>
1680 "rm -rf /etc/motd" (run by non-root) now prints a diagnostic.
1681 * src/remove.c (remove_entry): Handle EACCES for a non-directory, too.
1682 Don't let a non-directory get by with errno == EPERM, either.
1683 Check the file type directly (using cached stat value), rather
1684 than trying to guess it from errno values.
1685 Karl Berry reported that a cross-partition "mv /etc/issue ~"
1686 failed with the um,... suboptimal diagnostic,
1687 "mv: cannot remove `/etc/issue': Not a directory".
1688 * tests/rm/Makefile.am (TESTS): Add fail-eacces.
1689 * tests/rm/fail-eacces: New file.
1690 * NEWS: Mention that both mv and rm are affected.
1692 "cut -f 2- A B" no longer triggers a double-free bug
1693 * src/cut.c (cut_fields): Set file-scoped global to NULL after
1694 freeing it. This avoids a double-free (and core dump on some systems)
1695 for this usage: "echo 1>a; echo 2>b; cut -f2- a b". Reported by
1696 James Hunt in <http://bugzilla.redhat.com/220312>.
1697 * NEWS: List this bug fix.
1698 * THANKS: Mention him.
1699 * tests/misc/cut: New file.
1700 * tests/misc/Makefile.am (TESTS): Add cut.
1702 2006-12-15 Jim Meyering <jim@meyering.net>
1704 * tests/cp/open-perm-race: Correct the gdb-existence check.
1705 Don't run either subsequent gdb command in a sub-shell.
1706 Reported by Thomas Schwinge.
1707 * THANKS: bring up to date.
1709 2006-12-14 Paul Eggert <eggert@cs.ucla.edu>
1711 Make sure cp -p isn't too generous with file permissions.
1712 * tests/cp/Makefile.am (TESTS): Add file-perm-race.
1713 * tests/cp/file-perm-race: New file.
1715 Ensure cp -pR --parents isn't too generous with parent permissions.
1716 * tests/cp/Makefile.am (TESTS): Add parent-perm-race.
1717 * tests/cp/parent-perm-race: New file.
1719 2006-12-14 Jim Meyering <jim@meyering.net>
1721 * tests/chgrp/default-no-deref: Don't assume that files are created
1722 with the primary group by default. That's not true in a directory
1723 with the set-GID bit set.
1725 Don't hang when there's no input tty.
1726 * tests/cp/open-perm-race: Skip this test if there is no
1727 controlling input `terminal'.
1729 Test for a hard-to-detect race fix, using gdb.
1730 * tests/cp/open-perm-race: New file, to test for the
1731 cp --preserve=ownership fix of 2006-12-06.
1733 * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir.
1734 (TESTS): Add open-perm-race.
1736 * src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference.
1737 * src/chown.c (main): Likewise.
1738 * src/chown-core.c (change_file_owner): Add to a comment.
1739 * tests/chown/preserve-root: Add tests.
1741 * NEWS: --preserve-root now works with chgrp, chmod, and chown.
1742 * src/chmod.c (process_file): Do honor the --preserve-root option.
1743 * src/chown-core.c (change_file_owner): Likewise, but here, also
1744 handle the case in which a traversal would go "through" a symlink
1745 to root. Reported by Matthew M. Boedicker
1746 * tests/chown/preserve-root: Test for the above.
1747 * tests/chown/Makefile.am (TESTS): Add preserve-root.
1749 * NEWS: Mention the chmod fix induced by the 2006-12-11 change
1750 to gnulib's m4/openat.m4.
1752 2006-12-13 Andreas Schwab <schwab@suse.de>
1754 Don't fail if mv/acl test succeeds.
1755 * tests/mv/acl (skip): Check for acl support in the file system.
1756 * tests/mv/Makefile.am (XFAIL_TESTS): Remove.
1757 (TESTS_ENVIRONMENT): Pass CONFIG_HEADER.
1759 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1761 Remove some arbitrary restrictions on size fields, so that
1762 commands like "sort -k 18446744073709551616" no longer fail merely
1763 because 18446744073709551616 doesn't fit in uintmax_t. The trick
1764 is that these fields can all be treated as effectively infinity;
1765 their exact values don't matter, since no internal buffer can be
1767 * src/join.c (string_to_join_field): Verify that SIZE_MAX <=
1768 ULONG_MAX if the code assumes this. Silently truncate too-large
1769 values to SIZE_MAX, as the remaining code will do the right thing
1771 * src/sort.c (parse_field_count): Likewise.
1772 * src/uniq.c (size_opt, main): Likewise.
1773 * tests/join/Test.pm (bigfield): New test.
1774 * tests/sort/Test.pm (bigfield): New test.
1775 * tests/uniq/Test.pm (121): New test.
1777 2006-12-13 Jim Meyering <jim@meyering.net>
1779 * tests/chgrp/default-no-deref: New test.
1780 * tests/chgrp/Makefile.am (TESTS): Add default-no-deref.
1782 2006-12-12 Jim Meyering <jim@meyering.net>
1784 * src/system.h (SETVBUF): Remove definition, now that the
1785 autoconf macro, AC_FUNC_SETVBUF_REVERSED, does nothing.
1786 * src/tee.c (tee_files): s/SETVBUF/setvbuf/.
1787 * src/od.c (open_next_file): Likewise.
1789 2006-12-09 Jim Meyering <jim@meyering.net>
1791 * man/Makefile.am (.x.1): Make help2man use $(PACKAGE_STRING) as the
1792 "source". I.e. "GNU coreutils 6.7".
1794 * NEWS: With the change from "-pre" to "-dirty" suffix, also change
1795 from NEXT_VER-pre to CUR_VER-dirty. So, this is 6.7-dirty.
1796 * configure.ac (AC_INIT): s/6.8-dirty/6.7-dirty/.
1798 * tests/uniq/Test.pm (test_vector): Skip the pipe-reading test
1799 whenever uniq is expected to fail. This should catch the other case
1800 [test #112] in which uniq emits "cat: write error: Broken pipe" on
1803 2006-12-08 Jim Meyering <jim@meyering.net>
1805 Include bootstrap tool version info in the announcement form.
1806 * Makefile.maint (gnulib_snapshot_date): Define.
1807 (announcement): Use two new announce-gen options,
1808 --bootstrap-tools and --gnulib-snapshot-date.
1809 * Makefile.cfg (gnulib_dir): Set.
1811 Post-release version change.
1812 * NEWS: Add a line for 6.8-dirty.
1813 * configure.ac (AC_INIT): Set new version string.
1815 2006-12-07 Jim Meyering jim@meyering.net
1818 * NEWS: Record release date. Remove '-pre' suffix.
1819 * configure.ac (AC_INIT): Remove version string suffix.
1821 2006-12-07 Jim Meyering <jim@meyering.net>
1823 Make the output of "make check" more reproducible.
1824 * tests/touch/empty-file: Use envvar-check, so "make check" doesn't
1825 evoke diagnostics like this when COLUMNS=0 in the environment:
1826 ls: ignoring invalid width in environment variable COLUMNS: 0
1827 * tests/touch/no-rights: Likewise.
1828 * tests/help-version: Likewise.
1829 * tests/uniq/Test.pm: Don't perform the pipe-reading version of test
1830 118, since it emits "cat: write error: Broken pipe" on some systems.
1832 2006-12-06 Paul Eggert <eggert@cs.ucla.edu>
1834 * NEWS: Document the cp -p fix for special bits.
1835 * src/copy.c (set_owner): Now returns a three-way result, so
1836 that the caller can clear the special bits. All callers changed.
1837 (copy_reg): Don't set the special bits if chown failed.
1838 (copy_internal): Likewise.
1839 * tests/cp/special-bits: Test this fix.
1841 2006-12-06 Paul Eggert <eggert@cs.ucla.edu>
1843 * NEWS: Document the cp --preserve=ownership fix.
1844 * m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod.
1845 * src/copy.c (fchmod_or_lchmod): New function.
1846 (copy_reg): New arg OMITTED_PERMISSIONS. All uses changed.
1847 Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT.
1848 When creating a file, use O_EXCL, so we're more likely to detect
1849 funny business by other processes. At the end, if permissions
1850 were omitted, chmod them back in.
1851 (copy_internal): If the ownership might change, omit some permissions
1852 at first, then restore them after chowning the file.
1853 * src/cp.c (make_dir_parents_private): Likewise.
1854 * src/copy.c (cached_umask): New function.
1855 * src/copy.h (cached_umask): New decl.
1857 2006-12-06 Jim Meyering <jim@meyering.net>
1859 Make the output of "make check" more reproducible.
1860 * tests/misc/date-sec: Don't emit any diagnostic about sleeping.
1862 2006-12-03 Paul Eggert <eggert@cs.ucla.edu>
1864 * src/install.c (install_file_in_file): Preserve time stamps
1865 before changing owner or file mode bits, for consistency with
1866 other coreutils programs.
1868 2006-12-03 Jim Meyering <jim@meyering.net>
1870 * tests/misc/date-sec: Output a fixed string.
1872 * NEWS: du --one-file-system (-x) would skip subdirectories of any
1873 directory listed as second or subsequent command line argument.
1874 * tests/du/one-file-system: New file. Test for today's fts.c fix.
1875 * tests/du/Makefile.am (TESTS): Add one-file-system.
1876 Reported by Mike Frysinger.
1878 2006-12-02 Jim Meyering <jim@meyering.net>
1880 * tests/du/basic: Generate 4KB file simply using printf, rather than
1881 seq+head. This avoids a spurious "Broken pipe" diagnostic from seq.
1883 2006-11-28 Jim Meyering <jim@meyering.net>
1885 * tests/mv/no-target-dir: Detect a buggy rename syscall. If found,
1886 skip this test. This happens at least on ia64 linux-2.4.19 w/ext3.
1887 Reported by Matthew Woehlke.
1889 * tests/mv/dir2dir: Also accept EBUSY.
1890 Reported by Matthew Woehlke.
1892 2006-11-27 Jim Meyering <jim@meyering.net>
1894 * Makefile.maint (patch-check): Rewrite to diagnose failure.
1895 * src/c99-to-c89.diff: Adjust shred.c offsets.
1897 2006-11-26 Paul Eggert <eggert@cs.ucla.edu>
1899 Improve the check for departures from C89, and fix the departures
1901 * Makefile.maint (my-distcheck): Also check for C89 compatibility
1902 as best we can with GCC.
1903 * src/stat.c (PRINTF_OPTION): Omit comma before } in enum
1904 declaration; C89 doesn't allow this.
1905 * src/dcgen: Don't generate string literals longer than
1906 what C89 requires support for.
1907 * src/cut.c (usage): Don't use string literals longer than
1908 what C89 requires support for.
1909 * src/date.c (usage): Likewise.
1910 * src/dd.c (usage): Likewise.
1911 * src/du.c (usage): Likewise.
1912 * src/ls.c (usage): Likewise.
1913 * src/od.c (usage): Likewise.
1914 * src/readlink.c (usage): Likewise.
1915 * src/seq.c (usage): Likewise.
1916 * src/shred.c (usage): Likewise.
1918 2006-11-26 Mike Frysinger <vapier@gentoo.org>
1920 Recognize new archive, audio and image formats.
1921 Give audio files a separate color.
1922 * src/dircolors.hin: Add comments for common .sh and .csh scripts.
1923 Add .bz2, .tbz2, .tz, .rar, .ace, .zoo, .cpio, .7z, .rz as archive
1924 suffixes. Add .mng, .pcx, .m2v, .mkv, .ogm, .mp4, .m4v, .mp4v, .vob,
1925 .qt, .nuv, .wmv, .asf, .rm, .rmvb, .flc, .yuv as image formats.
1926 Add .aac, .au, .mid, .midi, .mka, .ra as audio suffixes. Change
1927 audio color to 00;36 to differentiate from image/video color.
1929 2006-11-26 Jim Meyering <jim@meyering.net>
1931 * Makefile.maint (patch-check): Compile patched sources with
1932 CFLAGS='-Wdeclaration-after-statement -Werror', to ensure that
1933 no violations remain.
1935 * src/c99-to-c89.diff: Remove 3 bogus hunks.
1937 * src/remove.c (fd_to_subdirp): Remove unused parameter, ds.
1940 * src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c.
1942 * src/rm.c (main): Remove unnecessary (assuming C99) braces.
1944 2006-11-26 Paul Eggert <eggert@cs.ucla.edu>
1946 Port parts of the code to C89 to minimize the need for c99-to-c89.diff,
1947 while trying to retain the readability of C99 as much as possible.
1948 * src/remove.c (rm_1): Remove decl of local, fd_cwd.
1949 Replace each of two uses with literal AT_FDCWD.
1950 (cache_stat_init): Return its argument, for convenience.
1951 Update the caller in remove_dir.
1952 (AD_pop_and_chdir): Return prev_dir rather than storing through
1953 a pointer argument. All uses changed.
1954 (AD_ensure_initialized): New function.
1955 (AD_mark_helper): Use it, to avoid the need for declaration
1957 (rm): Move cycle_check_init call into callee...
1959 Use an else clause in place of a "continue" statement.
1960 (close_preserve_errno): Remove.
1961 (fd_to_subdirp): Rewrite to avoid the need for decl after statement.
1963 2006-11-25 Jim Meyering <jim@meyering.net>
1965 * Makefile.am (EXTRA_DIST): Remove announce-gen from here, too.
1967 2006-11-24 Theodoros V. Kalamatianos <thkala@softlab.ece.ntua.gr> (tiny change)
1969 * tests/du/inacc-dest: Skip this test when running as root.
1971 2006-11-23 Jim Meyering <jim@meyering.net>
1973 * announce-gen: Remove file. It's moving to gnulib.
1974 * bootstrap: Pull it from gnulib/build-aux instead.
1975 * Makefile.maint (announcement): Reflect move to ./build-aux.
1977 * tests/du/deref-args: Use "printf %65536s x" to create a 64KB file,
1978 rather than a pipeline that would sometimes evoke a diagnostic
1979 like "seq: write error: Broken pipe".
1981 * tests/help-version: Suppress dd transfer rate output.
1983 * configure.ac (AC_INIT): Bump to 6.7-pre, not 6.6-pre.
1985 2006-11-22 Jim Meyering <jim@meyering.net>
1987 * announce-gen (print_news_deltas): Fix silly, but harmless typo:
1988 change "(:?..." to "(?:..." in regexps.
1990 Post-release version change.
1991 * NEWS: Add a line for 6.7-pre.
1992 * configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix.
1995 * NEWS: Record release date. Remove "-pre" suffix.
1996 * configure.ac (AC_INIT): Remove "-pre" suffix from version string.
1998 * announce-gen: Remove unused --release-archive-directory option.
1999 (print_news_deltas): Accept new adjective, "Noteworthy", in addition
2001 Match version numbers in NEWS using tighter regular expressions.
2002 (main): Require the --gpg-key-id=ID option.
2003 * Makefile.maint (announcement): Don't use now-removed
2004 --release-archive-directory=... option.
2006 * NEWS: Mention the three noteworthy changes, all fixed via gnulib.
2008 2006-11-21 Jim Meyering <jim@meyering.net>
2010 * tests/rm/one-file-system: Upon setup failure (e.g., mount failure),
2011 skip the test rather than failing. Reported by Michael Deutschmann.
2013 * tests/rm/fail-eperm: Use the "(exit N); exit N" idiom,
2014 rather than just "exit N".
2016 Arrange for "make check-root" to run the new root-only test.
2017 * tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid.
2020 2006-11-20 Jim Meyering <jim@meyering.net>
2022 Add a root-only test for today's lib/idcache.c fix.
2023 * tests/ls/nameless-uid: New file.
2024 * tests/ls/Makefile.am (TESTS): Add nameless-uid.
2025 (TESTS_ENVIRONMENT): Add PERL to the list.
2027 2006-11-19 Jim Meyering <jim@meyering.net>
2029 * tests/tail-2/assert-2: Mark as a very-expensive test, because I
2030 find the 7-second sleep annoyingly long. Besides, this test is
2031 probably far too specific and timing sensitive ever to trigger again.
2032 * tests/tail-2/assert: Likewise.
2034 Post-release version change.
2035 * NEWS: Add a line for 6.6-pre.
2036 * configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix.
2039 * NEWS: Record release date. Remove "-cvs" suffix.
2040 * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2042 2006-11-18 Jim Meyering <jim@meyering.net>
2044 "ln --backup f f" produces a misleading diagnostic:
2045 ln: creating hard link `f' => `f': No such file or directory
2046 * src/ln.c (do_link): Give a better diagnostic in this unusual case.
2047 (do_link): Rename local: s/lstat_ok/dest_lstat_ok/.
2048 * tests/ln/Makefile.am (TESTS): Add hard-backup.
2049 * tests/ln/hard-backup: New test for the above.
2050 * NEWS: Mention this fix.
2052 2006-11-16 Paul Eggert <eggert@cs.ucla.edu>
2054 * bootstrap.conf (gnulib_modules): Add sys_stat, since we use it
2056 * lib/.cvsignore, lib/.gitignore: Add root-dev-ino.c, root-dev-ino.h.
2057 * m4/.cvsignore, m4/.gitignore: Add root-dev-ino.m4.
2058 * src/ls.c (DIRED_FPUTS_LITERAL, PUSH_CURRENT_DIRED_POS):
2059 Omit unnecessary parenthesization of args.
2060 * src/od.c (EQUAL_BLOCKS): Likewise.
2061 * src/system.h (STREQ, ASSIGN_STRDUPA): Likewise.
2063 2006-11-16 Jim Meyering <jim@meyering.net>
2065 * tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell
2066 automake we're skipping this test), and give a diagnostic to tell
2067 the user the same thing. Reported by Mike Grayson.
2069 2006-11-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2071 * man/Makefile.am (dist_man_MANS): Replace all optional manpages
2072 with `$(MAN)', computed at configure time; also, list them ...
2073 (optional_mans): ... in this new variable.
2074 (max_aux, EXTRA_DIST): Ensure that we distribute all manpages.
2076 2006-11-16 Jim Meyering <jim@meyering.net>
2078 Help valgrind see that there is no leak in dd.c.
2079 * src/dd.c (dd_copy): Declare real_buf and real_obuf to be static,
2080 so we need not free them at all. This is easier than freeing
2081 both buffers at each of the early "return"s.
2083 * src/csplit.c (load_buffer): Plug an inconsequential leak.
2085 2006-11-15 Jim Meyering <jim@meyering.net>
2087 * .x-po-check: Exclude gl/ files. Otherwise, po-check would
2088 complain that some of gl/lib/*.[ch] are not listed in POTFILES.in.
2090 2006-11-14 Jim Meyering <jim@meyering.net>
2092 * gl/m4/root-dev-ino.m4: Now that this is part of a real "module",
2093 remove the now-unnecessary use of AC_LIBSOURCES.
2095 Adapt to new version of gnulib-tool.
2096 * gl/modules/root-dev-ino: New file.
2097 * lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ...
2098 * gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here.
2099 * m4/root-dev-ino.m4: Move this file ...
2100 * gl/m4/root-dev-ino.m4: ... to here.
2102 * bootstrap.conf (gnulib_modules): Add root-dev-ino.
2104 2006-11-13 Jim Meyering <jim@meyering.net>
2106 * src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment.
2109 Plug another technically-unimportant leak in sort.
2110 * src/sort.c (main): Don't allocate memory for each new key here.
2111 (insertkey): Allocate memory for each key here, instead.
2112 (key_init): Rename from new_key. Don't allocate.
2114 * src/sort.c (main): Plug a tiny memory leak.
2115 Move declaration of local "minus" down to be nearer point of use.
2117 2006-11-12 Jim Meyering <jim@meyering.net>
2119 du would exit early, when encountering an inaccessible directory
2120 Reported by Mike Frysinger, in
2121 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831
2122 * tests/du/inacc-dest: New test, based on an example from Mike Frysinger.
2123 * tests/chgrp/no-x: Remove the "fts_read failed: ..."
2124 diagnostic from the expected output when using native fdopendir.
2125 * tests/chmod/no-x: Likewise.
2126 * tests/du/no-x: Likewise.
2127 * NEWS: Mention this bug fix.
2128 * tests/du/Makefile.am (TESTS): Add inacc-dest.
2130 * Makefile.maint (sc_cast_of_x_alloc_return_value): Add an exclusion
2131 for xalloc.h itself.
2133 Avoid false-positive when testing via valgrind.
2134 * tests/mv/atomic: Grep strace output for a more specific pattern
2135 than just "unlink", since that got a false positive when testing
2136 under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0
2137 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP.
2139 2006-10-28 Jim Meyering <jim@meyering.net>
2141 * Makefile.maint (patch-check): Make it easier to regenerate
2142 the src/c99-to-c89.diff file. E.g., I do this:
2143 make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff
2145 * src/c99-to-c89.diff: Update to reflect new offsets in rm.c.
2147 2006-10-26 Jim Meyering <jim@meyering.net>
2149 * src/system.h (ftello): Add a compile-time check for the highly
2150 unlikely condition of off_t narrower than long int, rather than
2151 handling it at run time. Based on a patch from Paul Eggert.
2153 2006-10-25 Paul Eggert <eggert@cs.ucla.edu>
2155 * tests/chmod/c-option: When double-quoting part of a word, prefer
2156 to double-quote the whole word. This is a bit easier to read (at
2157 least for me), and in some cases it avoids a shell bug with Tru64
2158 4.0 sh reported by Nelson H. F. Beebe. For example, instead of
2159 "$abs_srcdir"/../setgid-check we now write
2160 "$abs_srcdir/../setgid-check".
2161 * tests/cp/cp-parents: Likewise.
2162 * tests/du/inaccessible-cwd: Likewise.
2163 * tests/du/long-from-unreadable: Likewise.
2164 * tests/install/basic-1: Likewise.
2165 * tests/install/trap: Likewise.
2166 * tests/misc/close-stdout: Likewise.
2167 * tests/mkdir/concurrent-1: Likewise.
2168 * tests/mkdir/p-1: Likewise.
2169 * tests/mkdir/p-3: Likewise.
2170 * tests/mkdir/parents: Likewise.
2171 * tests/mkdir/perm: Likewise.
2172 * tests/readlink/can-e: Likewise.
2173 * tests/readlink/can-f: Likewise.
2174 * tests/readlink/can-m: Likewise.
2175 * tests/rm/inaccessible: Likewise.
2176 * tests/rm/unread3: Likewise.
2177 * tests/touch/no-create-missing: Likewise.
2179 * lib/.cvsignore: Add uinttostr.c.
2181 2006-10-25 Jim Meyering <jim@meyering.net>
2183 Portability to Tru64 V4.0.
2184 * src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
2185 Define inline replacement function.
2186 This (along with a yesterday's fix for autoconf's
2187 _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
2188 now builds once more on Tru64 V4.0. Reported by Nelson Beebe.
2190 2006-10-25 Bruno Haible <bruno@clisp.org>
2192 * src/cat.c (infile): Add "const" to declaration.
2193 * src/csplit.c (prefix): Likewise.
2194 * src/printf.c (cfcc_msg): Likewise.
2195 * src/tail.c (valid_file_spec): Likewise.
2196 * src/cut.c (cut_file): Likewise, for a parameter.
2197 * src/expr.c (str_value): Likewise.
2198 * src/fold.c (fold_file): Likewise.
2199 * src/pr.c (init_header): Likewise.
2200 * src/dircolors.c (dc_parse_stream): Likewise, for a local.
2201 * src/tr.c (make_printable_str): Likewise.
2202 * src/nl.c (body_type, header_type, footer_type, current_type):
2203 (separator_str, build_type_arg, nl_file): Likewise, for many.
2204 * src/paste.c (main): Don't assign a read-only string to 'optarg'.
2205 * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
2207 2006-10-25 Jim Meyering <jim@meyering.net>
2209 * tests/sample-test: Update copyright year list to include only
2210 the current year, since this is what I'll want in any new test.
2212 2006-10-24 Jim Meyering <jim@meyering.net>
2214 * src/c99-to-c89.diff: Update to reflect new offsets.
2216 * NEWS: new feature: rm accepts new option: --one-file-system
2217 Suggested by Steve McIntyre in <http://bugs.debian.org/392925>.
2218 * src/remove.h (struct rm_options) [one_file_system]: New member.
2219 * src/rm.c (rm_option_init): Initialize it.
2220 (usage): Document the option.
2221 * src/mv.c (rm_option_init): Likewise.
2222 * src/remove.c (remove_dir): With --one-file-system and --recursive,
2223 for each directory command line argument, do not affect a file system
2224 different from that of the starting directory. And give a diagnostic.
2225 * src/rm.c (ONE_FILE_SYSTEM): New enum.
2226 (main): Handle new option.
2227 * tests/rm/one-file-system: Test the above.
2228 * tests/rm/Makefile.am (TESTS): Add one-file-system.
2229 * tests/Makefile.am (check-root): Add the rm/one-file-system
2231 (EXTRA_DIST): Add other-fs-tmpdir.
2233 * tests/mv/setup: Removed. Renamed to...
2234 * tests/other-fs-tmpdir: ...this new file.
2235 * tests/mv/Makefile.am (EXTRA_DIST): Remove setup.
2236 * tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir.
2237 * tests/mv/backup-is-src: Likewise.
2238 * tests/mv/hard-link-1: Likewise.
2239 * tests/mv/leak-fd: Likewise.
2240 * tests/mv/mv-special-1: Likewise.
2241 * tests/mv/part-fail: Likewise.
2242 * tests/mv/part-hardlink: Likewise.
2243 * tests/mv/part-rename: Likewise.
2244 * tests/mv/part-symlink: Likewise.
2245 * tests/mv/partition-perm: Likewise.
2246 * tests/mv/to-symlink: Likewise.
2247 * tests/mv/into-self-2: Likewise.
2249 Don't let a failure in one test stop "make -k" from running the others.
2250 * tests/Makefile.am (t1 t2 t3 t4 t5): New targets.
2251 (check-root): Depend on them, rather than executing the five
2252 commands in a single rule. Reported by Greg Schafer.
2254 2006-10-23 Bob Proulx <bob@proulx.com> (tiny change)
2256 * Makefile.maint (alpha beta major): Use a better log message for
2257 the automatic commit of .prev-version.
2259 2006-10-23 Jim Meyering <jim@meyering.net>
2261 * tests/misc/pwd-long: Undo last change, since it made Perl invoke
2262 pwd via a shell. Instead, ensure that the absolute name of the
2263 pwd binary consists solely of reasonable characters.
2264 Whoops. Don't exec the perl script. Otherwise, the sh-trap-based
2265 clean-up code isn't run.
2267 * NEWS: Add a line for 6.5-cvs.
2268 * configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix.
2270 2006-10-22 Jim Meyering <jim@meyering.net>
2274 * NEWS: Record the 6.4 release date.
2275 * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2277 * Makefile.maint: Complete the adaptation to function with a working
2278 directory that is using git (rather than cvs) for version control.
2280 2006-10-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2282 * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'.
2283 * tests/cp/cp-parents: Likewise.
2284 * tests/mkdir/parents: Likewise.
2285 * tests/mkdir/perm: Likewise.
2287 * tests/sample-test: Quote variables containing absolute build
2288 tree paths. In the cleanup trap, make sure `cd' succeeds before
2289 `chmod'ing and `rm'ing the temporary files.
2290 * tests/chgrp/basic: Likewise.
2291 * tests/chgrp/deref: Likewise.
2292 * tests/chgrp/no-x: Likewise.
2293 * tests/chgrp/posix-H: Likewise.
2294 * tests/chgrp/recurse: Likewise.
2295 * tests/chmod/c-option: Likewise.
2296 * tests/chmod/equal-x: Likewise.
2297 * tests/chmod/equals: Likewise.
2298 * tests/chmod/inaccessible: Likewise.
2299 * tests/chmod/no-x: Likewise.
2300 * tests/chmod/octal: Likewise.
2301 * tests/chmod/setgid: Likewise.
2302 * tests/chmod/umask-x: Likewise.
2303 * tests/chmod/usage: Likewise.
2304 * tests/chown/basic: Likewise.
2305 * tests/chown/deref: Likewise.
2306 * tests/chown/separator: Likewise.
2307 * tests/cp/acl: Likewise.
2308 * tests/cp/backup-1: Likewise.
2309 * tests/cp/backup-dir: Likewise.
2310 * tests/cp/backup-is-src: Likewise.
2311 * tests/cp/cp-HL: Likewise.
2312 * tests/cp/cp-deref: Likewise.
2313 * tests/cp/cp-i: Likewise.
2314 * tests/cp/cp-mv-backup: Likewise.
2315 * tests/cp/cp-parents: Likewise.
2316 * tests/cp/deref-slink: Likewise.
2317 * tests/cp/dir-rm-dest: Likewise.
2318 * tests/cp/dir-slash: Likewise.
2319 * tests/cp/dir-vs-file: Likewise.
2320 * tests/cp/fail-perm: Likewise.
2321 * tests/cp/into-self: Likewise.
2322 * tests/cp/link: Likewise.
2323 * tests/cp/link-no-deref: Likewise.
2324 * tests/cp/link-preserve: Likewise.
2325 * tests/cp/no-deref-link1: Likewise.
2326 * tests/cp/no-deref-link2: Likewise.
2327 * tests/cp/no-deref-link3: Likewise.
2328 * tests/cp/perm: Likewise.
2329 * tests/cp/preserve-2: Likewise.
2330 * tests/cp/r-vs-symlink: Likewise.
2331 * tests/cp/same-file: Likewise.
2332 * tests/cp/slink-2-slink: Likewise.
2333 * tests/cp/sparse: Likewise.
2334 * tests/cp/special-bits: Likewise.
2335 * tests/cp/src-base-dot: Likewise.
2336 * tests/cp/symlink-slash: Likewise.
2337 * tests/dd/not-rewound: Likewise.
2338 * tests/dd/skip-seek2: Likewise.
2339 * tests/dd/unblock-sync: Likewise.
2340 * tests/du/2g: Likewise.
2341 * tests/du/8gb: Likewise.
2342 * tests/du/basic: Likewise.
2343 * tests/du/deref: Likewise.
2344 * tests/du/deref-args: Likewise.
2345 * tests/du/exclude: Likewise.
2346 * tests/du/fd-leak: Likewise.
2347 * tests/du/hard-link: Likewise.
2348 * tests/du/inaccessible-cwd: Likewise.
2349 * tests/du/long-from-unreadable: Likewise.
2350 * tests/du/long-sloop: Likewise.
2351 * tests/du/no-deref: Likewise.
2352 * tests/du/no-x: Likewise.
2353 * tests/du/restore-wd: Likewise.
2354 * tests/du/slash: Likewise.
2355 * tests/du/slink: Likewise.
2356 * tests/du/trailing-slash: Likewise.
2357 * tests/du/two-args: Likewise.
2358 * tests/fmt/long-line: Likewise.
2359 * tests/install/basic-1: Likewise.
2360 * tests/install/create-leading: Likewise.
2361 * tests/install/d-slashdot: Likewise.
2362 * tests/install/trap: Likewise.
2363 * tests/ln/misc: Likewise.
2364 * tests/ln/target-1: Likewise.
2365 * tests/ls/color-dtype-dir: Likewise.
2366 * tests/ls/dangle: Likewise.
2367 * tests/ls/dired: Likewise.
2368 * tests/ls/file-type: Likewise.
2369 * tests/ls/follow-slink: Likewise.
2370 * tests/ls/infloop: Likewise.
2371 * tests/ls/inode: Likewise.
2372 * tests/ls/m-option: Likewise.
2373 * tests/ls/no-arg: Likewise.
2374 * tests/ls/recursive: Likewise.
2375 * tests/ls/rt-1: Likewise.
2376 * tests/ls/stat-dtype: Likewise.
2377 * tests/ls/stat-failed: Likewise.
2378 * tests/ls/stat-vs-dirent: Likewise.
2379 * tests/misc/cat-proc: Likewise.
2380 * tests/misc/close-stdout: Likewise.
2381 * tests/misc/csplit: Likewise.
2382 * tests/misc/date-sec: Likewise.
2383 * tests/misc/false-status: Likewise.
2384 * tests/misc/head-c: Likewise.
2385 * tests/misc/head-pos: Likewise.
2386 * tests/misc/mknod: Likewise.
2387 * tests/misc/nl: Likewise.
2388 * tests/misc/nohup: Likewise.
2389 * tests/misc/pathchk1: Likewise.
2390 * tests/misc/printf: Likewise.
2391 * tests/misc/printf-hex: Likewise.
2392 * tests/misc/pwd-long: Likewise.
2393 * tests/misc/shuf: Likewise.
2394 * tests/misc/sort-rand: Likewise.
2395 * tests/misc/split-a: Likewise.
2396 * tests/misc/split-fail: Likewise.
2397 * tests/misc/split-l: Likewise.
2398 * tests/misc/stat-fmt: Likewise.
2399 * tests/misc/tac-continue: Likewise.
2400 * tests/misc/wc-files0: Likewise.
2401 * tests/mkdir/concurrent-1: Likewise.
2402 * tests/mkdir/p-1: Likewise.
2403 * tests/mkdir/p-2: Likewise.
2404 * tests/mkdir/p-3: Likewise.
2405 * tests/mkdir/p-slashdot: Likewise.
2406 * tests/mkdir/p-thru-slink: Likewise.
2407 * tests/mkdir/p-v: Likewise.
2408 * tests/mkdir/parents: Likewise.
2409 * tests/mkdir/perm: Likewise.
2410 * tests/mkdir/t-slash: Likewise.
2411 * tests/mv/acl: Likewise.
2412 * tests/mv/atomic: Likewise.
2413 * tests/mv/backup-dir: Likewise.
2414 * tests/mv/childproof: Likewise.
2415 * tests/mv/diag: Likewise.
2416 * tests/mv/dir-file: Likewise.
2417 * tests/mv/dir2dir: Likewise.
2418 * tests/mv/dup-source: Likewise.
2419 * tests/mv/hard-2: Likewise.
2420 * tests/mv/hard-3: Likewise.
2421 * tests/mv/hard-4: Likewise.
2422 * tests/mv/hard-link-1: Likewise.
2423 * tests/mv/hard-verbose: Likewise.
2424 * tests/mv/i-2: Likewise.
2425 * tests/mv/i-3: Likewise.
2426 * tests/mv/i-4: Likewise.
2427 * tests/mv/i-5: Likewise.
2428 * tests/mv/i-link-no: Likewise.
2429 * tests/mv/into-self-4: Likewise.
2430 * tests/mv/leak-fd: Likewise.
2431 * tests/mv/mv-special-1: Likewise.
2432 * tests/mv/no-target-dir: Likewise.
2433 * tests/mv/part-fail: Likewise.
2434 * tests/mv/part-hardlink: Likewise.
2435 * tests/mv/part-rename: Likewise.
2436 * tests/mv/part-symlink: Likewise.
2437 * tests/mv/partition-perm: Likewise.
2438 * tests/mv/perm-1: Likewise.
2439 * tests/mv/reply-no: Likewise.
2440 * tests/mv/trailing-slash: Likewise.
2441 * tests/mv/update: Likewise.
2442 * tests/od/od-N: Likewise.
2443 * tests/od/x8: Likewise.
2444 * tests/readlink/can-e: Likewise.
2445 * tests/readlink/can-f: Likewise.
2446 * tests/readlink/can-m: Likewise.
2447 * tests/readlink/rl-1: Likewise.
2448 * tests/rm/cycle: Likewise.
2449 * tests/rm/dangling-symlink: Likewise.
2450 * tests/rm/deep-1: Likewise.
2451 * tests/rm/dir-no-w: Likewise.
2452 * tests/rm/dir-nonrecur: Likewise.
2453 * tests/rm/dot-rel: Likewise.
2454 * tests/rm/empty-inacc: Likewise.
2455 * tests/rm/f-1: Likewise.
2456 * tests/rm/fail-2eperm: Likewise.
2457 * tests/rm/hash: Likewise.
2458 * tests/rm/i-1: Likewise.
2459 * tests/rm/i-no-r: Likewise.
2460 * tests/rm/ignorable: Likewise.
2461 * tests/rm/inaccessible: Likewise.
2462 * tests/rm/interactive-always: Likewise.
2463 * tests/rm/interactive-once: Likewise.
2464 * tests/rm/ir-1: Likewise.
2465 * tests/rm/isatty: Likewise.
2466 * tests/rm/no-give-up: Likewise.
2467 * tests/rm/r-1: Likewise.
2468 * tests/rm/r-2: Likewise.
2469 * tests/rm/r-3: Likewise.
2470 * tests/rm/r-4: Likewise.
2471 * tests/rm/readdir-bug: Likewise.
2472 * tests/rm/rm1: Likewise.
2473 * tests/rm/rm2: Likewise.
2474 * tests/rm/rm3: Likewise.
2475 * tests/rm/rm4: Likewise.
2476 * tests/rm/rm5: Likewise.
2477 * tests/rm/sunos-1: Likewise.
2478 * tests/rm/unread2: Likewise.
2479 * tests/rm/unread3: Likewise.
2480 * tests/rmdir/fail-perm: Likewise.
2481 * tests/rmdir/t-slash: Likewise.
2482 * tests/shred/exact: Likewise.
2483 * tests/shred/remove: Likewise.
2484 * tests/sum/sysv: Likewise.
2485 * tests/tail-2/append-only: Likewise.
2486 * tests/tail-2/assert: Likewise.
2487 * tests/tail-2/assert-2: Likewise.
2488 * tests/tail-2/big-4gb: Likewise.
2489 * tests/tail-2/fflush: Likewise.
2490 * tests/tail-2/infloop-1: Likewise.
2491 * tests/tail-2/proc-ksyms: Likewise.
2492 * tests/tail-2/start-middle: Likewise.
2493 * tests/tail-2/tail-n0f: Likewise.
2494 * tests/tee/basic: Likewise.
2495 * tests/tee/dash: Likewise.
2496 * tests/touch/fail-diag: Likewise.
2497 * tests/touch/no-create-missing: Likewise.
2498 * tests/touch/not-owner: Likewise.
2499 * tests/touch/obsolescent: Likewise.
2500 * tests/touch/read-only: Likewise.
2501 * tests/touch/relative: Likewise.
2503 2006-10-21 Jim Meyering <jim@meyering.net>
2505 * NEWS: (cp --backup fix): Fix a typo.
2507 * .gitignore: Remove some references to files in subdirectories.
2508 * build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files.
2509 * m4/.gitignore, po/.gitignore, src/.gitignore: Likewise.
2511 * src/copy.c (copy_internal): Add a comment saying why we prefer
2514 Enable an fts optimization (call lstat only for directories,
2515 on some file system types) also with the --preserve-root option
2517 * src/chown-core.c (change_file_owner): Compare fts_statp-based
2518 dev/ino against root dev/ino only for directories.
2519 (chown_files): Don't let the root_dev_ino setting influence whether
2520 we use FTS_NOSTAT: fts always sets *fts_statp for a directory.
2522 2006-10-20 Jim Meyering <jim@meyering.net>
2524 * src/od.c (usage): Change description of default to use "-w16",
2525 not the now-invalid "-w 16" syntax. From Dan Jacobson.
2527 2006-10-19 Jim Meyering <jim@meyering.net>
2529 * bootstrap: Add names to each .gitignore file (if it exists)
2530 as well as to .cvsignore.
2532 * Makefile.maint (po-check): This rule didn't detect the new use
2533 of "gettext" (as opposed to the use of "_" everywhere else) in
2534 lib/xstrtol.h. Adjust the grep regexp so that now it does.
2536 2006-10-18 Paul Eggert <eggert@cs.ucla.edu>
2538 * src/copy.c (copy_reg): Rewrite slightly to avoid duplicate code
2539 when opening dst_name.
2540 (copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain
2541 (SYSCALL) to test for failure in a system call.
2543 * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy
2544 a fifo. This preserves the special mode bits on Solaris 10, which
2545 is compatible with what Solaris 10 cp -R does.
2547 * src/copy.c (copy_internal): Remove redundant and confusing local
2550 * src/copy.c (copy_internal): Don't pass mkdir a mode greater than
2551 7777. This matches historical 'cp' behavior and avoids some
2552 (though not all) implementation-defined behavior of mkdir.
2553 * src/cp.c (make_dir_parents_private): Likewise.
2554 * src/copy.c (copy_internal): Don't pass 'open' a mode greater
2555 than 777. This is required by POSIX. It doesn't make any difference
2556 in actual behavior on any host that I know of.
2558 2006-10-17 Jim Meyering <jim@meyering.net>
2560 * src/dd.c (usage): Use two spaces (not one) to separate the
2561 "fdatasync" option string from its description, so help2man formats
2562 the derived man page properly. Reported by Samuel Thibault
2563 in <http://bugs.debian.org/393649>.
2565 2006-10-16 Jim Meyering <jim@meyering.net>
2567 * .x-sc_trailing_blank: Remove names of files that are no longer
2570 2006-10-16 Paul Eggert <eggert@cs.ucla.edu>
2572 * src/groups.sh (version): Reword message to match the other programs.
2573 Problem reported by Eric Blake.
2575 2006-10-14 Jim Meyering <jim@meyering.net>
2577 * Makefile.maint (headers_with_interesting_macro_defs): Define.
2578 (.re-defmac, sc_always_defined_macros): New rules.
2580 * src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions.
2581 Instead, include "exit.h". This hereby retires the work-around for
2582 "Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0".
2584 * src/cksum.c (uint_fast32_t): Don't define.
2585 Instead, include <stdint.h>.
2587 * src/pinky.c (S_IWGRP): Don't define.
2588 It's already defined by "stat-macros.h" (included via system.h).
2590 * Makefile.cfg: Remove cruft that's now handled via bootstrap.
2591 * Makefile.maint: Likewise, remove these targets/rules/variables:
2592 (local_updates, update, cvs-update, wget_files, get-targets): Remove.
2593 (cvs_files, wget-update, automake_repo): Likewise.
2594 Move the comment about cvsu to build-aux/vc-list-files,
2595 where cvsu is actually used.
2597 * Makefile.maint (cvs-update): Use $(CVS), not "cvs".
2599 Work also when the working directory (with e.g. coreutils sources)
2600 is version controlled with git, rather than CVS.
2601 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2603 In messages and comments, say e.g., "checked-out sources",
2604 rather than "CVS sources".
2605 (version_controlled_file): New function. Work for git as well as
2606 for CVS. Don't use grep's -q option.
2607 (slurp): Call it here, in place of CVS-specific code.
2609 * NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2
2611 * src/copy.c (copy_internal): Although we do create a backup of each
2612 destination directory when in move mode, don't do that when copying.
2613 Reported by Peter Breitenlohner, in
2614 <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8616>.
2615 * tests/cp/backup-dir: New file. Test for the above.
2616 * tests/cp/Makefile.am (TESTS): Add backup-dir.
2618 2006-10-13 Jim Meyering <jim@meyering.net>
2620 More chown/chgrp dereferencing-related fixes.
2621 * src/chown-core.c (change_file_owner): Don't use fts_statp if
2622 we're dereferencing symlinks.
2623 Reverse conjuncts, so that we use dereference file_stats
2624 (aka ent->fts_statp) only *after* we've confirmed that
2625 chopt->affect_symlink_referent is true. Otherwise, we might
2626 use ent->fts_statp uninitialized.
2627 Don't turn on FTS_NOSTAT when dereferencing symlinks.
2628 * tests/chown/deref: Update the expected diagnostic, now that
2629 this test case (trying to use "chown --dereference ..." on a
2630 dangling symlink) takes a different code path.
2632 2006-10-13 Paul Eggert <eggert@cs.ucla.edu>
2634 Sync from Bison, as follows:
2636 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2638 Fix problems with translating English-language diagnostics.
2639 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2640 respect to bison-runtime pot generation. The YY_ stuff
2641 wasn't being captured.
2643 2006-10-13 Jim Meyering <jim@meyering.net>
2645 * src/chown-core.c (change_file_owner): Use fstatat, not stat,
2646 now that we're using fts_open with FTS_CWDFD.
2647 * tests/chgrp/posix-H: Add --preserve-root to an invocation of
2648 chgrp, to exercise the above fix.
2649 * NEWS: Mention the above.
2651 * src/du-tests: Clean up a little, though it's still not portable.
2653 * .vg-suppressions: Add 3 more for debian unstable.
2655 * tests/ls/Test.pm: Remove long-unused file.
2656 * Makefile.am (EXTRA_DIST): Add bootstrap.conf.
2657 Suggestions from Bruno Haible.
2659 2006-10-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2661 * Makefile.am (THANKS-to-translators): Add missing $(srcdir).
2662 (MAINTAINERCLEANFILES): Add .kludge-stamp.
2663 * man/Makefile.am (MAINTAINERCLEANFILES): Typo $(dist_man_MANS)
2664 instead of $(man_MANS).
2666 2006-10-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2668 * configure.ac: Avoid compiler warnings about default return
2669 type in function definitions and unused variables in tests.
2670 * src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed
2671 if this is #defined.
2673 2006-10-12 Jim Meyering <jim@meyering.net>
2675 * configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming.
2676 Call gl_INIT directly, rather than through the above.
2678 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2680 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2681 variable was sometimes used without being initialized. This
2682 messed up the installation of the INSTALL file in some cases.
2684 2006-10-11 Jim Meyering <jim@meyering.net>
2686 * src/ls.c (usage): Correct description of -s, --size.
2687 It works even without -l. Suggestion from Karl Berry.
2689 2006-10-10 Paul Eggert <eggert@cs.ucla.edu>
2691 * src/ls.c (quote_name): Use initializer rather than memset to
2692 initialize an object to zero. This is easier to read and is less
2693 likely to introduce a runtime error due to a mixup. It causes
2694 gcc -W to issue a warning, but you can work around this by
2695 appending -Wno-missing-field-initializers.
2696 * src/pathchk.c (portable_chars_only): Likewise.
2697 * src/shred.c (main): Likewise.
2698 * src/stty.c (main): Likewise.
2699 * src/tr.c (card_of_complement): Likewise.
2700 * src/wc.c (wc): Likewise.
2702 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2704 * src/sort.c (usage): Mention again that sort fields are origin 1.
2706 * NEWS: Fix typo: iso-8602 -> iso-8601. Problem reported by
2709 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2710 --copy. Inspired by a suggestion from Bruno Haible.
2712 2006-10-09 Jim Meyering <jim@meyering.net>
2714 Avoid a compiler warning.
2715 * src/pathchk.c (portable_chars_only): Initialize variable of type
2716 mbstate_t via memset, rather than via '{0}'. Patch from Bruno Haible.
2718 2006-10-06 Paul Eggert <eggert@cs.ucla.edu>
2720 Fix bug reported today by Mike Frysinger: mkdir -pv is logging the
2721 wrong file name in some cases. Lars Wendler reported a bug in
2723 * src/install.c (make_ancestor): New arg COMPONENT.
2724 * src/mkdir.c (make_ancestor): Likewise.
2725 * tests/install/basic-1: Check for install -Dv bug.
2726 * tests/mkdir/Makefile.am (TESTS): Add p-v.
2727 * tests/mkdir/p-v: New file, to test this bug.
2729 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2731 * src/chgrp.c: Don't include lchown.h; no longer needed.
2732 * src/chown.c: Likewise.
2734 * tests/ls/stat-dtype: Use a dynamic test to decide whether the
2735 current file system has useful d_type info.
2737 * src/dd.c (flags): noatime and nofollow now depend on
2738 HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too.
2739 (usage): Output info about noatime and nofollow only if
2740 they are known to work.
2741 * src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather
2742 than O_NOFOLLOW, when testing whether it's possible to avoid a
2743 race condition reliably.
2745 2006-10-05 Jim Meyering <jim@meyering.net>
2747 * src/c99-to-c89.diff: Update to reflect new offsets.
2749 * tests/install/basic-1: Skip the latter part of this test if the
2750 just-built dd binary is not readable. Otherwise, this test would fail
2751 when binaries were created as root. Reported by Bauke Jan Douma in
2752 <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8433>.
2754 2006-10-03 Paul Eggert <eggert@cs.ucla.edu>
2756 * src/system.h (ST_BLKSIZE): Ceiling at SIZE_MAX / 8 + 1, not at 4
2757 MiB, since XFS hosts can legitimately have large values of
2758 st_blksize. Problem reported by Tony Ernst in
2759 <http://savannah.gnu.org/bugs/?17903>.
2761 2006-10-04 Jim Meyering <jim@meyering.net>
2763 * src/remove.c (nonexistent_file_errno): Remove ENAMETOOLONG.
2764 Paul Eggert pointed out that the specified file may exist,
2765 in spite of such an errno value.
2766 * tests/rm/Makefile.am (TESTS): Remove ignore-name-too-long.
2767 * tests/rm/ignore-name-too-long: Remove file.
2768 * NEWS: Update here, too.
2770 2006-10-03 Jim Meyering <jim@meyering.net>
2772 * tests/rm/fail-eperm: Report failure also if rm is terminated by
2775 * src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c
2776 and one in shred.c -- that were added before coreutils-6.3.
2777 Reported by Michael Deutschmann.
2779 * src/c99-to-c89.diff: Update to reflect new offsets.
2781 * src/remove.c (remove_entry): With -f, exit successfully in spite
2782 of a missing file under some very unusual conditions (with errno
2783 being any of ENOENT, ENOTDIR, ENAMETOOLONG).
2785 With --force (-f), rm no longer fails for ENOTDIR.
2786 * src/remove.c (ignorable_missing): New function.
2787 Use it everywhere, rather than open-coding the test.
2788 Andreas Schwab reported the ENOTDIR problem.
2789 (ignorable_missing): Similarly, don't fail for ENAMETOOLONG.
2791 * NEWS: Mention the bug fix.
2792 * tests/rm/ignorable: New file. Test for the ENOTDIR case.
2793 * tests/rm/ignore-name-too-long: New file. Test for ENAMETOOLONG.
2794 * tests/rm/Makefile.am (TESTS): Add the new file names.
2796 * bootstrap: Undo last change to this file, since now gnulib-tool
2797 sticks with the automake default in generating dependencies.
2799 * NEWS: Add a line for 6.4-cvs.
2800 * configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix.
2802 2006-09-30 Jim Meyering <jim@meyering.net>
2805 * NEWS: Record the 6.3 release date.
2806 * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2808 * NEWS: Mention Paul's Solaris 8 vs. 10 work-around.
2810 * src/c99-to-c89.diff: Update offsets.
2812 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2814 * tests/rm/readdir-bug: Don't use $(...) in a shell script,
2815 as it doesn't work with Solaris /bin/sh.
2817 2006-09-29 Jim Meyering <jim@meyering.net>
2819 * NEWS: Mention Paul's fix (to gnulib's canon-host.c) for
2822 * tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that
2823 use .1 as the increment. Actual output varies too much.
2824 [eq-wid-3]: New, commented out test.
2826 * src/shuf.c (read_input): Fix an off-by-one error that
2827 would cause an infloop for piped input of 8KB or more.
2828 * NEWS: Mention the fix.
2829 * tests/misc/shuf: Test for the above fix.
2831 Since any system may be affected by the Darwin readdir bug,
2832 perform the extra rewinddir unconditionally. The performance
2833 impact of rewinding a directory is negligible.
2834 * src/remove.c (NEED_REWIND): Define to use
2835 CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally.
2837 * tests/seq/basic: Use .11 as the upper bound, in case the ".1"
2838 increment translates to a slightly larger value.
2839 This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe.
2840 The final expected value wasn't being printed.
2842 Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+
2843 and NFS, whereby rm would not remove all files in a directory.
2844 * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10.
2845 (NEED_REWIND): New macro, so that we incur the cost of the work-around
2846 rewinddir only on afflicted systems.
2847 * NEWS: Clarify and correct.
2848 * tests/rm/readdir-bug: New file. Test for the above fix.
2849 * tests/rm/Makefile.am (TESTS): Add it.
2850 Prompted by testing and analysis from Bruno Haible:
2851 http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
2853 2006-09-28 Paul Eggert <eggert@cs.ucla.edu>
2855 * tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too;
2856 suggested for Debian stable, which uses Perl 5.8.4.
2858 2006-09-28 Jim Meyering <jim@meyering.net>
2860 Automatically generated dependencies are important even
2861 when all of the sources in a directory come from gnulib.
2862 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
2863 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2865 * tests/rm/fail-eperm: Enable Perl's (-T) taint checking.
2866 Ensure that IFS is set properly and unset PATH.
2868 Work properly even when the name of the selected file starts with "-".
2869 Invoke rm via "../../src/rm", and adjust expected output.
2870 Prompted by a patch from Tim Waugh.
2872 * README-cvs: Add Bison to the list of required packages.
2874 2006-09-26 Jim Meyering <jim@meyering.net>
2876 * src/c99-to-c89.diff: Update offsets.
2878 * NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept
2879 it from removing a directory containing 188 or more entries.
2880 * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by
2881 20, go work around the buggy readdir on Darwin 8.6.1 with NFS.
2882 Reported by Matthew Woehlke.
2884 2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
2886 * NEWS: "groups user" no longer outputs "user :"; you need at least
2887 two users. "groups" now processes options like --help more compatibly.
2888 * src/groups.sh: Implement the option-processing change.
2889 Handle user and group names with special characters more robustly.
2890 Report write errors instead of exiting silently with status 1.
2892 2006-09-26 Jim Meyering <jim@meyering.net>
2894 * README: Warn not to run autoreconf manually. Use bootstrap instead.
2896 * src/groups.sh: When invoked with 0 or 1 argument, just exec "id".
2897 Rewrite to avoid using temporary, $status.
2899 * NEWS: Mention the bug fix.
2900 * src/groups.sh: Don't hide a write failure.
2901 Reported by Iain Calder <ic56@rogers.com>.
2903 2006-09-25 Jim Meyering <jim@meyering.net>
2905 * src/chown.c (usage): Clarify --dereference description.
2906 * src/chgrp.c (usage): Likewise. Suggestion from Jamie McClelland.
2908 2006-09-24 Jim Meyering <jim@meyering.net>
2910 * NEWS: Mention these fixes.
2911 * src/copy.c (copy_reg): With --verbose (-v), print
2912 "removed `file_name'" just after unlinking a file.
2913 (copy_internal): Likewise, in three more places.
2914 Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.
2915 * tests/mv/hard-verbose: New file. Test for the above fix.
2916 * tests/mv/Makefile.am (TESTS): Add hard-verbose.
2918 * tests/help-version (sync_args): Don't call sync, since it spins up
2919 disks that I've deliberately caused to spin down (but not unmounted).
2921 * NEWS: Mention the improvement to sort.
2923 * tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable
2924 as well as existing.
2926 * tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older,
2927 since that predated addition of d_type support.
2929 2006-09-23 Jim Meyering <jim@meyering.net>
2931 * gl/modules/getloadavg.diff: New file. Work around the way the latest
2932 version of the getloadavg module interacts with our bootstrap script.
2933 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
2934 * Makefile.am (EXTRA_DIST): Sort file names.
2935 Add bootstrap and gl/modules/getloadavg.diff
2937 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2939 * bootstrap: Add support for --force.
2940 (usage): New function. Describe usage less tersely.
2941 (CVS_only_file): New var.
2943 * NEWS: Document fix for cp -i and mv -i.
2944 * src/copy.c (copy_internal): With -i, prompt even if the source
2945 is a directory and the destination is not. This is required by
2946 POSIX and gives the user a chance to bail out before failing.
2947 * tests/cp/Makefile.am (TESTS): Add cp-i.
2948 * tests/cp/cp-i: New file.
2949 * tests/mv/Makefile.am (TESTS): Add i-5.
2950 * tests/mv/i-5: New file.
2952 2006-09-20 Jim Meyering <jim@meyering.net>
2954 * NEWS: Mention the chmod bug fix.
2956 * tests/chmod/inaccessible: New test, specifically for this bug.
2957 Based on a test case from Paul Eggert.
2958 * tests/chmod/Makefile.am (TESTS): Add inaccessible.
2960 Fix the 2006-09-18 bug differently.
2961 * src/chmod.c: (process_file): Upon FTS_NS for a top-level file,
2962 tell fts_read to stat the file again, in case it has become
2963 accessible since the initial fts_open call.
2964 * src/chown-core.c (change_file_owner): Likewise.
2966 * src/chmod.c: Revert last change. There is a better way.
2967 * src/chown-core.c: Likewise.
2969 2006-09-19 Paul Eggert <eggert@cs.ucla.edu>
2971 * src/ln.c (target_directory_operand): Rewrite to avoid porting
2972 problem on Tandem reported by Matthew Woehlke in
2973 <https://savannah.gnu.org/bugs/?17172>.
2975 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2977 Fix bug where chmod, chown, and chgrp did not process operands
2978 left-to-right in some cases.
2979 * src/chmod.c (wd_errno): New var.
2980 (chmod_file): New function, with most of the contents of the
2981 old prcess_file function.
2982 (process_files): Use it. This gives file names to fts one
2983 at a time, so that they are processed left-to-right as POSIX
2985 * src/chown-core.c (wd_errno, chown_files): Likewise.
2986 (chown_file): New function.
2987 * tests/install/basic-1: Redo test so as to not workaround
2988 the chmod bug, thereby testing for it.
2990 * src/shuf.c (main): Quote the entire range when reporting an
2991 invalid one, rather than just the part that contained the error.
2993 * tests/stty/row-col-1: Rewrite to avoid temporary file that is
2994 sometimes left behind if the test is skipped or interrupted.
2996 * bootstrap (symlink_to_gnulib): New function.
2997 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2998 to copies-of-gnulib.
2999 (cp_mark_as_generated, slurp, gnulib_files):
3000 Avoid making a copy if it's the same as the old version.
3001 (gnulib_files): Add support for this variable (used by Bison).
3003 * tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic
3004 indicating flaw in kernel. Reword to say that the flaw isn't
3005 serious for coreutils, since the flaw does affect ls -i.
3007 * tests/chgrp/basic: Fix bug in test case exposed by building on
3008 Solaris 8 in a setgid directory. The test case incorrectly
3009 assumed that 'symlink' would be in group $g1.
3011 2006-09-18 Jim Meyering <jim@meyering.net>
3013 * NEWS: Add a line for 6.3-cvs.
3014 * configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix.
3017 * NEWS: Record the 6.2 release date.
3018 * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
3020 2006-09-17 Jim Meyering <jim@meyering.net>
3022 * tests/chgrp/basic: On an OpenBSD system, rather than failing
3023 due to a known problem, merely warn about it.
3024 Rewrite to avoid testing output of chgrp --verbose and chgrp -c.
3025 Instead, use stat to test file system for desired results, directly.
3026 * tests/chgrp/Makefile.am (TESTS_ENVIRONMENT): Set host_triplet.
3028 * tests/envvar-check: Add more variable names to the list of those
3029 that can affect these programs and tests: _POSIX2_VERSION, COLUMNS,
3030 QUOTING_STYLE, TABSIZE, TERM, TMPDIR.
3032 2006-09-16 Paul Eggert <eggert@cs.ucla.edu>
3034 * NEWS: Document that mkdir -p and install -d now fork on occasion.
3035 * bootstrap.conf (gnulib_modules): Add savewd.
3036 * src/install.c: Include savewd.h.
3037 (process_dir): New function.
3038 (main, install_file_in_file_parents): Use it, along with the new
3039 savewd module, to avoid some race conditions.
3040 * src/mkdir.c: Include savewd.h.
3041 (struct mkdir_options): New members make_ancestor_function, mode,
3043 (make_ancestor): Return 1 if the resulting directory is not readable.
3044 (process_dir): New function.
3045 (main): Use it, along with new savewd module, to avoid some
3046 race conditions. Fill in new slots of struct mkdir_options, so
3047 that callees get the values.
3048 * tests/install/basic-1: Test for coreutils 5.97 bug that was
3049 fixed in coreutils 6.0, and which should still be fixed with
3051 * tests/mkdir/p-3: Likewise.
3053 2006-09-15 Jim Meyering <jim@meyering.net>
3055 * bootstrap.conf (gnulib_modules): Add rename-dest-slash.
3056 The 2006-09-08 changes made it so "mv dir new-name/" would
3057 fail on NetBSD 1.6. This makes it work once again.
3059 2006-09-14 Jim Meyering <jim@meyering.net>
3061 * src/mv.c (main): Remove unnecessary (always-true) test for 2 <= n.
3062 Instead, since it's a little fragile, assert the condition.
3063 (target_directory_operand): Update comment to reflect latest change.
3065 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3067 * src/who.c (print_user): Rewrite to avoid warning from
3068 GCC 4.1.1 with -Wall.
3070 2006-09-12 Jim Meyering <jim@meyering.net>
3072 * tests/mv/atomic: Check for specific strace output, rather than
3073 simply nonempty. RHEL AS 4 would fail this test due to strace
3074 generating "[ Process PID=14434 runs in 32 bit mode. ]".
3075 Reported by Nelson Beebe.
3077 2006-09-11 Jim Meyering <jim@meyering.net>
3079 * src/remove.c (remove_dir): Move new cache_stat_init call onto
3081 (rm_1): Move declaration of "st" and new cache_stat_init call
3082 "down" to nearer where they're used.
3083 * src/c99-to-c89.diff: Add another set of curly braces.
3085 2006-09-10 Paul Eggert <eggert@cs.ucla.edu>
3087 * src/expr.c (eval6): Fix buffer overrun, or bad performance, if
3088 substr's last operand is very large. Performance problem reported
3091 2006-09-09 Jim Meyering <jim@meyering.net>
3093 * Makefile.maint (sc_prohibit_jm_in_m4): Don't hang when there
3095 (sc_require_config_h): Skip this test if there are no version-
3096 controlled .c files.
3097 (sc_prohibit_assert_without_use): Likewise.
3099 2006-09-08 Jim Meyering <jim@meyering.net>
3101 * bootstrap: Export CVS_RSH separate from its assignment, to work
3102 even with Solaris 10's /bin/sh. Suggestion from Mark D. Baushke.
3104 2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
3106 * NEWS: tail now ignores the -f option if POSIXLY_CORRECT is set,
3107 no file operand is given, and standard input is any FIFO.
3108 This is in response to Open Group XCU ERN 114.
3109 * src/tail.c (main): Likewise.
3111 2006-09-08 Jim Meyering <jim@meyering.net>
3113 mv and "cp -r" no longer fail when invoked with two arguments
3114 where the first one names a directory and the second name ends in
3115 a slash and doesn't exist. E.g., "mv dir B/", for nonexistent B,
3116 now succeeds, once more. This reverts part of the 2004-06-27
3118 * NEWS: Say the above.
3119 * src/mv.c (target_directory_operand): Don't require (here)
3120 that the target operand "look like" a directory. This change
3121 pushes the test down to the rename syscall level, where a
3122 "mv dir existing-non-dir/" will mistakenly succeed on older systems
3123 that ignore trailing slashes in the rename destination argument.
3124 * src/cp.c (target_directory_operand): Likewise, but for cp.
3125 * tests/mv/trailing-slash: Exercise the above fixes.
3126 * tests/cp/trailing-slash: New file.
3127 * tests/cp/Makefile.am (EXTRA_DIST): Add trailing-slash.
3129 * bootstrap: Use the previously unused variable, $src,
3130 to avoid repeating "$GNULIB_SRCDIR/$file".
3132 * bootstrap (cp_mark_as_generated): Don't use "local", to
3133 accommodate ancient "/bin/sh". Suggested by Ralf Wildenhues.
3134 Rename now-global "$src" and "$dst" to have cp_ prefix.
3135 Safer, and avoids confusion.
3137 * bootstrap (cp_mark_as_generated): New function.
3138 (slurp): Use it to prepend editor hints and a warning that
3139 the file we're copying is generated.
3140 Suggestion from Bruce Korb.
3141 (cp_mark_as_generated): Don't add C-style comments for .l or .y files.
3142 Fix last-minute typo.
3144 2006-09-07 Jim Meyering <jim@meyering.net>
3146 * bootstrap: Revert last change. There are less disruptive ways
3147 to mark these generated files as read-only.
3149 * src/c99-to-c89.diff: Update to have proper offsets.
3151 2006-09-06 Jim Meyering <jim@meyering.net>
3153 Ensure that some gnulib-tool-generated files are read-only.
3154 * bootstrap (slurp): Put the body of this function in a sub-shell,
3155 with "umask a-w" so that all new files are read-only. Remove each
3156 file before we write to it, in case it's read-only.
3157 Make po/Makevars and runtime-po/Makevars read-only, too.
3159 2006-09-05 Jim Meyering <jim@meyering.net>
3161 * tests/cp/acl: Skip this test when cp lacks ACL support.
3162 * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set $(CONFIG_HEADER).
3164 * src/c99-to-c89.diff (remove.c): Adapt one hunk to match the new
3165 context from change of 2006-09-02.
3167 2006-09-04 Jim Meyering <jim@meyering.net>
3169 * README-cvs: Fix typo in update command.
3171 2006-09-03 Jim Meyering <jim@meyering.net>
3173 * NEWS: Tweak the wording in the new change description so that
3174 no one can think this change causes e.g., `rm -fr foo../' to fail.
3176 * tests/rm/inaccessible: Adjust for movement of config.h to lib/.
3177 Use $CONFIG_HEADER, rather than hard-coding it.
3178 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Set $CONFIG_HEADER.
3180 2006-09-02 Paul Eggert <eggert@cs.ucla.edu>
3182 * NEWS: rm now rejects attempts to remove /, ./, and ../.
3183 * src/basename.c: Don't include dirname.h, since system.h does it now.
3184 * src/chmod.c: Likewise.
3185 * src/copy.c: Likewise.
3186 * src/cp.c: Likewise.
3187 * src/df.c: Likewise.
3188 * src/dircolors.c: Likewise.
3189 * src/dirname.c: Likewise.
3190 * src/du.c: Likewise.
3191 * src/install.c: Likewise.
3192 * src/ln.c: Likewise.
3193 * src/ls.c: Likewise.
3194 * src/mkdir.c: Likewise.
3195 * src/mv.c: Likewise.
3196 * src/remove.c: Likewise.
3197 * src/rm.c: Likewise.
3198 * src/rmdir.c: Likewise.
3199 * src/shred.c: Likewise.
3200 * src/split.c: Likewise.
3201 * src/su.c: Likewise.
3202 * src/system.h: Include "dirname.h", since dot_or_dotdot needs it
3204 (dot_or_dotdot): Succeed even if "." or ".." is followed by a
3206 * src/rm.c (usage, main): --preserve-root is now the default.
3207 * src/remove.h: Fix comment.
3208 * src/remove.c (cache_fstatat, cache_stat_init): New functions.
3209 (cache_statted, cache_stat_ok): New functions.
3210 (write_protected_non_symlink): Remove struct stat ** buf_p arg,
3211 which is no longer needed with the new functions. All callers
3213 (prompt, is_dir_lstat, remove_entry, remove_dir):
3214 New struct stat * arg. All callers changed.
3215 (write_protected_non_symlink, prompt, is_dir_lstat, remove_entry):
3216 (remove_cwd_entries, remove_dir, rm_1):
3217 Use and maintain the file status cache.
3218 (prompt, remove_entry): Omit the first "directory" in the diagnostic
3219 "Cannot remove directory `foo': is a directory". This causes "rm"
3220 to pass a test case that it would otherwise fail now that it
3221 "knows" more about its argument. I think the diagnostic is better
3222 without the first "directory" anyway.
3223 (prompt): Remove the no-longer-needed IS_DIR arg; all callers changed.
3224 (rm_1): Reject attempts to remove /, ./, or ../.
3225 * tests/rm/Makefile.am (TESTS): Add r-4.
3226 * tests/rm/r-4: New file.
3228 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
3230 * src/stat.c: Include <stddef.h>
3231 (alignof): New macro.
3232 (HAVE_STRUCT_STATXFS_F_FSID___VAL, HAVE_STRUCT_STATXFS_F_FSID_VAL):
3234 (STRUCT_STATXFS_F_FSID_IS_INTEGER): New macro.
3236 (print_statfs): If f_fsid isn't an integer, grab its words one
3237 at a time in little-endian order. This is a bit easier to configure
3238 and should avoid a compilation failure on MacOS reported by Bruno
3241 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
3243 * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to
3244 work around a Mac OS X porting problem reported by Bruno Haible in
3245 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>.
3246 (print_statfs): Use them.
3248 * bootstrap.conf (gnulib_modules): Add isapipe.
3249 * src/tail.c: Include isapipe.h.
3250 (IS_PIPE_LIKE_FILE_TYPE): Remove.
3251 (IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as
3252 tailable, since this seems to be portable.
3253 (main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in
3254 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00304.html>.
3256 * src/system.h (LOCALEDIR): Remove, since configmake.h now defines
3259 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
3261 * src/copy.c (copy_internal): Don't test whether macros like
3262 S_ISLNK are defined, since they're always defined now.
3263 * src/cp.c (main): Likewise.
3264 * src/ln.c (main): Likewise.
3265 * src/ls.c (get_link_name, make_link_name): Likewise.
3266 * src/mknod.c (main): Likewise.
3267 * src/mkfifo.c (usage): Likewise.
3268 * src/who.c (S_IWGRP): Likewise.
3270 Adjust to recent gnulib changes for the gnulib module.
3271 * bootstrap.conf (gnulib_modules): Add fcntl.
3272 * src/system.h (SEEK_SET, SEEK_CUR, SEEK_END): Remove. Other code
3273 is already assuming these macros are defined.
3274 (O_DIRECT, O_DIRECTORY, O_DSYNC, O_NDELAY, O_NOATIME, O_NONBLOCK):
3275 (O_NOCTTY, O_NOFOLLOW, O_NOLINKS, O_RSYNC, O_SYNC, O_BINARY, O_TEXT):
3276 Remove; the fcntl module now handles these.
3278 Adjust to recent gnulib changes for the inttypes module.
3279 * bootstrap.conf (gnulib_modules): Remove stdint; add inttypes.
3280 (excluded_files): Don't exclude m4/inttypes-h.m4 or m4/inttypes-pri.m4.
3282 * src/system.h: Don't bother to include <stdint.h>, since we can
3283 now assume inttypes.h does the equivalent of including stdint.h.
3285 2006-08-27 Jim Meyering <jim@meyering.net>
3287 * src/copy.c (copy_internal): Don't make a backup if the last
3288 component of the source name is "." or "..".
3289 Reported by Andreas Schwab in http://savannah.gnu.org/bugs/?17540.
3290 * NEWS: Mention this.
3291 * tests/cp/src-base-dot: New file. Test for the above fix.
3292 * tests/cp/Makefile.am (TESTS): Add src-base-dot.
3294 * src/system.h (DOT_OR_DOTDOT): Remove macro. Rewrite as a...
3295 (dot_or_dotdot): ...new static inline function.
3296 * src/remove.c (rm_1): Reflect this renaming.
3297 * src/ls.c (basename_is_dot_or_dotdot): Likewise.
3299 * src/copy.c (copy_internal): Add comments.
3301 2006-08-26 Paul Eggert <eggert@cs.ucla.edu>
3303 * src/Makefile.am (AM_CPPFLAGS): Remove -I$(srcdir) and -I../lib,
3304 since Automake supplies them for us. It always did -I$(srcdir),
3305 and with the recent change to AC_CONFIG_HEADERS in configure.ac it
3306 is now also doing -I../lib.
3308 * bootstrap (get_translations): Skip this if WGET_COMMAND is empty.
3309 Fail if the first "echo" fails. Suppress diagnostics from "ls po/*.po"
3310 since there might not be any .po files.
3311 (WGET_COMMAND): Set to empty if wget doesn't
3312 seem to be available.
3314 2006-08-26 Jim Meyering <jim@meyering.net>
3316 This test was failing in some environments.
3317 * tests/ls/color-dtype-dir: Don't rely on eval "`dircolors -b`"
3318 to set LS_COLORS in the environment.
3319 * tests/envvar-check: Instead, ensure that LS_COLORS is not set.
3320 Reported by Bob Proulx.
3322 * src/c99-to-c89.diff: Remove hunk for copy.c; no longer needed.
3324 * Makefile.am (EXTRA_DIST): Remove these files here, too:
3325 .x-sc_no_if_have_config_h, .x-sc_prohibit_assert_without_use,
3326 .x-sc_two_space_separator_in_usage.
3328 Fix "mv --verbose --backup" so its output includes the
3329 " (backup: foo.~1~)" suffix also when backing up a directory.
3330 * NEWS: Report this bug fix.
3331 * src/copy.c (emit_verbose): New function, factored out of...
3332 (copy_internal): ...here. Use the new function.
3333 * tests/mv/backup-dir: Test for the above fix.
3334 * tests/mv/Makefile.am (TESTS): Add backup-dir.
3336 2006-08-25 Paul Eggert <eggert@cs.ucla.edu>
3338 * .x-sc_no_if_have_config_h: Remove; no longer needed.
3339 * .x-sc_prohibit_assert_without_use: Remove; it was empty.
3340 * .x-sc_two_space_separator_in_usage: Likewise.
3341 * Makefile.maint (sc_no_have_config_h): Renamed from
3342 sc_no_if_have_config_h, since it now checks that HAVE_CONFIG_H
3343 is absent everywhere.
3344 * bootstrap.conf (gnulib_modules): Add config-h.
3345 * src/shred.c: Include <config.h> unconditionally, since
3346 we now assume config.h exists.
3347 * src/dircolors.c: Likewise.
3349 2006-08-26 Jim Meyering <jim@meyering.net>
3351 "ls --color" would highlight other-writable and sticky directories
3352 no differently than regular directories on a file system with
3353 dirent.d_type support.
3354 * NEWS: Say the above.
3355 * src/ls.c (gobble_file): With --color, also stat the file when
3356 we know it is a directory.
3357 Derived from an anonymous one-line fix and bug report:
3358 <http://savannah.gnu.org/bugs/?15043>.
3359 * tests/ls/color-dtype-dir: New file. Test for the above fix.
3360 * tests/ls/Makefile.am (TESTS): Add color-dtype-dir.
3362 2006-08-25 Paul Eggert <eggert@cs.ucla.edu>
3364 * .cvsignore: Remove stamp-h1. Add coreutils-*, to ignore
3366 * bootstrap.conf: Add configmake, verify.
3367 * src/.cvsignore: Remove localedir.h.
3368 * src/Makefile.am (localedir, DISTCLEANFILES, localedir.h): Remove;
3369 subsumed by configmake.
3370 * src/system.h: Include configmake.h rather than localedir.h
3371 (LOCALEDIR): New macro.
3373 Rewrite to avoid some unnecessary casts, macros, literals.
3374 * src/shred.c (DEFAULT_PASSES, VERBOSE_UPDATE): Now constants,
3376 (SECTOR_SIZE, SECTOR_MASK): New constants.
3377 (fillpattern, dopass, do_wipefd, main): Remove unnecessary casts,
3378 and use the SECTOR_* constants when applicable. Check for size <
3379 0 rather than size == -1, since negative-size files are a sign of
3382 2006-08-25 Bruno Haible <bruno@clisp.org>
3384 * src/shred.c (dopass): Assume a continuable error if EIO even
3385 if the current position is not a multiple of 512.
3387 2006-08-24 Jim Meyering <jim@meyering.net>
3389 * src/stat.c (print_statfs): Fix typo: remove extra "sizeof".
3391 2006-08-23 Paul Eggert <eggert@cs.ucla.edu>
3393 * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID___VAL): Define. This
3394 macro was being used without being defined.
3395 (SB_F_NAMEMAX): Remove cast.
3396 (f_fsid) [BeOS]: Likewise.
3397 (OUT_NAMEMAX): Renamed from NAMEMAX_FORMAT, with a new meaning.
3399 (out_string, out_int, out_uint, out_uint_o, out_uint_x): New
3401 (xstrcat): Remove. All uses changed to use the above functions.
3402 (print_statfs, print_stat): 2nd arg is now the prefix len, not the
3403 buffer len. All uses changed. Output '?', not '*', for unknown
3404 data or errors. Do not assume signed values can be interchanged
3405 with unsigned when printing.
3406 (print_statfs): For %i, print the fsid as a single int, not as a
3408 (print_it): Quote invalid format better.
3410 * NEWS: printf supports the I flag.
3411 * src/printf.c (print_formatted) [glibc 2.2 or later]: Likewise.
3413 2006-08-23 Bruno Haible <bruno@clisp.org>
3415 * src/stat.c (STRUCT_STATVFS, statfs, f_fsid, f_blocks, f_bfree) [BeOS]:
3416 (f_bavail, f_bsize, STATFS_FRSIZE, f_files, f_ffree) [BeOS]:
3417 (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME) [BeOS]: Define.
3419 * src/ls.c (SA_RESTART): Fallback define.
3421 2006-08-23 Paul Eggert <eggert@cs.ucla.edu>
3423 * src/system.h (EDQUOT): Define if not already defined.
3424 Problem reported by Bruno Haible for BeOS.
3426 * .cvsignore: Remove config.h, config.hin, as they are now
3428 * configure.ac (AC_CONFIG_HEADERS): Move config.h and config.hin
3430 * src/Makefile.am (AM_CPPFLAGS): Remove '-I..'; no longer needed.
3432 * bootstrap (slurp): Define gl_LOCK_EARLY instead of gl_LOCK,
3433 to accommodate today's gnulib change.
3435 2006-08-23 Jim Meyering <jim@meyering.net>
3437 * NEWS: Mention the sweeping infrastructure changes.
3439 2006-08-22 Paul Eggert <eggert@cs.ucla.edu>
3441 * bootstrap.conf (gnulib_modules): Add gnupload.
3442 * Makefile.maint (emit_upload_commands): gnupload is now
3444 * gnupload: Remove from CVS, since it's now a gnulib module.
3446 * bootstrap (bootstrap_conf_cleanup): Remove.
3447 (excluded_files): New var.
3448 * bootstrap.conf: Likewise.
3449 * bootstrap (slurp): Exclude files early if they're in the
3450 excluded_files list. That way, their names don't get put into
3453 * aclocal.m4, config.hin, configure:
3454 Remove from CVS, since ./bootstrap generates them automatically.
3455 * .cvsignore: Add INSTALL, Makefile.in, aclocal.m4, config.hin,
3456 configure, *.cache, *.lineno, *.log.
3457 Remove more-specific entries. This catches files like configure.lineno.
3458 * man/.cvsignore: Add Makefile.in.
3459 * src/.cvsignore: Add Makefile.in.
3460 Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c.
3463 * tests/chgrp/.cvsignore:
3464 * tests/chmod/.cvsignore:
3465 * tests/chown/.cvsignore:
3466 * tests/cp/.cvsignore:
3467 * tests/cut/.cvsignore:
3468 * tests/dd/.cvsignore:
3469 * tests/dircolors/.cvsignore:
3470 * tests/du/.cvsignore:
3471 * tests/expr/.cvsignore:
3472 * tests/factor/.cvsignore:
3473 * tests/fmt/.cvsignore:
3474 * tests/head/.cvsignore:
3475 * tests/install/.cvsignore:
3476 * tests/join/.cvsignore:
3477 * tests/ln/.cvsignore:
3478 * tests/ls/.cvsignore:
3479 * tests/ls-2/.cvsignore:
3480 * tests/md5sum/.cvsignore:
3481 * tests/misc/.cvsignore:
3482 * tests/mkdir/.cvsignore:
3483 * tests/mv/.cvsignore:
3484 * tests/od/.cvsignore:
3485 * tests/pr/.cvsignore:
3486 * tests/readlink/.cvsignore:
3487 * tests/rm/.cvsignore:
3488 * tests/rmdir/.cvsignore:
3489 * tests/seq/.cvsignore:
3490 * tests/sha1sum/.cvsignore:
3491 * tests/shred/.cvsignore:
3492 * tests/sort/.cvsignore:
3493 * tests/stty/.cvsignore:
3494 * tests/sum/.cvsignore:
3495 * tests/tac/.cvsignore:
3496 * tests/tail/.cvsignore:
3497 * tests/tail-2/.cvsignore:
3498 * tests/tee/.cvsignore:
3499 * tests/test/.cvsignore:
3500 * tests/touch/.cvsignore:
3501 * tests/tr/.cvsignore:
3502 * tests/tsort/.cvsignore:
3503 * tests/unexpand/.cvsignore:
3504 * tests/uniq/.cvsignore:
3505 * tests/wc/.cvsignore:
3506 Add Makefile.in. Sort entries if necessary. Remove *.I, *.E,
3507 *.X, *.O, *-tests, build-script, mk-script if they're never
3508 created in this directory.
3510 2006-08-22 Bruno Haible <bruno@clisp.org>
3513 * src/uptime.c: Include OS.h if it exists.
3514 (print_uptime): On BeOS, use the get_system_info function (actually a
3515 macro). Loop through utmp entries only if utmp.h or utmpx.h exists.
3516 (uptime): Call read_utmp only if utmp.h or utmpx.h exists.
3518 2006-08-22 Jim Meyering <jim@meyering.net>
3520 * .cvsignore: Add ABOUT-NLS.
3522 Move the check-AUTHORS rule to be run as part of "make distcheck",
3523 rather than "make check".
3524 * src/Makefile.am (check): Don't depend on check-AUTHORS; it would
3525 cause "make check" to fail on systems unable to build all binaries.
3526 * Makefile.maint (check-AUTHORS): New rule.
3527 (local-checks-available): Add it here.
3528 Reported by Bruno Haible. Needed for BeOS.
3530 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
3532 * src/df.c (print_header, show_dev): Use a column width that
3533 depends on the block size of -P is specified and not autoscaling.
3534 Problem reported by Gustavo G. Rondina in:
3535 http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00164.html
3537 2006-08-21 Jim Meyering <jim@meyering.net>
3539 * tests/dircolors/simple (a): Don't fail with an unexpected diagnostic
3540 when the shell variable, SHELL, is not set.
3541 Trigger the failure with "(unset SHELL; make check TESTS=simple)".
3542 Reported by Sven Joachim in <http://bugs.debian.org/355368>.
3544 * src/od.c: Now that HAVE_UNSIGNED_LONG_LONG is no longer defined
3545 in config.h, change the uses to HAVE_UNSIGNED_LONG_LONG_INT.
3546 Otherwise, on a system with 4-byte longs, "od -t u8" fails with this:
3547 od: invalid type string `u8';
3548 this system doesn't provide a 8-byte integral type
3549 FIXME: add a test for this, but skip it when sizeof uintmax < 8.
3551 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
3553 Add a bootstrap procedure, so that the CVS version contains fewer
3554 files and we bootstrap the rest from gnulib, gettext, etc.
3555 * README-cvs: New file.
3556 * bootstrap: New file.
3557 * bootstrap.conf: New file.
3558 * .x-sc_trailing_blank: Remove config-log, .gdb-history. Add .po.
3559 * configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit
3561 (gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL):
3562 (gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib.
3564 (gl_MACROS): Call just after gl_EARLY, just for clarity.
3565 * src/c99-to-c89.diff: Remove patch to ls.c; no longer needed.
3566 * src/kill.c (strtoimax): Remove decl.
3567 * src/ls.c: Include "wcwidth.h" instead of rolling it ourselves.
3568 * src/wc.c: Likewise.
3569 * src/ls.c (sort_files): Rewrite to avoid need for C99-style
3570 declaration, so that we don't need to patch this file.
3571 * src/printf.c (strtoimax, strtoumax): Remove decls.
3572 * src/su.c: Include getpass.h.
3574 * src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h.
3575 Include inttypes.h unconditionally.
3576 (LONGEST_MODIFIER, PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Remove.
3577 (stpcpy, strndup, strstr, strtoul, mempcpy, CHAR_MIN, CHAR_MAX):
3578 (SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, SHRT_MIN, SHRT_MAX, INT_MAX):
3579 (INT_MIN, INTMAX_MAX, INTMAX_MIN, UINT_MAX, LONG_MAX, ULONG_MAX):
3580 (SIZE_MAX, SSIZE_MAX, UINTMAX_MAX): Remove.
3582 * ABOUT-NLS, INSTALL, Makefile.in, man/Makefile.in:
3583 * src/Makefile.in, tests/Makefile.in, tests/chgrp/Makefile.in:
3584 * tests/chmod/Makefile.in, tests/chown/Makefile.in:
3585 * tests/cp/Makefile.in, tests/cut/Makefile.in:
3586 * tests/dd/Makefile.in, tests/dircolors/Makefile.in:
3587 * tests/du/Makefile.in, tests/expr/Makefile.in:
3588 * tests/factor/Makefile.in, tests/fmt/Makefile.in:
3589 * tests/general/Makefile.in, tests/head/Makefile.in:
3590 * tests/install/Makefile.in, tests/join/Makefile.in:
3591 * tests/ln/Makefile.in, tests/ls/Makefile.in:
3592 * tests/ls-2/Makefile.in, tests/md5sum/Makefile.in:
3593 * tests/misc/Makefile.in, tests/mkdir/Makefile.in:
3594 * tests/mv/Makefile.in, tests/od/Makefile.in:
3595 * tests/pr/Makefile.in, tests/readlink/Makefile.in:
3596 * tests/rm/Makefile.in, tests/rmdir/Makefile.in:
3597 * tests/seq/Makefile.in, tests/sha1sum/Makefile.in:
3598 * tests/shred/Makefile.in, tests/sort/Makefile.in:
3599 * tests/stty/Makefile.in, tests/sum/Makefile.in:
3600 * tests/tac/Makefile.in, tests/tail/Makefile.in:
3601 * tests/tail-2/Makefile.in, tests/tee/Makefile.in:
3602 * tests/test/Makefile.in, tests/touch/Makefile.in:
3603 * tests/tr/Makefile.in, tests/tsort/Makefile.in:
3604 * tests/unexpand/Makefile.in, tests/uniq/Makefile.in:
3605 * tests/wc/Makefile.in:
3606 Remove from CVS, since ./bootstrap generates them automatically.
3608 2006-08-20 Eric Blake <ebb9@byu.net>
3610 * src/stat.c (USE_STATVFS): Reinstate the patch from 2006-08-15;
3611 the patch from 2006-08-18 broke on cygwin.
3613 2006-08-20 Jim Meyering <jim@meyering.net>
3615 * NEWS: Add a line for 6.2-cvs.
3616 * configure.ac (AC_INIT): Bump to 6.2 and add "-cvs" suffix.
3618 2006-08-19 Jim Meyering <jim@meyering.net>
3621 * NEWS: Record the 6.1 release date.
3622 * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
3624 * tests/Makefile.am (EXTRA_DIST): Add sparse-file.
3626 Avoid test failure when `make check' is run through debuild.
3627 * tests/help-version: Ensure that $SHELL is set to some value
3628 and exported. Patch from Sven Joachim. For details, see
3629 <http://bugs.debian.org/355368>.
3631 * tests/ls/stat-dtype: Test for the 2006-08-17 `ls -CF' fix.
3633 * README: Describe potential "pre-C99 build failure", and work-around.
3635 Some of my 2006-07-03 changes to tests/*/Makefile.am were being
3636 backed out due to updates provoked by the copyright changes.
3637 * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that
3638 it propagates to the derived Makefile.am files.
3639 ($(srcdir)/Makefile.am): Mark generated .am files as read-only,
3640 so we don't mistakenly edit them again.
3641 * tests/cut/Makefile.am: Regenerate.
3642 * tests/head/Makefile.am: Likewise.
3643 * tests/join/Makefile.am: Likewise.
3644 * tests/pr/Makefile.am: Likewise.
3645 * tests/sort/Makefile.am: Likewise.
3646 * tests/tac/Makefile.am: Likewise.
3647 * tests/tail/Makefile.am: Likewise.
3648 * tests/test/Makefile.am: Likewise.
3649 * tests/tr/Makefile.am: Likewise.
3650 * tests/uniq/Makefile.am: Likewise.
3651 * tests/wc/Makefile.am: Likewise.
3653 * NEWS: Fix cp --sparse so that it preserves tail-end sparseness, even
3654 when the file's apparent size is not a multiple of its block size.
3655 * src/copy.c (copy_reg): Don't write a NUL before calling ftruncate.
3656 For some file sizes, writing that single byte would unnecessarily
3657 waste a few file blocks. That write may have been necessary in the
3658 early days of Linux, but now, removing it should be safe.
3659 Based on a patch by Alan Curry: <http://bugs.debian.org/370792>
3660 * tests/cp/sparse: New test for the above.
3661 * tests/cp/Makefile.am (TESTS): Add sparse.
3663 * tests/sparse-file: New file, essence factored out of...
3664 * tests/du/8gb: ... here. Use the new script.
3666 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3668 * src/system.h (select_plural): Reduce by 1000000, not 1000, since
3669 the CVS gettext manual now suggests 1000000.
3671 2006-08-18 Bruno Haible <bruno@clisp.org>
3673 Add support for NetBSD 3.0.
3674 * src/stat.c (USE_STATVFS): Set to 1 if 'struct statvfs' has a field
3676 (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME): Define also if 'struct statvfs'
3677 has a field f_fstypename.
3678 This undoes the 2006-08-15 to src/stat.c.
3680 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
3682 Copyright notice fixes.
3684 * COPYING: Upgrade to latest version from FSF.
3686 * src/uname.c: Use (C) in copyright notice.
3688 * .vg-suppressions: Add copyright notice.
3689 * ChangeLog: Likewise.
3690 * ChangeLog-2005: Likewise.
3691 * Makefile.am: Likewise.
3694 * README-valgrind: Likewise.
3696 * announce-gen: Likewise.
3697 * man/Makefile.am: Likewise.
3698 * man/chmod.x: Likewise.
3699 * man/chown.x: Likewise.
3700 * man/df.x: Likewise.
3701 * man/du.x: Likewise.
3702 * man/rm.x: Likewise.
3703 * src/dircolors.hin: Likewise.
3704 * src/du-tests: Likewise.
3705 * src/extract-magic: Likewise.
3706 * src/tac-pipe.c: Likewise.
3707 * src/wheel-gen.pl: Likewise.
3708 * tests/Coreutils.pm: Likewise.
3709 * tests/Makefile.am.in: Likewise.
3710 * tests/acl: Likewise.
3711 * tests/envvar-check: Likewise.
3712 * tests/expensive: Likewise.
3713 * tests/group-names: Likewise.
3714 * tests/help-version: Likewise.
3715 * tests/mk-script: Likewise.
3716 * tests/priv-check: Likewise.
3717 * tests/rwx-to-mode: Likewise.
3718 * tests/sample-test: Likewise.
3719 * tests/setgid-check: Likewise.
3720 * tests/chgrp/basic: Likewise.
3721 * tests/chgrp/deref: Likewise.
3722 * tests/chgrp/no-x: Likewise.
3723 * tests/chgrp/posix-H: Likewise.
3724 * tests/chgrp/recurse: Likewise.
3725 * tests/chmod/c-option: Likewise.
3726 * tests/chmod/equal-x: Likewise.
3727 * tests/chmod/equals: Likewise.
3728 * tests/chmod/no-x: Likewise.
3729 * tests/chmod/octal: Likewise.
3730 * tests/chmod/setgid: Likewise.
3731 * tests/chmod/umask-x: Likewise.
3732 * tests/chmod/usage: Likewise.
3733 * tests/chown/basic: Likewise.
3734 * tests/chown/deref: Likewise.
3735 * tests/chown/separator: Likewise.
3736 * tests/cp/Makefile.am: Likewise.
3737 * tests/cp/acl: Likewise.
3738 * tests/cp/backup-1: Likewise.
3739 * tests/cp/backup-is-src: Likewise.
3740 * tests/cp/cp-HL: Likewise.
3741 * tests/cp/cp-deref: Likewise.
3742 * tests/cp/cp-mv-backup: Likewise.
3743 * tests/cp/cp-parents: Likewise.
3744 * tests/cp/deref-slink: Likewise.
3745 * tests/cp/dir-rm-dest: Likewise.
3746 * tests/cp/dir-slash: Likewise.
3747 * tests/cp/dir-vs-file: Likewise.
3748 * tests/cp/fail-perm: Likewise.
3749 * tests/cp/into-self: Likewise.
3750 * tests/cp/link: Likewise.
3751 * tests/cp/link-no-deref: Likewise.
3752 * tests/cp/link-preserve: Likewise.
3753 * tests/cp/no-deref-link1: Likewise.
3754 * tests/cp/no-deref-link2: Likewise.
3755 * tests/cp/no-deref-link3: Likewise.
3756 * tests/cp/perm: Likewise.
3757 * tests/cp/preserve-2: Likewise.
3758 * tests/cp/r-vs-symlink: Likewise.
3759 * tests/cp/same-file: Likewise.
3760 * tests/cp/slink-2-slink: Likewise.
3761 * tests/cp/special-bits: Likewise.
3762 * tests/cp/symlink-slash: Likewise.
3763 * tests/cut/Makefile.am: Likewise.
3764 * tests/cut/Test.pm: Likewise.
3765 * tests/dd/misc: Likewise.
3766 * tests/dd/not-rewound: Likewise.
3767 * tests/dd/skip-seek: Likewise.
3768 * tests/dd/skip-seek2: Likewise.
3769 * tests/dd/unblock-sync: Likewise.
3770 * tests/dircolors/simple: Likewise.
3771 * tests/du/2g: Likewise.
3772 * tests/du/8gb: Likewise.
3773 * tests/du/Makefile.am: Likewise.
3774 * tests/du/basic: Likewise.
3775 * tests/du/deref: Likewise.
3776 * tests/du/deref-args: Likewise.
3777 * tests/du/exclude: Likewise.
3778 * tests/du/fd-leak: Likewise.
3779 * tests/du/files0-from: Likewise.
3780 * tests/du/hard-link: Likewise.
3781 * tests/du/inaccessible-cwd: Likewise.
3782 * tests/du/long-from-unreadable: Likewise.
3783 * tests/du/long-sloop: Likewise.
3784 * tests/du/no-deref: Likewise.
3785 * tests/du/no-x: Likewise.
3786 * tests/du/restore-wd: Likewise.
3787 * tests/du/slash: Likewise.
3788 * tests/du/slink: Likewise.
3789 * tests/du/trailing-slash: Likewise.
3790 * tests/du/two-args: Likewise.
3791 * tests/expr/basic: Likewise.
3792 * tests/factor/basic: Likewise.
3793 * tests/fmt/basic: Likewise.
3794 * tests/fmt/long-line: Likewise.
3795 * tests/general/Makefile.am: Likewise.
3796 * tests/general/atgeneral.m4: Likewise.
3797 * tests/general/dd.at: Likewise.
3798 * tests/head/Makefile.am: Likewise.
3799 * tests/head/Test.pm: Likewise.
3800 * tests/install/basic-1: Likewise.
3801 * tests/install/create-leading: Likewise.
3802 * tests/install/d-slashdot: Likewise.
3803 * tests/install/trap: Likewise.
3804 * tests/join/Makefile.am: Likewise.
3805 * tests/join/Test.pm: Likewise.
3806 * tests/ln/backup-1: Likewise.
3807 * tests/ln/misc: Likewise.
3808 * tests/ln/sf-1: Likewise.
3809 * tests/ln/target-1: Likewise.
3810 * tests/ls/Makefile.am: Likewise.
3811 * tests/ls/Test.pm: Likewise.
3812 * tests/ls/dangle: Likewise.
3813 * tests/ls/dired: Likewise.
3814 * tests/ls/file-type: Likewise.
3815 * tests/ls/follow-slink: Likewise.
3816 * tests/ls/infloop: Likewise.
3817 * tests/ls/inode: Likewise.
3818 * tests/ls/m-option: Likewise.
3819 * tests/ls/no-arg: Likewise.
3820 * tests/ls/recursive: Likewise.
3821 * tests/ls/rt-1: Likewise.
3822 * tests/ls/stat-dtype: Likewise.
3823 * tests/ls/stat-failed: Likewise.
3824 * tests/ls/stat-vs-dirent: Likewise.
3825 * tests/ls/symlink-slash: Likewise.
3826 * tests/ls/time-1: Likewise.
3827 * tests/ls-2/tests: Likewise.
3828 * tests/md5sum/basic-1: Likewise.
3829 * tests/md5sum/newline-1: Likewise.
3830 * tests/misc/Makefile.am: Likewise.
3831 * tests/misc/base64: Likewise.
3832 * tests/misc/basename: Likewise.
3833 * tests/misc/cat-proc: Likewise.
3834 * tests/misc/close-stdout: Likewise.
3835 * tests/misc/csplit: Likewise.
3836 * tests/misc/date: Likewise.
3837 * tests/misc/date-sec: Likewise.
3838 * tests/misc/df: Likewise.
3839 * tests/misc/dirname: Likewise.
3840 * tests/misc/expand: Likewise.
3841 * tests/misc/false-status: Likewise.
3842 * tests/misc/fold: Likewise.
3843 * tests/misc/head-c: Likewise.
3844 * tests/misc/head-elide-tail: Likewise.
3845 * tests/misc/head-pos: Likewise.
3846 * tests/misc/mknod: Likewise.
3847 * tests/misc/nice: Likewise.
3848 * tests/misc/nl: Likewise.
3849 * tests/misc/nohup: Likewise.
3850 * tests/misc/paste-no-nl: Likewise.
3851 * tests/misc/pathchk1: Likewise.
3852 * tests/misc/printf: Likewise.
3853 * tests/misc/printf-hex: Likewise.
3854 * tests/misc/pwd-long: Likewise.
3855 * tests/misc/sha224sum: Likewise.
3856 * tests/misc/sha256sum: Likewise.
3857 * tests/misc/sha384sum: Likewise.
3858 * tests/misc/sha512sum: Likewise.
3859 * tests/misc/shuf: Likewise.
3860 * tests/misc/sort-merge: Likewise.
3861 * tests/misc/sort-rand: Likewise.
3862 * tests/misc/split-a: Likewise.
3863 * tests/misc/split-fail: Likewise.
3864 * tests/misc/split-l: Likewise.
3865 * tests/misc/stat-fmt: Likewise.
3866 * tests/misc/stat-printf: Likewise.
3867 * tests/misc/tac-continue: Likewise.
3868 * tests/misc/test-diag: Likewise.
3869 * tests/misc/tty-eof: Likewise.
3870 * tests/misc/wc-files0: Likewise.
3871 * tests/misc/wc-files0-from: Likewise.
3872 * tests/mkdir/concurrent-1: Likewise.
3873 * tests/mkdir/p-1: Likewise.
3874 * tests/mkdir/p-2: Likewise.
3875 * tests/mkdir/p-3: Likewise.
3876 * tests/mkdir/p-slashdot: Likewise.
3877 * tests/mkdir/p-thru-slink: Likewise.
3878 * tests/mkdir/parents: Likewise.
3879 * tests/mkdir/perm: Likewise.
3880 * tests/mkdir/special-1: Likewise.
3881 * tests/mkdir/t-slash: Likewise.
3882 * tests/mkdir/writable-under-readonly: Likewise.
3883 * tests/mv/Makefile.am: Likewise.
3884 * tests/mv/acl: Likewise.
3885 * tests/mv/atomic: Likewise.
3886 * tests/mv/backup-is-src: Likewise.
3887 * tests/mv/childproof: Likewise.
3888 * tests/mv/diag: Likewise.
3889 * tests/mv/dir-file: Likewise.
3890 * tests/mv/dir2dir: Likewise.
3891 * tests/mv/dup-source: Likewise.
3892 * tests/mv/force: Likewise.
3893 * tests/mv/hard-2: Likewise.
3894 * tests/mv/hard-3: Likewise.
3895 * tests/mv/hard-4: Likewise.
3896 * tests/mv/hard-link-1: Likewise.
3897 * tests/mv/i-1: Likewise.
3898 * tests/mv/i-2: Likewise.
3899 * tests/mv/i-3: Likewise.
3900 * tests/mv/i-4: Likewise.
3901 * tests/mv/i-link-no: Likewise.
3902 * tests/mv/into-self: Likewise.
3903 * tests/mv/into-self-2: Likewise.
3904 * tests/mv/into-self-3: Likewise.
3905 * tests/mv/into-self-4: Likewise.
3906 * tests/mv/leak-fd: Likewise.
3907 * tests/mv/mv-special-1: Likewise.
3908 * tests/mv/no-target-dir: Likewise.
3909 * tests/mv/part-fail: Likewise.
3910 * tests/mv/part-hardlink: Likewise.
3911 * tests/mv/part-rename: Likewise.
3912 * tests/mv/part-symlink: Likewise.
3913 * tests/mv/partition-perm: Likewise.
3914 * tests/mv/perm-1: Likewise.
3915 * tests/mv/reply-no: Likewise.
3916 * tests/mv/setup: Likewise.
3917 * tests/mv/to-symlink: Likewise.
3918 * tests/mv/trailing-slash: Likewise.
3919 * tests/mv/update: Likewise.
3920 * tests/mv/vfat: Likewise.
3921 * tests/od/od-N: Likewise.
3922 * tests/od/x8: Likewise.
3923 * tests/pr/Makefile.am: Likewise.
3924 * tests/pr/Test.pm: Likewise.
3925 * tests/readlink/can-e: Likewise.
3926 * tests/readlink/can-f: Likewise.
3927 * tests/readlink/can-m: Likewise.
3928 * tests/readlink/rl-1: Likewise.
3929 * tests/rm/Makefile.am: Likewise.
3930 * tests/rm/cycle: Likewise.
3931 * tests/rm/dangling-symlink: Likewise.
3932 * tests/rm/deep-1: Likewise.
3933 * tests/rm/dir-no-w: Likewise.
3934 * tests/rm/dir-nonrecur: Likewise.
3935 * tests/rm/dot-rel: Likewise.
3936 * tests/rm/empty-inacc: Likewise.
3937 * tests/rm/empty-name: Likewise.
3938 * tests/rm/f-1: Likewise.
3939 * tests/rm/fail-2eperm: Likewise.
3940 * tests/rm/fail-eperm: Likewise.
3941 * tests/rm/hash: Likewise.
3942 * tests/rm/i-1: Likewise.
3943 * tests/rm/i-no-r: Likewise.
3944 * tests/rm/inaccessible: Likewise.
3945 * tests/rm/interactive-always: Likewise.
3946 * tests/rm/interactive-once: Likewise.
3947 * tests/rm/ir-1: Likewise.
3948 * tests/rm/isatty: Likewise.
3949 * tests/rm/no-give-up: Likewise.
3950 * tests/rm/r-1: Likewise.
3951 * tests/rm/r-2: Likewise.
3952 * tests/rm/r-3: Likewise.
3953 * tests/rm/rm1: Likewise.
3954 * tests/rm/rm2: Likewise.
3955 * tests/rm/rm3: Likewise.
3956 * tests/rm/rm4: Likewise.
3957 * tests/rm/rm5: Likewise.
3958 * tests/rm/sunos-1: Likewise.
3959 * tests/rm/unread2: Likewise.
3960 * tests/rm/unread3: Likewise.
3961 * tests/rm/unreadable: Likewise.
3962 * tests/rmdir/fail-perm: Likewise.
3963 * tests/rmdir/ignore: Likewise.
3964 * tests/rmdir/t-slash: Likewise.
3965 * tests/seq/basic: Likewise.
3966 * tests/sha1sum/basic-1: Likewise.
3967 * tests/sha1sum/sample-vec: Likewise.
3968 * tests/shred/exact: Likewise.
3969 * tests/shred/remove: Likewise.
3970 * tests/sort/Makefile.am: Likewise.
3971 * tests/sort/Test.pm: Likewise.
3972 * tests/sort-time/Makefile: Likewise.
3973 * tests/sort-time/README: Likewise.
3974 * tests/sort-time/rand-gen: Likewise.
3975 * tests/stty/basic-1: Likewise.
3976 * tests/stty/row-col-1: Likewise.
3977 * tests/sum/basic-1: Likewise.
3978 * tests/sum/sysv: Likewise.
3979 * tests/tac/Makefile.am: Likewise.
3980 * tests/tac/Test.pm: Likewise.
3981 * tests/tail/Makefile.am: Likewise.
3982 * tests/tail/Test.pm: Likewise.
3983 * tests/tail-2/Makefile.am: Likewise.
3984 * tests/tail-2/append-only: Likewise.
3985 * tests/tail-2/assert: Likewise.
3986 * tests/tail-2/assert-2: Likewise.
3987 * tests/tail-2/big-4gb: Likewise.
3988 * tests/tail-2/fflush: Likewise.
3989 * tests/tail-2/infloop-1: Likewise.
3990 * tests/tail-2/proc-ksyms: Likewise.
3991 * tests/tail-2/start-middle: Likewise.
3992 * tests/tail-2/tail-n0f: Likewise.
3993 * tests/tee/basic: Likewise.
3994 * tests/tee/dash: Likewise.
3995 * tests/test/Makefile.am: Likewise.
3996 * tests/test/Test.pm: Likewise.
3997 * tests/touch/Makefile.am: Likewise.
3998 * tests/touch/dangling-symlink: Likewise.
3999 * tests/touch/empty-file: Likewise.
4000 * tests/touch/fail-diag: Likewise.
4001 * tests/touch/fifo: Likewise.
4002 * tests/touch/no-create-missing: Likewise.
4003 * tests/touch/no-rights: Likewise.
4004 * tests/touch/not-owner: Likewise.
4005 * tests/touch/obsolescent: Likewise.
4006 * tests/touch/read-only: Likewise.
4007 * tests/touch/relative: Likewise.
4008 * tests/tr/Makefile.am: Likewise.
4009 * tests/tr/Test.pm: Likewise.
4010 * tests/tr/failures: Likewise.
4011 * tests/tsort/basic-1: Likewise.
4012 * tests/unexpand/basic-1: Likewise.
4013 * tests/uniq/Makefile.am: Likewise.
4014 * tests/uniq/Test.pm: Likewise.
4015 * tests/wc/Makefile.am: Likewise.
4016 * tests/wc/Test.pm: Likewise.
4018 2006-08-17 Jim Meyering <jim@meyering.net>
4020 ls -CF would misalign columns in some cases.
4021 * src/ls.c (get_type_indicator): New function. extracted from...
4022 (print_type_indicator): ...here. Use it.
4023 (length_of_file_name_and_frills): Use it here, too, rather than
4024 assuming stat.st_mode is valid.
4025 Reported by Andreas Schwab, here:
4026 <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7774>
4027 See the test for this above. FYI, I did ls -CF /proc and visually
4028 inspected the result.
4030 * src/copy.c (copy_internal, same_file_ok): Adjust comments not
4031 to mention the now-removed cp_options.xstat member.
4033 * Makefile.maint (patch-check): Adapt to work now that the patch
4034 modifies more than one file in src/.
4036 With this patch, permit building with Solaris cc on Solaris 7.
4037 * src/c99-to-c89.diff: Add diffs to convert more c99-isms.
4038 This integrates patches from Bruno Haible.
4040 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
4042 Fix some problems reported by Bruno Haible.
4043 * tests/chmod/setgid (abs_srcdir): Remove; not used or needed.
4044 Skip this test if "chmod g+s d" silently does nothing.
4045 * tests/ls-2/tests: Skip this test suite if we can't set up files
4046 properly for the setuid-etc test. This simplifies some of the
4047 hacks we were using to work around porting problems.
4049 2006-08-16 Jim Meyering <jim@meyering.net>
4051 * tests/cp/Makefile.am: Don't mark "acl" as XFAIL.
4052 * tests/cp/acl: Instead, skip the test if either setfacl
4054 Reported by Michael Stone.
4056 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
4058 * tests/lang-default (LC_ALL): Set to "C", so we get
4059 English-language diagnostics. Unset the other variables; it
4060 should be portable to use 'unset' for this stuff nowadays.
4061 Problem reported by Bruno Haible. Using "C" reverses the
4062 2000-10-22 change to fileutils in this area.
4064 Fix bugs when printing plurals of numbers that are not
4065 unsigned long int values.
4066 * src/system.h (select_plural): New function.
4067 * src/md5sum.c (digest_check): Use select_plural to avoid bug.
4068 * src/uptime.c (print_uptime): Likewise.
4069 * src/dd.c (print_stats): Likewise. Also, don't use ngettext to
4070 print a floating point number, as reducing to 0 or 1 doesn't work
4071 for some languages. Instead, just use "s" for seconds since it
4072 doesn't need a plural form.
4074 2006-08-16 Bruno Haible <bruno@clisp.org>
4076 Old versions of gzip would write --help output to stderr, and it
4077 would be annoying to see that in the output of every "make" command.
4078 * Makefile.maint (gzip_rsyncable): Throw away stderr output of
4081 2006-08-16 Andreas Schwab <schwab@suse.de>
4083 * tests/cp/acl: Don't use non-portable == operator for test.
4085 2006-08-16 Jim Meyering <jim@meyering.net>
4087 * tests/ls/stat-dtype: Use stat to test file system type, rather
4088 than df -T, in case /etc/mtab lies. Reported by Michael Stone.
4090 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
4092 * NEWS: Mention that df exits with nonzero status if it generates
4093 no output. This change was in 6.0 but inadvertently unmentioned.
4094 * src/df.c (file_systems_processed): Renamed from n_valid_args, and now
4096 (show_dev): Don't set it until we actually output something.
4097 Print the header if this is the first output.
4098 (main): Don't print a header, as that is now show_dev's job.
4099 * tests/misc/Makefile.am (TESTS): Add df.
4100 * tests/misc/df: New file.
4102 2006-08-15 Eric Blake <ebb9@byu.net>
4104 * src/stat.c (USE_STATVFS): Define to 0 if f_type is needed, but
4105 statvfs.f_type not present. See
4106 <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16325>.
4108 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
4110 * src/dd.c (print_stats): Don't substitute "1" for number, as this
4111 causes confusion for the Hungarian translators. Problem reported
4112 by Egmont Koblinger here:
4113 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7726
4115 2006-08-15 Jim Meyering <jim@meyering.net>
4117 * .x-sc_require_config_h: Add lib/at-func.c.
4119 * NEWS: Add a line for 6.1-cvs.
4120 * configure.ac (AC_INIT): Bump to 6.1 and add "-cvs" suffix.
4122 2006-08-15 Jim Meyering <jim@meyering.net>
4125 * NEWS: Record the 6.0 release date.
4126 * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
4128 * TODO: Add an item (convert to use gnulib-tool), add to the plan
4129 for id-vs-getgrouplist, and remove a few completed items.
4131 * Makefile.maint (alpha beta major): Fix syntax error.
4133 2006-08-13 Jim Meyering <jim@meyering.net>
4135 * src/shred.c (usage): Don't indent the second line of an item.
4136 Otherwise, help2man would misformat the output.
4137 Reported by Adam Buchbinder in <https://launchpad.net/bugs/48917>.
4139 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
4141 * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
4142 Suggested by Eric Blake to avoid problems like
4143 <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
4145 2006-08-11 Jim Meyering <jim@meyering.net>
4147 * tests/ls/stat-vs-dirent: Too many (losing) systems trigger the
4148 failure that this test checks for (stat/dirent inode mismatch at
4149 a mount point), so continue to give a diagnostic about the failure,
4150 but don't actually count it as a failure.
4152 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
4154 * ABOUT-NLS: Update from gettext 0.15.
4155 * configure.ac (AM_GNU_GETTEXT_VERSION): Update from 0.13.1 to 0.15.
4157 * src/csplit.c (struct control): Remove fastmap member.
4158 (extract_regexp): Allocate fastmap separately, since otherwise
4159 it might move due to a realloc. This fixes a bug that led
4160 to a core dump on 64-bit sparc Solaris 10 (Sun Studio 10).
4162 2006-08-10 Jim Meyering <jim@meyering.net>
4164 * tests/ls/stat-dtype: If "." is tmpfs, skip this test unless uname -s
4165 reports "Linux". This avoids a failure on Solaris 10's tmpfs.
4166 Redirect both stdout and stderr of df invocations.
4168 * src/dircolors.hin: Add a TERM directive for each of the following:
4169 ansi, color-xterm, gnome, konsole, kterm, rxvt-cygwin,
4170 rxvt-cygwin-native, screen.linux, xterm-256color.
4171 Sort the TERM directives.
4172 From Mike Frysinger.
4174 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
4176 * src/dd.c (usage): Warn about oflag=append without conv=notrunc.
4177 See Debian bug 373736.
4179 * src/dircolors.hin: Add mlterm, rxvt-unicode; this fixes Debian
4182 * src/.cvsignore: Add shuf.
4184 * Makefile.maint: Remove the po-update procedure; it doesn't
4185 work with the new repository on http://www.iro.umontreal.ca/.
4186 For now I guess we'll have to fix things by hand.
4187 (do-po-update, po-update): Remove. All references removed.
4189 * src/shuf.c (next_line): New function.
4190 (read_input): Use it, to avoid relying on GCC-specific behavior
4191 with void * arithmetic. Problem reported by Bob Proulx.
4192 * Makefile.maint (my-distcheck): Compile with -Wpointer-arith
4193 to detect this sort of problem automatically in the future.
4195 2006-08-09 Jim Meyering <jim@meyering.net>
4197 * src/ls.c: Add a compile-time check to ensure that filetype
4198 and filetype_letter have the same number of elements.
4200 * tests/misc/sort-rand: Remove use of --seed=S.
4202 2006-08-08 Paul Eggert <eggert@cs.ucla.edu>
4204 Add a command 'shuf', and modify shred and sort to use the new
4205 random number generator library of 'shuf'.
4207 * AUTHORS: Add shuf.
4209 * NEWS: Likewise. Mention new --random-source option for shred
4210 and sort. Move "sort +1 -2" notice to the appropriate section,
4211 and clarify its role with respect to POSIXLY_CORRECT.
4212 * man/.cvsignore: Add shuf.1.
4213 * man/Makefile.am (dist_man_MANS): Add shuf.1.
4214 (shuf.1): New dependency.
4215 * man/shuf.x: New file.
4216 * src/Makefile.am (bin_PROGRAMS): Add shuf.
4217 (EXTRA_DIST): Remove rand-isaac.c.
4218 (shuf_LDADD): New macro.
4219 * src/rand-isaac.c: Remove, moving most of its contents to
4221 * src/shuf.c: New file.
4222 * src/shred.c: Use new random-number interface rather than rand-isaac.c.
4223 Don't include rand-isaac.c; include randint.h and randread.h instead.
4224 (RANDOM_SOURCE_OPTION): New enum.
4225 (long_opts, usage, main): New option --random-source.
4226 * src/sort.c: Likewise.
4227 * src/shred.c (struct irand_state, irand_init, irand32, irand_mod): Remove.
4228 All callers changed to use randint interface.
4229 (fillrand): Remove. All callers changed to use randread interface.
4230 (dopass): Remove dependency on ISAAC buffer size.
4231 (genpattern): Don't wipe the random state here.
4232 (randint_source): New static var.
4233 (clear_random_data): New function.
4234 (main): Allocate random source, and arrange to wipe it on exit.
4235 * src/sort.c: Include md5.h, randread.h, xmemxfrm.h.
4236 (longopts, usage, main): Remove undocumented --seed option;
4237 it's now replaced by --random-source.
4238 (rand_state, get_hash): Remove.
4239 (randread_source): New static var.
4240 (random_state, cmp_hashes, compare_random): New functions; they guarantee
4241 no collisions in the random hash function.
4242 (keycompare): Use compare_random for -R; don't fall back on comparing
4243 via memcoll, since compare_random does the right thing.
4244 * tests/misc/Makefile.am (TESTS): Add shuf.
4245 * tests/misc/shuf: New file.
4247 2006-07-29 Paul Eggert <eggert@cs.ucla.edu>
4249 * src/copy.c (set_author): Preserve the st_author field via the
4250 file descriptor dest_desc.
4252 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
4254 * NEWS: chmod now preserves setuid and setgid bits on directories
4255 if you use a numeric mode with them clear, e.g., "chmod 755 DIR".
4257 Fix test case problems if working directory is setgid,
4258 reported by Bob Proulx.
4259 * tests/cp/fail-perm: Use symbolic mode so that we clear
4260 setgid bit more reliably on directories.
4261 * tests/mkdir/special-1 (set_mode_string): Likewise.
4263 2006-07-27 Jim Meyering <jim@meyering.net>
4265 * src/chgrp.c (usage): Use correct grammar in description of the
4267 * src/chown.c (usage): Likewise.
4269 2006-07-26 Thomas Schwinge <tschwinge@gnu.org> (tiny change)
4271 * src/copy.c (set_author) [HAVE_STRUCT_STAT_ST_AUTHOR]:
4272 Correctly access SRC_SB's element ST_AUTHOR.
4274 2006-07-26 Jim Meyering <jim@meyering.net>
4276 * tests/ls/stat-failed: Adapt to match new expected output.
4279 * src/ls.c (print_color_indicator): Test for S_IFREG first, rather
4280 than having the code test for all of the other types first.
4281 Hoist the set-uid/gid-testing code "up" into this new block.
4282 Classify any other type of file (e.g., S_TYPEISSHM, etc.) as
4283 C_ORPHAN, not as C_FILE.
4285 2006-07-26 Jim Meyering <jim@meyering.net>
4287 Checking in a change from Paul.
4289 2006-07-25 Paul Eggert <eggert@cs.ucla.edu>
4291 * src/ls.c (DT_INIT): Remove. All uses removed.
4292 (enum filetype): Use an ordinary enum rather than trying to keep
4293 the values in sync with DT_FIFO etc. That way, we don't have
4294 to make special assumptions about them. All uses changed.
4295 (whiteout): New constant member of enum filetype.
4296 (filetype_letter): New constant, for use with enum filetype.
4297 (FILETYPE_INDICATORS): New initializer list.
4298 (print_dir): Add case for DT_WHT.
4299 (gobble_file): If stat fails, don't discard information from
4300 readdir; instead, preserve it so it can be printed.
4301 (print_long_format): Fall back on readdir result if stat info
4302 is not available. Use "?" to denote each unknown mode char,
4303 instead of an overall "?", since we now know some of the mode
4305 (print_type_indicator): Now that MODE isn't necessarily
4306 useful, guard all uses.
4307 Now that two blocks in the type-checking tree can set "type = C_FILE",
4308 move the suffix-handling code out and down.
4310 2006-07-26 Jim Meyering <jim@meyering.net>
4312 Prepare for the above change.
4313 * src/ls.c [struct fileinfo] (stat_ok): Rename from stat_failed,
4314 and adjust uses. From a patch by Paul Eggert.
4316 2006-07-26 Jim Meyering <jim@meyering.net>
4318 * src/ls.c: Correct indentation/formatting in a few places.
4320 2006-07-25 Paul Eggert <eggert@cs.ucla.edu>
4322 * tests/cp/fail-perm: Use "chmod 0500" rather than "chmod 500".
4323 Problem report and fix from Bob Proulx.
4324 * NEWS: Clarify the "chmod 0500" news, and correct the vague
4325 statements about compatibility with BSD.
4327 2006-07-25 Jim Meyering <jim@meyering.net>
4329 * src/ls.c (gobble_file): When handling a stat-failed entry,
4330 print the entry name not the absolute_name -- to be consistent
4331 with the usual case.
4332 * tests/ls/stat-failed: Update accordingly.
4334 * src/ls.c: Add parens around the new uses of ?: ternary operator.
4336 * src/dircolors.hin: Mention that ORPHAN refers not just to dangling
4339 Get --dired offsets right when handling stat-failed entries.
4340 * src/ls.c (print_long_format): Be careful to increment P by the
4341 appropriate amount, even when inode_number_width and nlink_width
4343 * tests/ls/stat-failed: Test for the above.
4345 * src/ls.c (gobble_file) [USE_ACL]: Don't use-uninitialized the
4346 have_acl member. That would happen for a directory with both a
4347 non-stat'able entry and one with an ACL.
4349 * src/ls.c (gobble_file): Make it so failure to stat a
4350 non-command-line file provokes an exit status of 1, not 0.
4351 Say "cannot access" rather than "cannot stat".
4352 * tests/ls/stat-failed: New file/test, for the above.
4353 * tests/ls/Makefile.am (TESTS): Add stat-failed.
4354 * tests/ls-2/tests (no-a-isdir-b): Update to reflect addition
4355 of "cannot access " to diagnostic.
4357 * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere.
4359 * src/ls.c [enum filetype] (command_line): Remove member. Not needed.
4360 Replace all occurrences of "type == command_line" with the
4361 equivalent, "command_line_arg".
4363 * src/ls.c: Apply the stat-failed parts of Red Hat's
4364 coreutils-selinux.patch. From Ulrich Drepper.
4365 This makes it so files not mentioned on the command line (e.g.,
4366 names read from a directory that *is* mentioned on the command
4367 line) for which stat fails are still listed. With --color,
4368 such files are colored just like ORPHANs (aka dangling symlinks).
4370 * src/df.c (n_valid_args): Declare global to be static.
4372 2006-07-24 Jim Meyering <jim@meyering.net>
4374 * tests/ls/stat-dtype: Skip this test on reiserfs, since that file
4375 system lacks d_type support.
4377 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
4379 * man/chmod.x: Update to reflect recent changes to coreutils.texi.
4381 2006-07-21 Jim Meyering <jim@meyering.net>
4383 * src/su.c (usage): Correct typo in --help output: s/commmand/command/
4384 Reported by Tim Waugh.
4385 Also remove the comment duplicating much of --help output.
4387 * src/ls.c (FILE_TYPE_INDICATOR_OPTION): Reposition this new
4388 name so the list remains alphabetized.
4390 Fix another bug: ls --indicator-style=file-type would call
4391 stat for a symlink, even though it wasn't always needed.
4392 In some cases, that unnecessary stat would cause ls to fail.
4393 * src/ls.c (gobble_file): Don't treat symlinks specially (in
4394 requiring a stat syscall). Remove the offending exclusion.
4396 * NEWS: Mention the fix.
4398 * tests/ls/stat-dtype: New file/test, for the above fix.
4399 Also exercises the new df feature, below.
4401 * src/df.c (main): Fail and don't print the headers if no
4402 file system is processed. This makes it easy to test whether
4403 a specified directory is on a file system of a given type or types.
4404 Otherwise, applications would have had to parse df's output.
4405 E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs .
4407 Fix a bug: ls --file-type worked like --indicator-style=slash,
4408 rather than like --indicator-style=file-type.
4409 * src/ls.c (FILE_TYPE_INDICATOR_OPTION): New enum member.
4410 (long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION,
4412 (decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION.
4413 * NEWS: Mention the fix.
4414 * tests/ls-2/tests (file-type): New test, for the above fix.
4416 2006-07-19 Jim Meyering <jim@meyering.net>
4418 * src/ls.c (print_dir): Give a better diagnostic for failed opendir.
4420 * Makefile.am (EXTRA_DIST): Add build-aux/vc-list-files.
4422 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
4424 * NEWS: chmod, install, and mkdir now leave setgid and setuid bits
4425 of directories alone unless you specify them explicitly.
4426 install and mkdir now implement X correctly.
4427 install now creates parent directories with mode 755, without
4428 changing their owner or group.
4429 * src/chmod.c (process_file): Adjust to mode_adjust API change.
4430 * src/install.c: Include mkancesdirs.h.
4431 (announce_mkdir, make_ancestor): New functions.
4432 (DEFAULT_MODE): New macro, specifying initial value of 'mode'.
4434 (dir_mode, dir_mode_bits): New vars.
4435 (main): Set dir modes separately from nondir, so that the X
4436 op of -m works correctly.
4437 (main): Remove cwd_errno cruft, since make_dir_parents no longer
4438 affects cwd. Adjust to new make_dir_parents API.
4439 (install_file_in_file_parents): 2nd arg is now char *, not char
4440 const *. Use mkancesdirs instead of rolling our own code.
4441 (change_attributes): Don't worry about AFS, since that kludge
4442 should not be needed any more.
4443 * src/mkdir.c (struct mkdir_options): New struct.
4444 (announce_mkdir, make_ancestor): New functions.
4445 (main): Use them. Adjust to mode_adjust API change. Stick with
4446 umask 0. Use make_dir_parents for all the work.
4447 * src/mkfifo.c (main): Adjust to new mode_adjust API.
4448 * src/mknod.c (main): Likewise.
4449 * tests/chmod/setgid: Do the setgid test instead of bailing.
4450 * tests/mkdir/p-3: Remove re_protect case that no longer applies.
4451 GNU chmod now behaves like other versions of chmod.
4452 * tests/mkdir/perm: Add a test for the X bug.
4454 2006-07-14 Paul Eggert <eggert@cs.ucla.edu>
4456 * src/base64.c (do_decode): Output to parameter OUT, not to stdout.
4457 This doesn't fix any bugs, since OUT always equals stdout, but it
4458 makes the code easier to understand.
4460 2006-07-14 Jim Meyering <jim@meyering.net>
4462 * Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files,
4463 rather than open-coding it. Now supports mercurial, too.
4464 * .hgignore: New file.
4465 * Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly
4466 all generated files, including ones like configure and po/*.po
4467 that are currently version-controlled in cvs.
4469 * Makefile.am (EXTRA_DIST): Add a few more .??* files.
4470 They've been in CVS, just haven't been distributed before this.
4471 Distribute ChangeLog-2005, too.
4472 (MAINTAINERCLEANFILES): Add THANKS-to-translators.
4474 2006-07-11 Paul Eggert <eggert@cs.ucla.edu>
4476 * src/system.h: Assume <dirent.h> exists, since gnulib assumes
4479 2006-07-09 Jim Meyering <jim@meyering.net>
4481 * tests/mv/dir2dir: Adjust so failing with ENOTEMPTY is ok, too.
4482 That happens with Linux/tmpfs.
4483 * tests/mv/Makefile.am (TESTS): Add dir2dir.
4485 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4487 Adjust to recent updates from gnulib.
4488 * src/dd.c (apply_translations): Use toupper rather than
4489 islower followed by toupper; it's simpler and typically
4490 faster now that we assume at least C89 semantics. Similarly
4492 * src/sort.c (inittables): Likewise.
4493 * src/expand.c (expand): Don't assume that isprint etc. return
4494 booleans (needed for pre-C99 hosts).
4495 * src/fmt.c (check_punctuation): Likewise.
4496 * src/ptx.c (initialize_regex, fix_output_parameters): Likewise.
4497 * src/tr.c (is_char_class_member): Likewise.
4498 * src/unexpand.c (unexpand): Likewise.
4499 * src/join.c (is_blank): Remove; no longer needed. All uses
4500 replaced by isblank (to_uchar (...)).
4501 * src/pinky.c (create_fullname): Don't assume char is unsigned.
4502 * src/printf.c (print_esc): Likewise.
4503 * src/ptx.c (SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS):
4504 (copy_unescaped_string): Likewise.
4505 * src/stat.c (print_it): Likewise.
4506 * src/system.h (_D_EXACT_NAMELEN): Renamed from NLENGTH, for
4507 convenience on GNU systems. All uses changed. Don't bother
4508 looking for any dirent.h substitute other than ndir.h.
4509 (D_INO): Remove unnecessary parentheses.
4510 (IN_CTYPE_DOMAIN, ISGRAPH, ISPRINT, ISALNUM, ISALPHA):
4511 (ISCNTRL, ISLOWER, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT):
4512 (ISDIGIT_LOCALE, TOLOWER, TOUPPER): Remove. All uses changed
4513 to ctype.h equivalents.
4514 (isblank): Renamed from ISBLANK. Check for HAVE_DECL_ISBLANK too.
4517 2006-07-08 Jim Meyering <jim@meyering.net>
4519 * tests/mv/dir2dir: New file, test for 2006-07-05 fix in copy.c.
4521 * Makefile.maint (sc_the_the): New rule.
4523 * src/dd.c (skip): Remove one of two adjacent "the"s in a comment.
4524 * tests/Coreutils.pm (run_tests): Remove one of two adjacent "then"s
4527 2006-07-07 Jim Meyering <jim@meyering.net>
4529 * NEWS: Mention that mv can now remove an empty destination directory,
4530 and give an example. Prompted by a report from Florent Bayle.
4532 2006-07-05 Jim Meyering <jim@meyering.net>
4534 * src/ls.c (usage): Correct the description of -G: it is useful
4535 only in a long listing. Reported by Martin Pool in
4536 <https://launchpad.net/distros/ubuntu/+source/coreutils/+bug/51653>.
4538 * man/chmod.x: Correct the description of the sticky bit. Reported
4539 by Chris Moore via Ian Jackson in <http://bugs.debian.org/376745>.
4541 * src/copy.c (copy_internal): Don't work around old NFS clients like
4542 SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and
4543 ENOTEMPTY upon failed rename. Otherwise, we risk misinterpreting
4544 a banal failure as a recursive move-into-self failure.
4545 Reported by Florent Bayle in <http://bugs.debian.org/376749>.
4547 * src/c99-to-c89.diff: Regenerate, to remove fuzz.
4549 2006-07-03 Jim Meyering <jim@meyering.net>
4551 Plug another unusual leak.
4552 (AD_mark_helper): Free malloc'd filename if hash_insert says
4553 that string is already in the hash table.
4555 The dev/inode of the topmost directory in each hierarchy were not
4557 * src/remove.c (remove_cwd_entries): Don't call cycle_check here.
4558 (AD_push): Call it from here instead.
4560 Fix two small leaks.
4561 * src/remove.c (AD_stack_clear): New function.
4563 (AD_pop_and_chdir): Free *prev_dir just before longjmp.
4565 * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):
4566 Add $VG_PATH_PREFIX as a prefix to $PATH
4568 * tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT.
4569 * tests/Makefile.am (evar-check): Remove rule.
4570 (EXTRA_DIST): Remove .env-warn.
4571 * tests/.env-warn: Remove file. No longer used.
4572 Suggestion from Eric Blake.
4574 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
4576 * src/system.h: Include <stdint.h> unconditionally, since we
4577 now assume the stdint module.
4579 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
4581 * NEWS: With no operand, 'tail -f' now silently ignores the '-f'
4582 only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
4583 * src/tail.c (main): Implement this.
4584 * tests/tail/Test.pm (f-pipe-1): Renamed from f-1.
4585 (test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests.
4587 2006-07-01 Jim Meyering <jim@meyering.net>
4589 * src/ln.c (do_link): Use new, shorter URL, for ag-review link.
4591 * .x-sc_require_config_h: Add ^lib/xstrtold\.c$, so make distcheck
4594 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
4596 * NEWS: seq now uses long double internally rather than double.
4597 It now defaults to a minimal fixed point format if possible.
4598 It lets you use %a, %A, %E, %F, %G.
4599 * src/Makefile.am (seq_LDADD): Remove $(SEQ_LIBM); add $(POW_LIB).
4600 * src/seq.c: Don't include <math.h> or <xstrtol.h>; no longer needed.
4601 (isfinite) [!defined isfinite]: New macro.
4602 (separator, terminator): Now points to const.
4603 (first, step, last): Remove.
4604 (usage): Update to match new behavior.
4605 (struct operand, operand): New type.
4606 (scan_arg): Renamed from scan_double_arg, since we no longer use double.
4608 Compute and return a value of type operand, not double.
4609 (long_double_format): Renamed from valid_format, and now returns a
4610 new format with an "L" added if needed, if the original format was
4611 valid. Allow %a, %A, %E, %F, and %G formats.
4612 (print_numbers): Take numeric values as args rather than from globals.
4613 Print long double, not double.
4614 (get_width_format): Remove.
4615 (get_default_format): New function.
4616 (main): Implement new way of calculating default format.
4617 Don't worry about locale's representation of the decimal point, since
4618 the arguments are always processed in the C locale.
4619 * tests/seq/basic (neg-2): Adjust to new default format.
4620 (eq-wid-1, eq-wid-2): Resurrect these tests, since the new
4621 implementation should do the right thing.
4623 2006-06-30 Jim Meyering <jim@meyering.net>
4625 * tests/stty/basic-1: Work around an intermittent test failure
4626 on HP-UX 11.11. Report and analysis from Bob Proulx.
4627 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7475
4629 2006-06-28 Paul Eggert <eggert@cs.ucla.edu>
4631 * NEWS: Support obsolete usages like "sort +1 -2" even when
4632 conforming to POSIX 1003.1-2001, since this is a pure extension to
4633 POSIX. Problem reported by Christian in:
4634 http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00220.html
4635 * src/sort.c (main): Implement this.
4637 * src/system.h (CLOSEDIR): Remove. All uses changed to closedir.
4638 Autoconf 2.60 says this stuff was obsolete.
4640 2006-06-28 Jim Meyering <jim@meyering.net>
4642 * src/c99-to-c89.diff: Regenerate, to remove fuzz.
4644 2006-06-28 Bob Proulx <bob@proulx.com> (tiny change)
4646 * tests/mv/i-link-no: Work around HP-UX /bin/sh tracing problem
4647 (set -x when VERBOSE=yes) when stderr is redirected before stdout
4648 causing shell tracing of the stdout redirection to be written to
4649 the stderr file. Avoid problem and test failure on HP-UX by
4650 redirecting stderr last.
4651 * tests/dd/unblock-sync: Order shell file redirections for
4652 stderr and stdout in the common style.
4653 tests/acl: Likewise.
4655 2006-06-27 Jim Meyering <jim@meyering.net>
4657 * tests/misc/cat-proc: Try to avoid any spurious numeric
4658 differences in frequently-changing /proc/cpuinfo.
4659 Reported by Nelson Beebe.
4661 2006-06-26 Jim Meyering <jim@meyering.net>
4663 Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any
4664 fd_to_subdirp failure, not just when errno == EACCES.
4665 * src/remove.c (remove_dir): Use unlinkat-with-AT_REMOVEDIR, not
4666 rmdir, here, even though rmdir may happen to be adequate.
4668 * NEWS: rm no longer fails to remove an empty, unreadable directory
4669 * src/remove.c (remove_cwd_entries): If we can't open a directory,
4670 and the failure is not being ignored, try to remove the directory
4671 with rmdir (aka unlinkat-with-AT_REMOVEDIR), in case it's empty.
4672 Problem report and test case from Paul Eggert in
4673 <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7425>.
4675 * tests/rm/empty-inacc: New test, for the above.
4677 Avoid a segfault for wc --files0=- < /dev/null.
4678 * src/wc.c (compute_number_width): Return right away if nfiles == 0.
4680 2006-06-25 Jim Meyering <jim@meyering.net>
4682 * NEWS: wc accepts a new option --files0-from=FILE, where FILE
4683 contains a list of NUL-separated file names.
4685 * src/wc.c: Include "readtokens.h".
4686 (usage): Describe the new option, and adjust the `Usage':
4687 with this option, no FILE may be specified on the command line.
4688 (main): Handle the new option.
4689 * tests/misc/wc-files0: New tests, for the above.
4690 * tests/misc/wc-files0-from: Likewise.
4691 * tests/misc/Makefile.am (TESTS): Add wc-files0.
4693 2006-06-24 Jim Meyering <jim@meyering.net>
4695 * src/md5sum.c (DIGEST_BUFFER): Remove now-unused definitions.
4697 2006-06-22 Jim Meyering <jim@meyering.net>
4699 * src/tee.c (tee_files): Rename from tee, to avoid conflict with
4700 the function in glibc's <fcntl.h>. Reported by Andreas Schwab.
4702 2006-06-19 Jim Meyering <jim@meyering.net>
4704 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4705 so this check is not run as part of "make distcheck".
4707 2006-06-18 Bob Proulx <bob@proulx.com> (tiny change)
4709 * tests/misc/pwd-long: Fix typo (s/neq/ne/) in previous change.
4711 2006-06-18 Jim Meyering <jim@meyering.net>
4713 * tests/misc/pwd-long: Make error output a little clearer.
4715 2006-06-17 Jim Meyering <jim@meyering.net>
4717 * tests/rm/inaccessible: Skip this test on systems without openat
4718 support. Reported by Bob Proulx.
4720 2006-06-15 Bob Proulx <bob@proulx.com> (tiny change)
4722 * tests/misc/mknod: Improve permission checks to handle
4723 running mkdir test in set-gid directories.
4725 2006-06-14 Jim Meyering <jim@meyering.net>
4727 * tests/du/basic: Revamp not to hard-code file system block sizes.
4729 2006-06-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4731 * tests/du/Makefile.am (TESTS_ENVIRONMENT): Pass $(PERL), for
4734 2006-06-11 Jim Meyering <jim@meyering.net>
4736 * .gitignore: New file.
4737 * Makefile.am (EXTRA_DIST): Add .gitignore.
4739 Setting TIME_STYLE=long-iso in the environment would make the
4740 cp/same-file test fail.
4741 * tests/envvar-check (vars): Add TIME_STYLE to the list.
4742 * tests/cp/same-file: Revert last change.
4743 Source the envvar-check script, to ensure that TIME_STYLE
4744 settings don't affect these tests.
4746 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4748 * tests/cp/same-file: Execute 'ls' in the C locale, so that it
4749 uses POSIX time stamp formats. Problem reported by John Nixon in
4750 <http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00062.html>.
4752 2006-06-10 Jim Meyering <jim@meyering.net>
4754 * NEWS: Mention the AIX-strndup-bug vs. dircolors workaround.
4756 Require a "Version N.M" line at the top of the ChangeLog
4757 file only when making the actual release, not when running
4759 * Makefile.maint (maintainer-distcheck): Don't depend on
4761 (alpha beta major): Depend on it here, instead.
4763 2006-06-08 Jim Meyering <jim@meyering.net>
4765 Ensure that cat works with any of the options, -A -v -e -E -T,
4766 when applied to files in /proc and /sys, even when the FIONREAD
4767 ioctl produces nonsensical results. Before this change, cat would
4768 produce no output (or truncated output), for some linux kernels.
4770 * src/cat.c (write_pending): New function, factored out of cat.
4771 (cat): Also interpret a negative ioctl/FIONREAD count as indicating
4772 that there are bytes to read. Some versions of linux-2.6.16 do that.
4773 Write any pending output before returning.
4774 Reported by Dan Jacobson in <http://bugs.debian.org/370583>.
4775 * NEWS: Mention this bug fix.
4776 * tests/misc/cat-proc: New file. Test for the above.
4777 * tests/misc/Makefile.am (TESTS): Add cat-proc.
4779 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4781 * src/expr.c (eval4): Detect overflow properly when multiplying
4784 2006-06-06 Paul Eggert <eggert@cs.ucla.edu>
4786 * NEWS: The 'expr' command now detects and reports integer overflow.
4787 (It would be better to use extended precision instead, but that
4788 would be more work.)
4789 * src/expr.c (integer_overflow): New function.
4790 (eval4, eval3): Check for integer overflow.
4792 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4794 Fix problems when building with Solaris/SVR4/etc. make, which uses a
4795 different and somewhat bogus implementation of VPATH. In the
4796 directory tests/misc, rename tests whose names might appear in the
4797 Automake-generated rules. For example, we can't use a test named
4798 'test', since Automake generates a rule that contains the text
4799 "if test -f ./$$tst; ...", and this might expand to something like
4800 "if ../../../coreutils-6.0/tests/misc/test -f ./$$test; ...",
4801 which executes the 'test' script rather than the 'test' command.
4802 * tests/misc/false-status: Renamed from tests/misc/false.
4803 * tests/misc/pwd-long: Renamed from tests/misc/pwd.
4804 * tests/misc/sort-merge: Renamed from tests/misc/sort.
4805 ($prog): Set to 'sort' rather than to $PROG.
4806 * tests/misc/test-diag: Renamed from tests/misc/test.
4807 * tests/misc/Makefile.am (PROG): Take the basename of $$tst,
4808 in case Solaris make has prepended the directory.
4809 (TESTS): Adjust to above renamings.
4810 * tests/misc/expand: Don't assign to PROG; no longer needed
4811 now that Makefile.am sets PROG to the basename.
4812 * tests/misc/fold: Likewise.
4814 2006-06-03 Jim Meyering <jim@meyering.net>
4816 Make `cp --link --no-dereference' work also on systems where the
4817 link system call cannot create a hard link to a symbolic link.
4818 * src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
4819 the link syscall on a symlink when it would do the wrong thing.
4820 Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
4821 * tests/cp/link-no-deref: New file/test for the above.
4822 * tests/cp/Makefile.am (TESTS): Add link-no-deref.
4823 * NEWS: Mention the change (doesn't affect Linux).
4825 2006-06-01 Paul Eggert <eggert@cs.ucla.edu>
4827 Fix some porting problems in the test cases reported by
4828 Ralf Wildenhues for HP-UX 11.23 in:
4829 http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00238.html
4830 * tests/help-version: Don't assume that \< \> works in sed.
4831 * tests/misc/close-stdout: Don't assume that >&- works.
4832 Add a /dev/full test.
4833 * tests/touch/no-create-missing: Don't assume that >&- works.
4835 2006-05-30 Jim Meyering <jim@meyering.net>
4837 * src/ls.c (usage): Add `v' to the list of sorting-related options.
4840 2006-05-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4842 * tests/cp/fail-perm: source lang-default.
4843 * tests/rm/inaccessible: Likewise.
4845 2006-05-28 Jim Meyering <jim@meyering.net>
4847 * tests/rm/inaccessible: AIX 4.3.3 gives a different diagnostic.
4848 Recognize it, too. Reported by Ralf Wildenhues, in
4849 http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
4851 2006-05-27 Jim Meyering <jim@meyering.net>
4853 * src/chgrp.c: Support new options: --preserve-root and
4854 --no-preserve-root. Somehow this program was skipped when those
4855 options were added to chown, chmod, and rm. Reported by
4856 vaqflabuopac@spammotel.com in <http://bugs.debian.org/365656>.
4857 * NEWS: Mention this.
4859 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
4861 * NEWS: Remove mention of --seed. We'll replace it with something
4862 better, and don't want to indicate that it is supported.
4863 * src/sort.c (usage): Likewise.
4865 2006-05-20 Jim Meyering <jim@meyering.net>
4867 * src/chmod.c (main): Use FTS_PHYSICAL here, too.
4869 * src/du.c (main): Rename local, s/symlink_deref_bit/symlink_deref_bits/
4870 and arrange for -D to set fts' FTS_PHYSICAL bit as well as
4871 FTS_COMFOLLOW. Spotted by Justin Pryzby.
4873 * gnupload: Merge changes from automake, retaining the ""--to...
4874 kludge to placate overzealous `make distcheck' check.
4876 2006-05-19 Jim Meyering <jim@meyering.net>
4878 * src/du.c (main): Don't let -D, -L, or -P turn off the internal
4879 FTS_TIGHT_CYCLE_CHECK directory traversal option.
4880 Reported by Justin Pryzby in http://bugs.debian.org/367691
4882 2006-05-15 Jim Meyering <jim@meyering.net>
4884 * src/cp.c (usage): Correct description of -a: s/-dpR/-dpPR/.
4885 From Tomas Pospisek.
4887 2006-05-13 Jim Meyering <jim@meyering.net>
4889 * tests/mv/no-target-dir: Test two more cases.
4891 2006-05-11 Jim Meyering <jim@meyering.net>
4893 mv -T DIR EMPTY_DIR no longer fails unconditionally
4894 * src/copy.c (copy_internal): Don't manually prohibit a move where
4895 the destination is an existing directory. Sometimes doing that is
4896 valid. Let the rename system call enforce the rules. That is
4897 allowed only when the source is a directory and the destination
4898 directory (to be replaced) is empty. Reported by Eric Blake.
4899 * tests/mv/no-target-dir: New file/test for this.
4900 * tests/mv/Makefile.am (TESTS): Add no-target-dir.
4901 * NEWS: Mention this.
4903 * tests/mv/atomic: New file/test for yesterday's fix.
4904 * tests/mv/Makefile.am (TESTS): Add atomic.
4906 * tests/du/long-sloop: Avoid harmless `ambiguous redirect' diagnostic.
4908 2006-05-10 Jim Meyering <jim@meyering.net>
4910 * src/copy.c (copy_internal): Don't explicitly unlink the destination
4911 when moving a symlink into the place of an existing non-directory.
4912 Reported by Joshua Hudson.
4913 * NEWS: mention this.
4915 2006-05-07 Jim Meyering <jim@meyering.net>
4917 * Makefile.maint (patch-check): Fail if patch generates any output,
4918 even merely for changed offsets.
4920 * src/c99-to-c89.diff: Adjust to reflect new offsets.
4922 * NEWS: Mention changes affecting df, pwd, shred.
4924 2006-05-06 Jim Meyering <jim@meyering.net>
4926 * tests/ls/stat-vs-dirent: New test, to detect the bogus file
4927 system condition where dirent.d_ino != stat.st_ino.
4928 * tests/ls/Makefile.am (TESTS): Add stat-vs-dirent.
4930 2006-05-06 Eric Blake <ebb9@byu.net>
4932 * tests/ls/inode: Expand to test inode from readdir case.
4933 * tests/ls/follow-slink: Expand to test broken links encountered
4934 implicitly, favoring Solaris 9 and OpenBSD 3.4 behavior.
4936 2006-05-06 Eric Blake <ebb9@byu.net>
4938 * tests/mv/leak-fd: Work even on case-insensitive file system.
4940 2006-05-04 Jim Meyering <jim@meyering.net>
4942 * NEWS: Mention the 2006-03-19 pwd-related change that makes
4943 lib/getcwd.c work around inconsistent file system dirent.d_ino data.
4945 2006-05-03 Jim Meyering <jim@meyering.net>
4947 * src/ls.c (DEFINE_SORT_FUNCTIONS, LIST_SORTFUNCTION_VARIANTS):
4948 Use better macro parameter names: s/basename/key_name/,
4949 s/basefunc/key_cmp_func. Fix typo in comment.
4951 2006-04-29 Eric Blake <ebb9@byu.net>
4953 * src/ls.c (main): On systems with d_type, directories_first only
4954 implies format_needs_type, not format_needs_stat.
4956 2006-05-03 Jim Meyering <jim@meyering.net>
4958 * src/ls.c (xstrcoll_df_version, rev_xstrcoll_df_version): Add space
4959 after comma in arg list, from Eric Blake.
4961 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4963 * tests/misc/date (relative-3): New test, derived from a bug
4964 report by John Thomas McDole.
4966 2006-04-23 Francesco Montorsi <fr_m@hotmail.com>
4968 New option for ls: --group-directories-first.
4969 It makes ls list directories before files.
4970 * NEWS [New features]: Mention it.
4971 * src/ls.c (sort_type): Rearrange to use as an array index when
4972 choosing sort function; added new sort_numtypes member for
4974 (time_type): Add new time_numtypes member for compile-time check.
4975 (directories_first): New global variable.
4976 (GROUP_DIRECTORIES_FIRST_OPTION): New enum.
4977 (long_options): Add --directories-first.
4978 (main): Support new option.
4979 (is_directory): New function.
4980 (extract_dirs_from_files): Use it.
4981 (DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS)
4982 (LIST_SORTFUNCTION_VARIANTS): New macros.
4983 (sort_functions): New global variable.
4984 (sort_files): Use it.
4985 (usage): Document new option.
4987 2006-04-18 Paul Eggert <eggert@cs.ucla.edu>
4989 * src/shred.c (fillrand): The assertion was way too weak, due to
4990 what must be a typo. Strengthen it to its intended value.
4991 (dopass): Don't use alloca; it's not worth the aggravation here,
4992 since it's used only to get a page-aligned buffer, and page
4993 alignment doesn't buy us much here. I'm suspicious that alloca
4994 causes problems on some hosts, due to a recent bug report by Adam
4995 Waltman: http://bugs.gentoo.org/130246.
4997 2006-04-18 Jim Meyering <jim@meyering.net>
4999 * tests/misc/tty-eof: Add new programs, base64, sha224sum, sha256sum,
5000 sha384sum, sha512sum.
5002 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
5004 * src/chmod.c (describe_change): Adjust to filemode changes.
5005 * src/ls.c (HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c.
5006 (print_long_format): Use (new) filemodestring rather than
5007 (old) mode_string, so that we get more file types right, at least
5008 in theory. Adjust to filemode changes.
5009 * src/stat.c (human_access): Likewise.
5011 2006-04-18 Jim Meyering <jim@meyering.net>
5013 * src/ptx.c (main) [DEFAULT_IGNORE_FILE]: Remove code to use a default
5014 ignore file. This has never been enabled. Reported by Eric Blake.
5016 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
5018 * src/ln.c (linkfunc): Remove. This method ran into a compiler/linker
5019 bug in Interix. Just call symlink or link directly. All uses changed.
5020 * src/setuidgid.c (main) [! HAVE_SETGROUPS]: Don't call setgroups.
5021 * src/stat.c (USE_STATVFS): New macro.
5022 Include <sys/statvfs.h> and use statvfs only if USE_STATVFS.
5023 (NAMEMAX_FORMAT): define a bit more clearly, now that the
5024 statvfs-using code is a bit more regular.
5025 * src/system.h (sync) [!HAVE_SYNC]: New macro.
5027 2006-04-11 Paul Eggert <eggert@cs.ucla.edu>
5029 * NEWS: csplit, nl, expr now conform to POSIX better, and are
5030 more-compatible with traditional Unix, with respect to regular
5032 * src/csplit.c (extract_regexp): Set re_syntax_options to a
5033 value that is compatible with what POSIX requires.
5034 * src/nl.c (build_type_arg): Likewise.
5035 * src/expr.c (docolon): Likewise. Also, don't let anchors match
5036 newline; this fixes an incompatibility with tradition and with POSIX.
5037 Don't warn about leading ^. POSIX says it is unspecified whether
5038 ^ is a special character, which means that implementations can
5039 either treat it as special or not, but either way a warning is not
5040 allowed (unless the regexp is otherwise invalid). Instead, anchor
5041 the expression but treat ^ as an anchor; this is the traditional
5042 behavior (e.g., Solaris 10).
5043 (eval4, eval3, eval2): Treat non-numeric args, division by zero,
5044 and the like as invalid expressions (exit status 2), not as
5045 failure of 'expr' (exit status 3). This is more consistent with
5046 how Solaris behaves.
5047 * tests/expr/basic (fail-a): Adjust exit status to match new expr
5048 behavior, for status 2 versus 3.
5050 (bre1, bre2, bre3, bre4, bre5, bre6, bre7, bre8, bre9, bre10):
5051 (bre11, bre12, bre13, bre14, bre15, bre16, bre17, bre18, bre19, bre20):
5052 (bre21, bre22, bre23, bre24, bre25, bre26, bre27, bre28, bre29, bre30):
5053 (bre31, bre32, bre33, bre34, bre35, bre36, bre37, bre38, bre39, bre40):
5054 (bre41, bre42, bre43, bre44, bre45, bre46, bre47, bre48, bre49, bre50):
5055 (bre51, bre52, bre53, bre54, bre55, bre56, bre57, bre58, bre59, bre60):
5056 (bre61, bre62): New tests.
5057 * tests/misc/csplit: Use \{...\} in test RE, to test that we're
5058 conforming to POSIX.
5061 * tests/du/long-from-unreachable: Solaris 8 sh doesn't understand
5062 "if !". Do not assume that 'sed' can handle long, newline-free input.
5063 * tests/du/long-sloop: Likewise. Evaluate expr once, not $n times.
5065 2006-04-10 Paul Eggert <eggert@cs.ucla.edu>
5067 Adjust to new regex.h API (with new fastmap type), and clean
5068 up the regex storage allocation a bit.
5070 * src/csplit.c (struct control): Put re_compiled member at the
5071 end, since it's large. Change regexpr member from char * to bool;
5072 all uses changed. Add new member fastmap.
5073 (extract_regexp): regexp arg is now char const *, not char *.
5074 Don't bother duplicating the regular expression; it's not needed.
5075 Set fastmap from new fastmap member. Don't bother allocating
5076 a buffer, as the regexp code does a better job than we do.
5077 * src/expr.c (docolon): Allocate and use a fastmap.
5078 Don't bother allocating a buffer.
5079 * src/nl.c (body_fastmap, header_fastmap, footer_fastmap):
5081 (build_type_arg): New fastmap arg. All uses changed.
5082 Don't bother allocating a buffer, but set a fastmap.
5083 * src/ptx.c (context_regex_string, word_regex_string): Remove.
5084 (context_regex, word_regex): New vars, replacing the above.
5086 (struct regex_data): New type.
5087 (compile_regex): Renamed from alloc_and_compile_regex, since
5088 we no longer allocate storage. Arg is now a struct regex_data *,
5089 not a const char *. All uses changed. Don't allocate the fastmap;
5090 instead, take it from the caller. Don't convert size_t to int,
5091 to avoid arithmetic overflow problems. Don't bother freeing
5092 storage afterwards; it's not worth the aggravation.
5093 * src/tac.c (compiled_separator_fastmap): New ver.
5094 (main): Use it. Don't bother allocating a buffer.
5096 2006-03-30 Jim Meyering <jim@meyering.net>
5098 * src/dd.c (iwrite): Remove assignment without effect.
5099 Reported by Felix Rauch Valenti.
5101 2006-03-22 Eric Blake <ebb9@byu.net>
5103 * src/ptx.c (usage): Remove mention of --copyright/-C.
5104 (main): Alias --copyright to --version plus a deprecation warning.
5105 * NEWS: Mention this.
5107 2006-03-27 Jim Meyering <jim@meyering.net>
5109 * src/Makefile.am (uptime_LDADD): Add $(POW_LIB), for uptime's
5110 use of strtod. Tiny patch from Nickolai Zeldovich.
5112 2006-03-11 Eric Blake <ebb9@byu.net>
5114 * tests/misc/dirname: New file.
5115 * tests/basename/Makefile.am: Delete.
5116 * tests/basename/basic: Move to...
5117 * tests/misc/basename: ... this new file. Add some tests,
5118 including fixed behavior for //.
5119 * tests/misc/Makefile.am (TESTS): Sort. Add basename, dirname.
5120 * tests/Makefile.am (SUBDIRS): Remove basename.
5121 * configure.ac (AC_CONFIG_FILES): Remove tests/basename.
5123 Improvements to dirname/basename handling on platforms like
5124 cygwin with distinct // and with drive letters.
5125 * NEWS: Document new behavior.
5126 * src/basename.c (main): Don't strip suffix from file system
5128 * src/cp.c (target_directory_operand): Use new last_component.
5129 (ASSIGN_BASENAME_STRDUPA): Likewise. Reduce time spent
5130 traversing the string.
5131 * src/dircolors.c (guess_shell_syntax): Use new last_component.
5132 * src/install.c (target_directory_operand, install_file_in_dir):
5134 * src/ln.c (target_directory_operand, main): Likewise.
5135 * src/ls.c (basename_is_dot_or_dotdot): Likewise.
5136 * src/mv.c (target_directory_operand, movefile): Likewise.
5137 * src/remove.c (rm_1): Likewise.
5138 * src/shred.c (wipename): Likewise.
5139 * src/split.c (next_file_name): Likewise.
5140 * src/su.c (log_su, run_shell): Likewise.
5142 2006-03-23 Paul Eggert <eggert@cs.ucla.edu>
5144 * NEWS: nohup diagnostics are now more precise, and nohup now
5145 redirects stderr to nohup.out if stdout is closed and stderr is a tty.
5146 * src/nohup.c (main): Implement this.
5147 * tests/misc/nohup: Test the new behavior.
5149 2006-03-12 Jim Meyering <jim@meyering.net>
5151 * src/copy.c (set_author): Rename function, from preserve_author.
5153 * src/remove.c (AD_pop_and_chdir): Use new macro,
5154 CYCLE_CHECK_REFLECT_CHDIR_UP, rather than open-coding it.
5156 * src/system.h (SAME_INODE): Remove definition.
5157 Include "same-inode.h", instead.
5159 2006-03-11 Eric Blake <ebb9@byu.net>
5161 * src/pwd.c (robust_getcwd): Prepend only one slash, not two.
5163 2006-03-10 Jim Meyering <jim@meyering.net>
5165 Fix a bug whereby a user with write access to a directory being removed
5166 could cause the removal of that directory to fail with an erroneous
5167 diagnostic about a directory cycle. Reported by Vineet Chadha.
5169 * NEWS: Mention this.
5170 * src/remove.c (AD_pop_and_chdir): If the directory we're about to
5171 leave (and try to rmdir) is the one whose dev_ino is being used to
5172 detect a cycle, reset cycle_check_state.dev_ino to that of the parent.
5174 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
5176 * NEWS: Document dd's new 'directory' and 'nolinks' flags.
5177 * src/dd.c (set_fd_flags): Handle file-creation flags on file
5178 descriptors, rather than ignoring them.
5179 * tests/dd/misc: Add test cases for append, nofollow, directory,
5180 and nolinks flags. Simplify redirection to /dev/null in some cases.
5182 * tests/dd/misc: iflags->iflag. This fixes a typo that meant the
5183 noatime test never tested anything.
5185 2006-03-05 Paul Eggert <eggert@cs.ucla.edu>
5187 * src/dd.c (flags, usage): New flags directory, nolinks.
5188 * src/system.h (O_NOLINKS): Define to 0 if not already defined.
5190 * src/ls.c (usage): Mention that -f disables --color.
5191 Problem reported by Niels Möller.
5193 2006-03-03 Justin Pryzby <pryzbyj@justinpryzby.com>
5195 * man/*.x: Add references to syscalls from utilities of the same name.
5197 2006-03-05 Jim Meyering <jim@meyering.net>
5199 * tests/help-version: Set SHELL, if not already set, in order to
5200 avoid failure when `make check' is run through debuild; dircolors
5201 would fail due to lack of $SHELL. Reported by Sven Joachim.
5203 Make `base64 --wrap=N' work for N=0, and for N larger than SIZE_MAX.
5204 * src/base64.c (wrap_write, do_encode, main): Change type of
5205 parameters and locals, wrap_column, form size_t to uintmax_t.
5206 (main): Adjust to use xstrtoumax, accordingly.
5208 2006-03-03 Jim Meyering <jim@meyering.net>
5210 Don't fail when run from an environment with SHELL not a Bourne
5211 shell, e.g. `env SHELL=/bin/csh make check' would fail this test.
5212 * tests/dircolors/simple: Invoke each non-failing test with -b.
5213 Reported by Michael Stone.
5215 2006-02-27 Jim Meyering <jim@meyering.net>
5217 * tests/misc/base64: Derive --decode-using tests from the
5220 * tests/misc/base64: Factor out a long constant string.
5221 Split lines to stay within 80 columns.
5223 * tests/misc/Makefile.am (TESTS): Add base64.
5224 * tests/misc/base64: Test base64. From Simon Josefsson.
5226 * src/base64.c (do_decode): Use correct type for parameter,
5227 ignore_garbage: s/size_t/bool/.
5229 * src/base64.c: Don't include .h files already included by system.h:
5230 <string.h>, <stdlib.h>, <stdbool.h>, <limits.h>, <errno.h>.
5231 Include "system.h" before the other lib/*.h header files.
5232 Include <sys/types.h> before "system.h".
5233 (wrap_write): Remove declaration of unused local, initial_column.
5234 (wrap_write): Correct declaration syntax: s/size_t * V/size_t *V/.
5236 * README: Add base64 to the list.
5238 2006-02-17 Simon Josefsson <jas@extundo.com>
5240 New program: base64.
5241 * AUTHORS: Mention base64.
5243 * man/Makefile.am: Build base64.1.
5244 * man/base64.x: New file.
5245 * src/Makefile.am (bin_PROGRAMS): Add base64.
5246 * src/base64.c: New file.
5248 2006-02-25 Eric Blake <ebb9@byu.net>
5250 In ls, avoid calling stat for --inode (-i), when possible.
5251 * src/pwd.c (NOT_AN_INODE_NUMBER, D_INO): Move to ...
5252 * src/system.h: ... here, for use in ...
5253 * src/ls.c (main): ... here. Prefer dirent.d_ino to stat when
5255 (gobble_file): Add inode argument.
5256 (print_dir): Pass inode if available.
5257 (usage): Remove inaccuracy.
5259 2006-02-23 Jim Meyering <jim@meyering.net>
5261 * TODO: Update/correct some obsolete entries.
5263 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
5265 * doc/coreutils.texi (join invocation): Mention `sort -k 1b,1'.
5266 * src/join.c (usage): Likewise.
5267 Documentation problem reported by Philip Kensche.
5269 2006-02-20 Eric Blake <ebb9@byu.net>
5271 * man/rm.x: Update documentation to match previous patch.
5273 2006-02-18 Eric Blake <ebb9@byu.net>
5275 New option for rm: --interactive=once (-I).
5276 * NEWS: Document it, along with change to rm --interactive.
5277 * TODO: Remove entry for implementing rm -I
5278 * src/rm.c (INTERACTIVE_OPTION): New enum value.
5279 (interactive_type): New enum.
5280 (long_opts): Let interactive take an optional argument.
5281 (interactive_args, interactive_types): New option arguments.
5282 (usage): Document -I, --interactive=WHEN. Use program_name
5283 instead of a basename.
5284 (main): New -I option, new behavior to --interactive.
5285 * tests/rm/interactive-once: New tests.
5286 * tests/rm/interactive-always: Ditto.
5287 * tests/rm/Makefile.am (TESTS): Run them.
5289 2006-02-18 Jim Meyering <jim@meyering.net>
5291 * Makefile.maint (sc_two_space_separator_in_usage): Make the regular
5292 expression match more of the target lines, e.g., those that start with
5293 `-S,' (short option followed by a comma) or that include `=[...]'.
5294 Patch by Nicolas François.
5295 Fix the four offenders thus exposed:
5296 * src/join.c (usage): Use two spaces (not one) to separate the
5297 --first-only option string from its description, so help2man formats
5298 the derived man page properly.
5299 * src/pr.c (usage): Likewise.
5300 * src/uniq.c (usage): Likewise.
5301 * src/install.c (usage): Likewise.
5303 2006-02-15 Jim Meyering <jim@meyering.net>
5305 * Makefile.maint (alpha beta major): For `make major', ensure that the
5306 version string is of the form N.N[.N]*, where N is one or more digits.
5308 2006-02-14 Jim Meyering <jim@meyering.net>
5310 * INSTALL: Update from gnulib.
5312 2006-02-13 Jim Meyering <jim@meyering.net>
5314 * GNUmakefile (all): Emit diagnostics to stderr, not stdout.
5316 2006-02-12 Jim Meyering <jim@meyering.net>
5318 * Makefile.maint (patch-check): New target.
5319 (local-checks-available): Add to the list.
5321 2006-02-11 Jim Meyering <jim@meyering.net>
5323 * src/c99-to-c89.diff: New file.
5324 * src/Makefile.am (EXTRA_DIST): Add c99-to-c89.diff.
5326 * .x-po-check: New file, with exclusions so that `make distcheck'
5328 * Makefile.am (EXTRA_DIST): Add .x-po-check.
5330 rm -r must remove an empty directory, even if it is inaccessible.
5331 * src/remove.c (close_preserve_errno): New function.
5332 (fd_to_subdirp): Don't print a diagnostic in this function.
5333 Do it from the callers instead, unless rmdir succeeds.
5334 (remove_cwd_entries, remove_dir): Adjust callers.
5335 * tests/rm/empty-inacc: New test for the above.
5336 * tests/rm/Makefile.am (TESTS): Add empty-inacc.
5337 * NEWS: Mention this bug fix.
5338 * tests/rm/rm2: Adjust two expected diagnostics, now that they're
5339 a tiny bit less precise: cannot remove `a/1': ... instead of
5340 cannot open directory `a/1': ...
5342 * Makefile.maint (syntax-check-rules): Automatically derive this
5343 list of sc_-prefixed rule names.
5345 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
5347 * Makefile.maint (CVS_LIST): Don't assume cvsu is available.
5348 (CVS_LIST_EXCEPT): New macro, to simplify exception-processing.
5349 Most uses of CVS_LIST changed to use CVS_LIST_EXCEPT.
5350 (syntax-check-rules): Bring back sc_changelong. (Hmm, why did it
5351 go away? was that an accident?)
5352 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5353 (sc_cast_of_alloca_return_value, sc_space_tab, sc_prohibit_atoi_atof):
5354 (sc_error_exit_success, sc_file_system, sc_no_if_have_config_h):
5355 (sc_system_h_headers, sc_sun_os_names, sc_trailing_blank):
5356 (sc_two_space_separator_in_usage, sc_unmarked_diagnostics):
5357 (sc_obsolete_symbols, sc_changelog, sc_prohibit_jm_in_m4):
5358 (sc_useless_cpp_parens, makefile-check, m4-check, po-check):
5359 (author_mark_check, makefile_path_separator_check):
5360 Output line numbers, to simplify navigation of Emacs *compilation*
5362 (sc_prohibit_atoi_atof, sc_file_system):
5363 Rework slightly so that Makefile.maint doesn't get reported as a
5364 violation of its own syntax rules.
5365 (sc_dd_max_sym_length): Use ifneq to do nothing, instead of doing
5366 it at run-time (which didn't work with Bison). Fix a makefile typo,
5367 caught by Makefile.maint itself: spaces where a tab should be.
5368 (po-check): Check lib/*.[ch] even if not in CVS; used by Bison,
5369 which copies from ../gnulib/lib/*.[ch] to lib/*.[ch].
5370 Ignore djgpp and man subdirectories, to avoid false matches with
5371 Bison and coreutils, respectively. Use sort -u to remove the
5372 resulting duplicates.
5373 * gnupload: Rework slightly to avoid bogus warning from
5374 sc_two_space_separator_in_usage.
5376 2006-02-10 Jim Meyering <jim@meyering.net>
5378 Use gzip's --rsyncable option only if it's available.
5379 * Makefile.maint (gzip_rsyncable): New variable.
5382 2006-02-08 Jim Meyering <jim@meyering.net>
5384 * Makefile.maint (local-checks-available): Define in terms of
5385 the expansion, $(syntax-check-rules), rather than the single,
5386 top-level target `syntax-check', so that it's easier to exclude
5387 individual rules (via $(local-checks-to-skip)).
5388 (tgz-md5, tgz-sha1, ...): Remove now-unused definitions.
5390 2006-02-07 Jim Meyering <jim@meyering.net>
5392 * src/system.h (!defined O_DIRECT): If O_DIRECTIO is defined (as it
5393 is on Tru64), define O_DIRECT to that. Patch From James Lemley.
5395 * tests/help-version (expected_failure_status_vdir):
5396 Redirect an expected disk-full diagnostic to /dev/null.
5398 2006-02-06 Jim Meyering <jim@meyering.net>
5400 * src/unexpand.c (usage): Use two spaces (not one) to separate the
5401 --first-only option string from its description, so help2man formats
5402 the derived man page properly.
5403 * src/rm.c (usage): Likewise for --no-preserve-root.
5404 * src/chown.c (usage): Likewise.
5405 * src/chgrp.c (usage): Likewise.
5407 Add a rule to ensure that the above doesn't happen again.
5408 * Makefile.maint (sc_two_space_separator_in_usage): New rule.
5409 (syntax-check-rules): Add it.
5410 * .x-sc_two_space_separator_in_usage: New empty file.
5411 * Makefile.am (EXTRA_DIST): Add .x-sc_two_space_separator_in_usage.
5413 2006-02-06 Jim Meyering <jim@meyering.net>
5415 * src/cp.c (usage): Use two spaces (not one) to separate each
5416 option string from its description, so help2man formats the
5417 derived man page properly.
5418 * src/mv.c (usage): Likewise.
5419 Patch from Nicolas François in http://bugs.debian.org/351601.
5421 2006-02-04 Jim Meyering <jim@meyering.net>
5423 * src/copy.c (copy_internal): cp -RL would fail when encountering
5424 the same directory more than once in the hierarchy beneath a single
5425 command-line argument. That is legitimate, e.g. when there are
5426 two or more symbolic links, each pointing to some directory that
5427 would not otherwise be copied. Reported by Christophe LYON.
5428 * tests/cp/cp-deref: New file. Test for today's fix.
5429 * tests/cp/Makefile.am (TESTS): Add cp-deref.
5430 * NEWS: Document this.
5432 2006-02-03 Jim Meyering <jim@meyering.net>
5434 * configure.ac: Require automake-1.9.6, not 1.8.3.
5436 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
5438 * src/od.c (usage): Mention that -t a ignores high order bit.
5439 Documentation problem reported by Ed Avis.
5441 2006-02-01 Jim Meyering <jim@meyering.net>
5443 * src/pwd.c (find_dir_entry): Remove unused local, `ent_sb_valid'.
5445 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5447 * src/head.c (main): Use a better diagnostic when someone uses a
5448 trailing numeric option in an invalid way. Problem reported by
5450 * src/tail.c (parse_options): Likewise.
5452 2006-01-30 Jim Meyering <jim@meyering.net>
5454 * man/wc.x: Include `count' keyword in man page synopsis,
5455 per suggestion from http://bugs.debian.org/181585.
5457 2006-01-24 Paul Eggert <eggert@cs.ucla.edu>
5459 * src/df.c (show_dev): If the file system claims to have
5460 more available than total blocks, report the number of used
5461 blocks as being total - available (a negative number) rather
5462 than as garbage. Problem reported by Toralf Foerster.
5464 2006-01-24 Jim Meyering <jim@meyering.net>
5466 * src/tail.c (tail_forever): Don't exit-nonzero when an attempt
5467 to put a regular file in O_NONBLOCK mode fails with EPERM.
5468 That happens on Linux (up to 2.6.15) when using tail -f on a file with
5469 the append-only attribute. Reported by Dean Gaudet. For details,
5470 see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
5471 * NEWS: Mention this fix.
5472 * tests/tail-2/append-only: New file. Test for the above.
5473 * tests/tail-2/Makefile.am (TESTS): Add append-only.
5474 * tests/Makefile.am (check-root): Add tail-2/append-only
5476 2006-01-21 Jim Meyering <jim@meyering.net>
5478 * NEWS: Mention fts-related improvements and bug fixes.
5480 2006-01-19 Jim Meyering <jim@meyering.net>
5482 * tests/fmt/basic (pfx-1, pfx-2): New tests, to demonstrate the bug
5483 reported as http://bugs.debian.org/147577. Forwarded by Thomas Hood.
5485 2006-01-18 Jim Meyering <jim@meyering.net>
5487 * tests/du/Makefile.am (TESTS): Add long-from-unreadable.
5489 2006-01-17 Jim Meyering <jim@meyering.net>
5491 Now that fts no longer changes the current working directory, adjust
5492 its clients accordingly -- note that du.c uses fts but doesn't need
5493 any adjustment, since it doesn't operate on the actual files,
5494 but rather just uses the stat buffers provided by fts.
5496 * src/chown-core.c: Include "openat.h".
5497 Don't include "lchown.h".
5498 (restricted_chown): Accept a new parameter, CWD_FD, and use it in
5499 calling openat, lchownat, chownat, rather than open, lchown, chown.
5501 * src/chmod.c: Include "openat.h".
5502 (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
5504 * tests/du/long-from-unreadable: New test, to exercise one small
5507 2006-01-13 Jim Meyering <jim@meyering.net>
5509 * tests/Makefile.am (SUBDIRS): Add comments discouraging the
5510 addition of new directories under tests/.
5512 * tests/acl: Redirect stdin to /dev/null. Otherwise, FreeBSD 5.0's
5515 2006-01-12 Jim Meyering <jim@meyering.net>
5517 * tests/du/long-sloop: Adjust not to hard-code the expected
5518 diagnostic corresponding to ELOOP. Solaris' diagnostic differs
5519 from that of GNU libc. Reported by Paul Eggert.
5521 * tests/du/long-sloop: Create file at end of symlink chain.
5523 * tests/misc/test: New file, with a test for one of the
5524 bugs fixed by yesterday's test.c changes.
5525 * tests/misc/Makefile.am (TESTS): Add test.
5527 2006-01-11 Jim Meyering <jim@meyering.net>
5529 * tests/du/long-sloop: New file. Test for today's fts.c bug fix.
5530 That bug could make du -L, chgrp -L, or chown -L fail to diagnose
5531 a very long sequence of symbolic links (not necessarily a loop).
5532 * tests/du/Makefile.am (TESTS): Add long-sloop.
5534 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
5536 * src/test.c (test_syntax_error): Append a newline. All callers
5537 changed, except for the ones that didn't already append a newline.
5538 Bug reported by Eric Blake.
5540 2006-01-11 Jim Meyering <jim@meyering.net>
5542 * src/system.h (X2NREALLOC): Now that verify_true is no longer
5543 void, cast its result to void, to avoid gcc's warning that
5544 ``left-hand operand of comma expression has no effect''.
5545 (DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise.
5547 2006-01-10 Jim Meyering <jim@meyering.net>
5549 * tests/chmod/no-x: Add a test for today's fts.c fix.
5551 2006-01-10 Jim Meyering <jim@meyering.net> (tiny change)
5553 * src/ls.c (gobble_file): Use DTTOIF only if it's defined.
5554 This is necessary for Dragonfly. Patch by Joerg Sonnenberger.
5556 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
5558 * src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE):
5559 Use verify_true instead of verify_expr, to sync with gnulib.
5561 2006-01-08 Jim Meyering <jim@meyering.net>
5563 * src/date.c (usage): Adjust the formatting of the entries for
5564 %::z and %:::z (separate with two spaces, not one) so that help2man
5565 formats them properly. Reported by Philip Rowlands.
5567 2006-01-06 Paul Eggert <eggert@cs.ucla.edu>
5569 * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add.
5571 2006-01-06 Jim Meyering <jim@meyering.net>
5573 * Makefile.maint (copyright-check): Use date +%Y in place of
5576 * src/remove.c (rm_1): Remove `static' attribute on local `status'.
5577 First off, the attribute should have been `volatile' (not static)
5578 to avoid longjmp-related risk of clobber. Secondly, now there is
5579 no longer any risk of a local variable being clobbered, so there's
5580 no need for any attribute at all.
5582 2006-01-05 Jim Meyering <jim@meyering.net>
5584 * src/remove.c: Give a few functions the inline attribute.
5585 (AD_pop_and_chdir): Use gotos to avoid some duplication.
5586 (AD_push): Rewrite an assertion so that the entire computation
5587 goes away when assertions are turned off.
5589 * src/tail.c (ENOSYS) [!defined ENOSYS]: Don't define here.
5590 It's already defined in "system.h".
5591 * Makefile.maint: Add a FIXME comment.
5593 2006-01-04 Jim Meyering <jim@meyering.net>
5595 * ChangeLog: Remove entries from 2005-10-22 and earlier.
5596 * ChangeLog-2005: New file, for entries up to version 5.92.
5598 2006-01-03 Jim Meyering <jim@meyering.net>
5600 * tests/du/no-x: Also allow a slightly different diagnostic -- the
5601 one you get when using openat-enabled fts.c and du (coming soon).
5602 * tests/chmod/no-x: Likewise.
5603 * tests/chgrp/no-x: Likewise.
5605 * src/system.h (O_DIRECTORY) [!defined O_DIRECTORY]: Define.
5607 2006-01-02 Paul Eggert <eggert@cs.ucla.edu>
5609 * src/chown-core.c (RC_do_ordinary_chown): New enum value.
5610 (restricted_chown): Return it, if the file cannot be accessed due
5611 to EPERM, or if no uid or gid are required, or if the file is
5612 neither a directory nor a regular file. Rewrite to avoid gotos.
5613 (change_file_owner): Handle RC_do_ordinary_chown case.
5614 Rewrite to avoid gotos.
5615 * tests/chgrp/basic: Make sure we can change the group of
5618 * src/date.c (usage): Explain %g, %G, and %V a bit better.
5620 2006-01-02 Jim Meyering <jim@meyering.net>
5622 * src/copy.c (set_owner): Correct a comment.
5624 * src/tail.c (parse_options): Change warning to say that --retry
5625 is useful `mainly' (not `only') when following by name.
5626 Reported here: http://bugs.debian.org/273781
5628 2006-01-01 Paul Eggert <eggert@cs.ucla.edu>
5630 * NEWS: Document that mkfifo and mknod -m no longer set special bits.
5631 * src/copy.c: Include lchmod.h.
5632 (copy_internal): Use lchmod rather than chmod.
5633 * src/cp.c: Include lchmod.h.
5634 (re_protect, make_dir_parents_private): Use lchmod rather than chmod.
5635 * src/mkdir.c: Include lchmod.h.
5636 (usage): Clarify -m's operation.
5637 (main): Use lchmod rather than chmod. Don't use lchmod unless the
5638 new mode contains bits outside the 777 range.
5639 * src/mkfifo.c (usage): Clarify -m's operation.
5640 (main): If -m is given, don't invoke chmod; use umask 0 instead.
5641 Report an error if -m asks for bits outside the 777 range.
5642 * src/mknod.c (usage, main): Likewise.
5644 * src/mkdir.c, src/mkfifo.c, src/mknod.c: Undo 2005-12-19 changes.
5646 2005-12-27 Jim Meyering <jim@meyering.net>
5648 * Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY.
5649 (sc_prohibit_assert_without_use): New rule.
5650 (syntax-check-rules): Add it to the list.
5651 * .x-sc_prohibit_assert_without_use: New empty file.
5652 * Makefile.am (EXTRA_DIST): Add it.
5654 * Makefile.maint (CVS_LIST): Define in terms of $(srcdir).
5656 * cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c:
5657 Don't include <assert.h>; it wasn't used.
5659 2005-12-26 Paul Eggert <eggert@cs.ucla.edu>
5661 * src/chown-core.c (restricted_chown):
5662 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
5663 * src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
5664 | O_NOFOLLOW too, for consistency with other dir-openers.
5665 Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
5666 (is_empty_dir): Likewise.
5667 * src/shred.c (wipename): Likewise. Don't bother trying to open
5668 dir for writing, since POSIX prohibits it.
5670 2005-12-22 Jim Meyering <jim@meyering.net>
5672 * tests/help-version: Redirect stderr to /dev/full, to suppress
5673 write error diagnostic.
5675 2005-12-19 Jim Meyering <jim@meyering.net>
5677 * src/mkdir.c, src/mknod.c, src/mkfifo.c (main)
5678 Avoid a minor race condition when `-m MODE' is specified, by using
5679 open, fchown, and close rather than just chown. To do that reliably --
5680 even with an overly restrictive umask -- ensure that each mkdir,
5681 mknod and mkfifo call uses a mode including at least owner-read access.
5682 * src/mknod.c (main): When `-m MODE' is specified, exit nonzero if
5683 the subsequent chown (or equivalent open,fchown,close) fails.
5684 * tests/misc/mknod: New tests.
5685 * tests/misc/Makefile.am (TESTS): Add mknod.
5687 2005-12-17 Jim Meyering <jim@meyering.net>
5689 * src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang,
5690 e.g., on a named pipe.
5691 (OPEN_NO_FOLLOW_SYMLINK): Remove definition. Use O_NOFOLLOW in
5692 place of all uses, since it is guaranteed (system.h) to be defined.
5694 2005-12-05 Andreas Gruenbacher <agruen@suse.de>
5696 Add POSIX ACL support
5697 * src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall
5698 is no requirement for ACL support; particularly, it does not exist
5699 on systems that have POSIX ACLs.
5700 * src/copy.h (cp_option_init) [umask_kill]: Remove member.
5701 * src/cp.c (umask_kill): With default acls, the umask is not to be
5702 applied. Remove umask_kill, don't change the process umask, and let
5703 the kernel apply the umask where appropriate.
5704 * src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs.
5705 * src/copy.c (get_dest_mode): Remove; it is obsolete after removing
5707 (copy_reg, copy_internal): Use copy_acl and set_acl
5708 instead of fchown/chown. Fix the logic for POSIX ACLs.
5709 (chown_succeded): Remove; we now always copy acls and
5710 preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
5711 did a chown before or not.
5712 * src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member.
5713 * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD,
5714 mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange
5715 to link with it via $(LIB_ACL), for the utilities that need it.
5717 2005-12-16 Paul Eggert <eggert@cs.ucla.edu>
5719 * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
5720 (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
5721 (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
5722 value is now signified by whether cwd_errno is null.
5723 (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
5724 pointer-to-bool to pointer-to-errno-value. All callers changed.
5725 (rm_1): Don't bother setting a local cwd failure flag and then
5726 ORing it into the caller's. Just set the caller's.
5727 (rm): Use cwd failure errno value to print a slightly-better
5730 2005-12-15 Jim Meyering <jim@meyering.net>
5732 * src/stat.c (print_it): Properly handle a backslash at the
5733 end of a --printf format string. Reported by Paul Eggert.
5734 * tests/misc/stat-printf (end-bs): Add a test for the above.
5736 2005-12-15 Paul Eggert <eggert@cs.ucla.edu>
5738 * tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh.
5739 Don't assume /etc/passwd contains user names; use 'id' instead.
5741 2005-12-15 Jim Meyering <jim@meyering.net>
5743 stat: revert behavior of --format=FMT (-c)
5744 stat: add new option: --printf=FMT
5745 * NEWS: Mention this.
5746 * src/stat.c (isodigit, octtobin, hextobin): Define.
5747 (PRINTF_OPTION): Define.
5748 (interpret_backslash_escapes, trailing_delim): New globals.
5749 (usage): Document them. Alphabetize on long option names.
5750 (print_esc_char): New function.
5751 (print_it): Rewrite, in order to handle backslash escapes.
5752 (main): Handle new option. Set globals for --format, too.
5754 * tests/misc/stat-printf: Test --printf and --format.
5755 * tests/misc/Makefile.am (TESTS): Add stat-printf.
5757 2005-12-14 Paul Eggert <eggert@cs.ucla.edu>
5759 * NEWS: sort now reports incompatible options.
5760 * src/sort.c (incompatible_options, check_ordering_compatibility):
5762 (main): Use them. Don't bother with a usage message for
5763 "sort -c a b", for consistency with other error diagnostics.
5764 * tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4):
5767 * src/cat.c (main): Undo previous change. close_stdout already
5768 does the check, so the previous change wasn't necessary.
5770 2005-12-13 Paul Eggert <eggert@cs.ucla.edu>
5772 * src/cat.c (main): Check for close (STDOUT_FILENO) failure.
5774 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5776 Install a more-conservative approach for sort -R. It's the
5777 same basic idea as the existing code, except it uses the full ISAAC
5778 approach (called the "more kosher" approach in the existing comments).
5779 This makes "sort -R" quite a bit slower (about a factor of 2 on my
5780 little tests involving 10000 lines on a 2.4 GHz P4), but I think it's
5781 better to be conservative here at first, and review any performance
5782 improvements carefully.
5783 * .x-sc_require_config_h: Add src/rand-isaac.c.
5784 * src/rand-isaac.h: Remove. All uses now simply include rand-isaac.c.
5785 * src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h.
5786 (shred_SOURCES, sort_SOURCES): Remove.
5787 (EXTRA_DIST): Add rand-isaac.c.
5788 * src/rand-isaac.c: Revert to what used to be in shred.c, without
5789 changing it to allow for varying numbers of words in the state.
5790 Alter so that we include rand-isaac.c directly rather than
5791 compiling it and linking to it. Don't include config.h or
5792 system.h; that's the includer's responsibility.
5793 Omit functions that are specific to shred.
5794 (ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
5795 (isaac_step, struct irand_state):
5796 Resurrect these, with the same defns that used to be in shred.c.
5797 (ISAAC_SIZE, isaac_new, isaac_copy): Remove.
5798 (isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
5800 (struct isaac_state, isaac_refill, isaac_mix, isaac_init):
5801 (isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
5802 (irand_init, irand32, irand_mod):
5803 Number of words is constant again.
5804 (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c.
5805 * src/shred.c: Include rand-isaac.c rather than rand-isaac.h.
5806 * src/sort.c: Likewise.
5807 * src/shred.c (fillrand, dopass, main): Undo previous change.
5808 (struct irand_state, irand_init, irand32, irand_mod): Moved back here,
5810 * src/sort.c: Don't include md5.h; it wasn't needed.
5811 (struct keyfield): Rename random_hash to random, for consistency
5812 with the other member names. All uses changed.
5813 (usage): Tweak wording to mention STRING for --seed option.
5814 (short_options): Rorder for consistency with other programs.
5815 (rand_state): Now a struct, not a pointer to one. All uses changed.
5816 (HASH_WORDS, HASH_SIZE): Remove.
5817 (get_hash): Remove comments around resbuf size, since we can assume C89.
5818 Use a "more-kosher" (but slower) approach of invoking isaac_refill.
5819 (keycompare): Adjust to the new get_hash.
5821 (badfieldspec): Omit recently-introduced comment; it isn't needed.
5822 (main): Don't set need_random simply because gkey has it set; that
5823 doesn't necessarily mean we'll need random numbers.
5824 Redo seeding to match new get_hash approach.
5826 2005-12-10 Jim Meyering <jim@meyering.net>
5828 * src/Makefile.am (noinst_HEADERS): Add rand-isaac.h.
5830 Avoid shred segfault on 64-bit systems.
5831 * src/rand-isaac.c (isaac_refill): Don't try to negate a
5832 local of type uint32_t. Make the local an `int' instead.
5834 * NEWS: Mention sort's new options.
5836 * src/rand-isaac.c (isaac_mix): Declare to be static.
5837 Mark all other functions as `extern' so the tight-scope
5838 part of `make distcheck' passes once again.
5839 * src/rand-isaac.h (isaac_mix): Remove declaration.
5841 * src/sort.c (get_hash): Change position of `*' in parameter
5842 type to conform with convention.
5843 (main): Split a long line so it fits in 80 columns.
5844 (keycompare): Remove stray SPACE before TAB that was
5845 causing `make distcheck' to fail.
5847 * src/shred.c: Don't include gethrxtime.h. No longer needed.
5849 * tests/misc/sort-rand: New file: basic tests for the new options.
5850 * tests/misc/Makefile.am (TESTS): Add sort-rand.
5852 2005-12-10 Frederik Eaton <frederik@ofb.net>
5854 * src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME).
5855 (shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
5856 * src/rand-isaac.c: New file, containing ISAAC code that was in shred.c.
5857 Make state size runtime-configurable.
5858 (isaac_new, isaac_copy): New functions.
5859 * src/rand-isaac.h: New file.
5860 * src/shred.c: Include rand-isaac.h. Move ISAAC code to rand-isaac.c.
5861 (fillrand, main): Adjust to the fact that the state size is now
5862 runtime-configurable.
5863 * src/sort.c (short_options, long_options, WORDS, keycompare, main):
5864 (usage): Add options --random-sort and --seed to implement a random
5866 Include md5.h and rand-isaac.h.
5867 (get_hash): New function.
5868 (rand_state): New var.
5869 (HASH_WORDS, HASH_SIZE): New macros.
5871 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5873 * tests/dd/misc: Add test for dd iflags=noatime.
5875 2005-12-09 Jim Meyering <jim@meyering.net>
5877 * src/sort.c (usage): Mention white space vs -b and -t options.
5880 2005-12-09 Eric Blake <ebb9@byu.net>
5882 * src/test.c (main): Fix misleading comment.
5884 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5886 * NEWS: Mention dd's new noatime flag.
5887 * src/system.h (O_NOATIME): Define to 0 if not already defined.
5888 * src/dd.c (flags, usage): Add support for noatime flag.
5890 2005-12-07 Jim Meyering <jim@meyering.net>
5892 Distribute the cvsu script, used only by `make syntax-check'.
5893 * Makefile.am (EXTRA_DIST): Add build-aux/cvsu.
5894 * Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we
5895 distribute a copy of this script.
5896 * .x-sc_unmarked_diagnostics: Add build-aux/cvsu.
5898 * tests/mv/acl: exit-77 before the trap, not after, if we fail
5899 to create a temporary directory on another partition.
5900 From Andreas Gruenbacher.
5902 2005-12-06 Tomas Pospisek <tpo@sourcepole.ch> (tiny change)
5904 * man/basename.x: Cross-reference to dirname and readlink.
5905 * man/dirname.x: Cross-reference to basename and readlink.
5907 2005-12-05 Andreas Gruenbacher
5909 * src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1.
5910 (set_owner, preserve_author): New functions, factored out of copy_reg.
5911 (copy_reg): Use them.
5912 (copy_internal): Use them here, too.
5914 2005-12-04 Jim Meyering <jim@meyering.net>
5916 * src/sleep.c (usage): Say what happens with two or more arguments.
5917 Suggested by Justin Pryzby.
5919 * src/uptime.c (print_uptime): Move decl of `upsecs' into scope
5922 2005-12-03 Jim Meyering <jim@meyering.net>
5924 * src/rm.c (long_opts): Change the name of each undocumented, for-
5925 testing-only option to start with `-', so that it cannot render
5926 ambiguous any prefix it happens to share with some other option name.
5927 Problem reported by Eric Blake.
5928 * src/head.c (long_options): Likewise.
5929 * src/tail.c (long_options): Likewise.
5931 * tests/misc/head-elide-tail: Update uses of undocumented, for-
5932 testing-only --presume* options to start with `---'.
5933 * tests/rm/dangling-symlink: Likewise.
5934 * tests/rm/dir-no-w: Likewise.
5935 * tests/rm/isatty: Likewise.
5937 2005-11-30 Jim Meyering <jim@meyering.net>
5939 * Makefile.maint: Add a comment about cvsu.
5941 2005-11-25 Paul Eggert <eggert@cs.ucla.edu>
5943 * NEWS: df updates for "none", "proc", inaccessible file systems.
5944 * src/df.c (show_point): Ignore inaccessible file systems.
5945 (usage): -a includes dummy file systems, not size-0 file systems.
5947 * src/od.c (unsigned_long_long_int): Renamed from ulonglong_t,
5948 to avoid collision with POSIX name space. All uses changed.
5950 2005-11-24 Jim Meyering <jim@meyering.net>
5952 * tests/Makefile.am (EXTRA_DIST): Add acl to the list.
5953 * tests/acl: Add `$0: ' prefix to diagnostics.
5955 * .x-sc_require_config_h: Add lib/buffer-lcm.c to the list.
5957 2005-11-23 Paul Eggert <eggert@cs.ucla.edu>
5959 * src/copy.c: Improve performance a bit by optimizing away
5960 unnecessary system calls and going to a block size of at least
5961 8192 (on normal hosts, anyway). This improved performance 5% on my
5962 Debian stable host (2.4.27 kernel, x86, copying from root
5963 ext3 file system to itself).
5964 Include "buffer-lcm.h".
5965 (copy_reg): Omit last argument. All callers changed.
5966 Use xmalloc to allocate rather than trusting alloca
5967 (which is unwise with large block sizes).
5968 Declare locals more locally, if possible.
5969 Use uintptr_t words instead of int words, for a bit more speed
5970 when looking for null blocks on 64-bit hosts.
5971 Optimize away reads of zero bytes on regular files.
5972 In the typical case, insist on 8 KiB buffers, at least.
5973 Avoid unnecessary extra call to fstat when checking for sparse files.
5974 Avoid now-unnecessary cast to off_t, and "0L".
5975 Avoid unnecessary test of *new_dst when checking for same owner
5978 2005-11-22 Paul Eggert <eggert@cs.ucla.edu>
5980 * src/remove.c (rm): Don't assume C99 for-loop syntax.
5982 2005-11-22 Jim Meyering <jim@meyering.net>
5984 * src/remove.c (AD_push): Remove debugging cruft.
5986 * tests/rm/unread2 (rm): Change expected diagnostic,
5987 `cannot open directory' to `cannot remove', to align with
5989 * tests/rm/rm2: Ensure that rm now continues removing entries
5990 even after certain types of failure.
5992 * src/remove.c: Rewrite. Now, this module is reentrant on systems
5993 that provide openat (Solaris), and on systems like Linux+procfs
5994 where our openat emulation code is reentrant. This also fixes a
5995 few low-probability leaks and eliminates some code that could,
5996 in very unusual circumstances, cause rm() (via a callee) to exit.
5997 * NEWS: Mention this.
5999 * configure.ac: Put copyright dates all on one line so the
6000 emacs function that updates them works properly.
6002 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
6004 * configure.ac (AM_PROG_CC_C_O): Add. Needed for CVS Automake.
6005 Problem reported by Eric Blake.
6006 (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
6007 we get a standard-conforming compiler. This relies on the new
6008 m4/c.m4 file. Note that it's a bit tricky, since c.m4 doesn't
6009 define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
6010 m4/c.m4 can go away with Autoconf 2.60 comes out.
6012 2005-11-17 Jim Meyering <jim@meyering.net>
6014 * src/remove.c (AD_mark_helper): Make a `char *' parameter `const'.
6015 (AD_mark_current_as_unremovable): Likewise, but for a local.
6018 * tests/mv/acl: Let traps handle removing temporary directories.
6020 Expect acl-related tests to fail, until the corresponding
6021 patches are committed.
6022 * tests/mv/Makefile.am (XFAIL_TESTS): Add acl.
6023 * tests/cp/Makefile.am (XFAIL_TESTS): Likewise.
6025 ACL tests, from Andreas Gruenbacher.
6026 * tests/acl, tests/mv/acl, tests/cp/acl: New files.
6027 * tests/mv/Makefile.am (TESTS): Add acl.
6028 * tests/cp/Makefile.am (TESTS): Add acl.
6030 * src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment.
6032 2005-11-16 Paul Eggert <eggert@cs.ucla.edu>
6034 * NEWS: Improve quality of ln's diagnostics.
6035 * src/ln.c (do_link, usage): Likewise.
6036 (do_link): Don't use alloca on a buffer of unbounded size.
6038 2005-11-16 Jim Meyering <jim@meyering.net>
6040 * tests/cp/fail-perm: Accommodate HPUX. It appears to fail
6041 with EACCES rather than EPERM. Reported by Peter O'Gorman here:
6042 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
6043 This also affects AIX 4.3.3, according to Ralf Wildenhues, in
6044 http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
6046 2005-11-14 Jim Meyering <jim@meyering.net>
6048 * NEWS (sort): Mention consequences of today's mkstemp-safer.c fix.
6050 2005-11-13 Jim Meyering <jim@meyering.net>
6052 * announce-gen: Accept new option, --gpg-key-id=ID and
6053 emit a blurb telling how to use the .sig files.
6054 * Makefile.cfg (gpg_key_ID): Define.
6055 * Makefile.maint (announcement): Use new option and key.
6057 Require that most .c files include <config.h>.
6058 * Makefile.maint (sc_require_config_h): New rule.
6059 (syntax-check-rules): Add it.
6060 * .x-sc_require_config_h: New file listing exceptions to the
6061 above rule. Some are legit, others are simply grandfathered in.
6062 * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too.
6064 2005-11-12 Jim Meyering <jim@meyering.net>
6066 * src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files.
6068 2005-11-11 Jim Meyering <jim@meyering.net>
6070 * NEWS: Mention `readlink -f' bug fix in 5.3.0 news.
6071 Mention new readlink options in 5.3.0's `New features' section.
6072 Spotted by Thomas Hood.
6074 2005-11-08 Jim Meyering <jim@meyering.net>
6076 * NEWS: Merge in changes from b5_9x branch.
6078 2005-11-08 Paul Eggert <eggert@cs.ucla.edu>
6080 * NEWS: ls now defaults to --time-style='locale', which in turn acts
6081 like --time-style='posix-long-iso' if the locale settings are messed up.
6082 * src/ls.c (decode_switches): Implement this.
6084 2005-11-08 Jim Meyering <jim@meyering.net>
6086 * tests/du/2g: s/expensive/very expensive/ in a comment.
6089 2005-10-17 Eric Blake <ebb9@byu.net>
6091 * src/ls.c (usage): Fix descriptions of --sort, --time.
6092 Reported by Vitaly A. Ostanin.
6094 2005-11-04 Paul Eggert <eggert@cs.ucla.edu>
6096 * src/ln.c: Include filenamecat.c.
6097 (FILE_BASENAME_CONCAT): Remove.
6098 (do_link): Remove last arg DEST_IS_DIR. All callers changed.
6099 (main): Use file_name_concat, base_name, and strip_trailing_slashes
6100 instead of FILE_BASENAME_CONCAT. This simplifies the code, and avoids
6103 2005-11-04 Jim Meyering <jim@meyering.net>
6105 * src/du.c (process_file): Don't overflow for files of size >= 2^31
6106 on systems with stat.st_blocks of a signed 32-bit type.
6107 This bug causes trouble on some AIX 5.1 systems.
6108 Report and trivial patch from Paul Townsend:
6109 <http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
6110 * NEWS: Mention this.
6112 * tests/du/2g: New (very-expensive) test for the above-fixed bug.
6113 * tests/du/Makefile.am (TESTS): Add it here.
6114 * tests/very-expensive: New file.
6115 * tests/Makefile.am (EXTRA_DIST): Add it here.
6116 * tests/cp/perm: Mark this test as `very-expensive', too.
6118 2005-11-02 Paul Eggert <eggert@cs.ucla.edu>
6120 * NEWS: Mention that rm -d and maybe ln -d are scheduled for
6122 * src/remove.h (struct rm_options): Remove unlink_dirs. All uses
6124 * src/rm.c (usage): Don't mention rm -d.
6126 2005-11-02 Jim Meyering <jim@meyering.net>
6128 * tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils.
6129 From Andreas Schwab.
6131 * tests/dd/unblock-sync: Redirect stderr to /dev/null so the
6132 `M+N records in/out' lines don't pollute `make check' output.
6134 * tests/dd/skip-seek (sk-seek4): New test, to exercise the bug
6135 fixed on 2005-10-31. This test uses the new, IN_PIPE specifier.
6136 * tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE,
6137 to indicate that the input file should be piped into the command
6138 under test (via `cat FILE | $prog ...').
6140 * src/remove.c (remove_entry): Emit a better diagnostic when rm
6141 (without -r) fails to remove a directory on a non-Linux system.
6142 This change affects only newer Solaris systems (with priv_*
6143 functions like priv_allocset). Reported by Keith Thompson.
6145 * tests/rm/dir-nonrecur: New file/test for the above fix.
6146 * tests/rm/Makefile.am (TESTS): Add dir-nonrecur.
6148 2005-11-01 Paul Eggert <eggert@cs.ucla.edu>
6150 * NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as
6151 POSIX 1002.1-2001 requires.
6152 * src/tail.c (parse_obsolete_option): Implement this.
6153 Problem reported by Vincent Lefevre.
6154 * src/touch.c (main): Pass PDS_PRE_2000 to posixtime.
6155 * tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests.
6156 (test_vector): Add special cases for _POSIX2_VERSION, and
6157 regularize the old ones a bit.
6158 * tests/touch/obsolescent: Add y2000 test.
6160 2005-10-31 Paul Eggert <eggert@cs.ucla.edu>
6162 * src/dd.c (skip): Fix off-by-one error reported by
6163 Theodoros V. Kalamatianos.
6165 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
6167 * tests/mkdir/p-3: Require that the test be run as non-root.
6168 Problem and trivial fix reported by Theodoros V. Kalamatianos.
6170 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
6172 * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
6173 boundary between DEST and SOURCE in the result.
6175 2005-10-26 Dmitry V. Levin <ldv@altlinux.org>
6177 * src/md5sum.c (main) [!O_BINARY]: Changed default read mode
6178 back to text, to sync with documentation and for backwards
6181 2005-10-25 Jim Meyering <jim@meyering.net>
6183 * tests/dircolors/simple (other-wr): Add an explicit test for
6184 the dircolors bug (NULL-dereference) fixed yesterday.
6186 2005-10-24 Jim Meyering <jim@meyering.net>
6188 * src/tac.c (tac_file): When determining whether a file is seekable,
6189 also test whether it is a tty. Using only the lseek-based test would
6190 give a false positive on Solaris. Reported by Peter Fales.
6192 2005-10-24 Dmitry V. Levin <ldv@altlinux.org>
6194 * tests/install/d-slashdot: New test, for "install -d" failure.
6195 * tests/install/Makefile.am (TESTS): Add d-slashdot.
6196 * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
6197 * tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
6199 2005-10-24 Jim Meyering <jim@meyering.net>
6201 * src/dircolors.c (ls_codes): Add missing comma.
6202 Anonymous report and patch from
6203 http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
6205 * src/dircolors.c: Add compile-time assertion that the slack_codes
6206 and ls_codes arrays have the same number of elements. This would
6207 have prevented the above-fixed bug.
6209 * src/expand.c (parse_tab_stops): Add a comment to make this function
6210 identical to the one in unexpand.c.
6211 * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
6212 identical to the one in expand.c.
6214 * src/expand.c (next_file): Don't assume fopen cannot return stdin.
6216 2005-10-23 Jim Meyering <jim@meyering.net>
6218 * src/md5sum.c (digest_check, main): Use ptr_align rather than
6219 a dangerous pointer-value-to-`unsigned' cast.
6220 * NEWS: mention the new sha* programs.
6221 * AUTHORS: Add new sha* programs.
6223 2005-08-28 David Madore <david.madore@ens.fr>
6225 Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
6226 * README: Add their names to the list.
6227 * src/md5sum.c: Provide framework for computing sha-2 hashes.
6228 * src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum):
6229 Rules for compiling sha-2 utilities
6230 (noinst_HEADERS): Remove checksum.h.
6231 * man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x:
6233 * man/Makefile.am (dist_man_MANS): Add the corresponding .1 names.
6234 (sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
6235 * tests/misc/sha224sum, tests/misc/sha256sum: New files.
6236 * tests/misc/sha384sum, tests/misc/sha512sum: New files.
6237 * tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum,
6238 sha384sum, sha512sum test scripts here rather that each in its
6241 2005-08-28 David Madore <david.madore@ens.fr>
6243 * tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one
6244 of the FIPS test vectors).
6246 2005-10-23 Jim Meyering <jim@meyering.net>
6248 * configure.ac: Use 6.0-cvs as the version string.
6249 * NEWS: Adjust accordingly.
6254 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
6256 Copying and distribution of this file, with or without
6257 modification, are permitted provided the copyright notice
6258 and this notice are preserved.