(show_dev): If the file system claims to have more available than total
[platform/upstream/coreutils.git] / ChangeLog
1 2006-01-24  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * Version 6.0-cvs.
4
5         * src/df.c (show_dev): If the file system claims to have
6         more available than total blocks, report the number of used
7         blocks as being total - available (a negative number) rather
8         than as garbage.  Problem reported by Toralf Foerster.
9
10 2006-01-24  Jim Meyering  <jim@meyering.net>
11
12         * src/tail.c (tail_forever): Don't exit-nonzero when an attempt
13         to put a regular file in O_NONBLOCK mode fails with EPERM.
14         That happens on Linux when using tail -f on a file with the
15         append-only attribute.  Reported by Dean Gaudet.  For details,
16         see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
17         * NEWS: Mention this fix.
18         * tests/tail-2/append-only: New file.  Test for the above.
19         * tests/tail-2/Makefile.am (TESTS): Add append-only.
20         * tests/Makefile.am (check-root): Add tail-2/append-only
21
22 2006-01-21  Jim Meyering  <jim@meyering.net>
23
24         * NEWS: Mention fts-related improvements and bug fixes.
25
26 2006-01-19  Jim Meyering  <jim@meyering.net>
27
28         * tests/fmt/basic (pfx-1, pfx-2): New tests, to demonstrate the bug
29         reported as http://bugs.debian.org/147577.  Forwarded by Thomas Hood.
30
31 2006-01-18  Jim Meyering  <jim@meyering.net>
32
33         * tests/du/Makefile.am (TESTS): Add long-from-unreadable.
34
35 2006-01-17  Jim Meyering  <jim@meyering.net>
36
37         Now that fts no longer changes the current working directory, adjust
38         its clients accordingly -- note that du.c uses fts but doesn't need
39         any adjustment, since it doesn't operate on the actual files,
40         but rather just uses the stat buffers provided by fts.
41
42         * src/chown-core.c: Include "openat.h".
43         Don't include "lchown.h".
44         (restricted_chown): Accept a new parameter, CWD_FD, and use it in
45         calling openat, lchownat, chownat, rather than open, lchown, chown.
46         Update caller.
47         * src/chmod.c: Include "openat.h".
48         (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
49
50         * tests/du/long-from-unreadable: New test, to exercise one small
51         corner of fts.c.
52
53 2006-01-13  Jim Meyering  <jim@meyering.net>
54
55         * tests/Makefile.am (SUBDIRS): Add comments discouraging the
56         addition of new directories under tests/.
57
58         * tests/acl: Redirect stdin to /dev/null.  Otherwise, FreeBSD 5.0's
59         getfacl would hang.
60
61 2006-01-12  Jim Meyering  <jim@meyering.net>
62
63         * tests/du/long-sloop: Adjust not to hard-code the expected
64         diagnostic corresponding to ELOOP.  Solaris' diagnostic differs
65         from that of GNU libc.  Reported by Paul Eggert.
66
67         * tests/du/long-sloop: Create file at end of symlink chain.
68
69         * tests/misc/test: New file, with a test for one of the
70         bugs fixed by yesterday's test.c changes.
71         * tests/misc/Makefile.am (TESTS): Add test.
72
73 2006-01-11  Jim Meyering  <jim@meyering.net>
74
75         * tests/du/long-sloop: New file.  Test for today's fts.c bug fix.
76         That bug could make du -L, chgrp -L, or chown -L fail to diagnose
77         a very long sequence of symbolic links (not necessarily a loop).
78         * tests/du/Makefile.am (TESTS): Add long-sloop.
79
80 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
81
82         * src/test.c (test_syntax_error): Append a newline.  All callers
83         changed, except for the ones that didn't already append a newline.
84         Bug reported by Eric Blake.
85
86 2006-01-11  Jim Meyering  <jim@meyering.net>
87
88         * src/system.h (X2NREALLOC): Now that verify_true is no longer
89         void, cast its result to void, to avoid gcc's warning that
90         ``left-hand operand of comma expression has no effect''.
91         (DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise.
92
93 2006-01-10  Jim Meyering  <jim@meyering.net>
94
95         * tests/chmod/no-x: Add a test for today's fts.c fix.
96
97 2006-01-10  Jim Meyering  <jim@meyering.net>  (tiny change)
98
99         * src/ls.c (gobble_file): Use DTTOIF only if it's defined.
100         This is necessary for Dragonfly.  Patch by Joerg Sonnenberger.
101
102 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
103
104         * src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE):
105         Use verify_true instead of verify_expr, to sync with gnulib.
106
107 2006-01-08  Jim Meyering  <jim@meyering.net>
108
109         * src/date.c (usage): Adjust the formatting of the entries for
110         %::z and %:::z (separate with two spaces, not one) so that help2man
111         formats them properly.  Reported by Philip Rowlands.
112
113 2006-01-06  Paul Eggert  <eggert@cs.ucla.edu>
114
115         * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add.
116
117 2006-01-06  Jim Meyering  <jim@meyering.net>
118
119         * Makefile.maint (copyright-check): Use date +%Y in place of
120         hard-coded 2005.
121
122         * src/remove.c (rm_1): Remove `static' attribute on local `status'.
123         First off, the attribute should have been `volatile' (not static)
124         to avoid longjmp-related risk of clobber.  Secondly, now there is
125         no longer any risk of a local variable being clobbered, so there's
126         no need for any attribute at all.
127
128 2006-01-05  Jim Meyering  <jim@meyering.net>
129
130         * src/remove.c: Give a few functions the inline attribute.
131         (AD_pop_and_chdir): Use gotos to avoid some duplication.
132         (AD_push): Rewrite an assertion so that the entire computation
133         goes away when assertions are turned off.
134
135         * src/tail.c (ENOSYS) [!defined ENOSYS]: Don't define here.
136         It's already defined in "system.h".
137         * Makefile.maint: Add a FIXME comment.
138
139 2006-01-04  Jim Meyering  <jim@meyering.net>
140
141         * ChangeLog: Remove entries from 2005-10-22 and earlier.
142         * ChangeLog-2005: New file, for entries up to version 5.92.
143
144 2006-01-03  Jim Meyering  <jim@meyering.net>
145
146         * tests/du/no-x: Also allow a slightly different diagnostic -- the
147         one you get when using openat-enabled fts.c and du (coming soon).
148         * tests/chmod/no-x: Likewise.
149         * tests/chgrp/no-x: Likewise.
150
151         * src/system.h (O_DIRECTORY) [!defined O_DIRECTORY]: Define.
152
153 2006-01-02  Paul Eggert  <eggert@cs.ucla.edu>
154
155         * src/chown-core.c (RC_do_ordinary_chown): New enum value.
156         (restricted_chown): Return it, if the file cannot be accessed due
157         to EPERM, or if no uid or gid are required, or if the file is
158         neither a directory nor a regular file.  Rewrite to avoid gotos.
159         (change_file_owner): Handle RC_do_ordinary_chown case.
160         Rewrite to avoid gotos.
161         * tests/chgrp/basic: Make sure we can change the group of
162         inaccessible files.
163
164         * src/date.c (usage): Explain %g, %G, and %V a bit better.
165
166 2006-01-02  Jim Meyering  <jim@meyering.net>
167
168         * src/copy.c (set_owner): Correct a comment.
169
170         * src/tail.c (parse_options): Change warning to say that --retry
171         is useful `mainly' (not `only') when following by name.
172         Reported here: http://bugs.debian.org/273781
173
174 2006-01-01  Paul Eggert  <eggert@cs.ucla.edu>
175
176         * NEWS: Document that mkfifo and mknod -m no longer set special bits.
177         * src/copy.c: Include lchmod.h.
178         (copy_internal): Use lchmod rather than chmod.
179         * src/cp.c: Include lchmod.h.
180         (re_protect, make_dir_parents_private): Use lchmod rather than chmod.
181         * src/mkdir.c: Include lchmod.h.
182         (usage): Clarify -m's operation.
183         (main): Use lchmod rather than chmod.  Don't use lchmod unless the
184         new mode contains bits outside the 777 range.
185         * src/mkfifo.c (usage): Clarify -m's operation.
186         (main): If -m is given, don't invoke chmod; use umask 0 instead.
187         Report an error if -m asks for bits outside the 777 range.
188         * src/mknod.c (usage, main): Likewise.
189
190         * src/mkdir.c, src/mkfifo.c, src/mknod.c: Undo 2005-12-19 changes.
191
192 2005-12-27  Jim Meyering  <jim@meyering.net>
193
194         * Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY.
195         (sc_prohibit_assert_without_use): New rule.
196         (syntax-check-rules): Add it to the list.
197         * .x-sc_prohibit_assert_without_use: New empty file.
198         * Makefile.am (EXTRA_DIST): Add it.
199
200         * Makefile.maint (CVS_LIST): Define in terms of $(srcdir).
201
202         * cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c:
203         Don't include <assert.h>; it wasn't used.
204
205 2005-12-26  Paul Eggert  <eggert@cs.ucla.edu>
206
207         * src/chown-core.c (restricted_chown):
208         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
209         * src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
210         | O_NOFOLLOW too, for consistency with other dir-openers.
211         Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
212         (is_empty_dir): Likewise.
213         * src/shred.c (wipename): Likewise.  Don't bother trying to open
214         dir for writing, since POSIX prohibits it.
215
216 2005-12-22  Jim Meyering  <jim@meyering.net>
217
218         * tests/help-version: Redirect stderr to /dev/full, to suppress
219         write error diagnostic.
220
221 2005-12-19  Jim Meyering  <jim@meyering.net>
222
223         * src/mkdir.c, src/mknod.c, src/mkfifo.c (main)
224         Avoid a minor race condition when `-m MODE' is specified, by using
225         open, fchown, and close rather than just chown.  To do that reliably --
226         even with an overly restrictive umask -- ensure that each mkdir,
227         mknod and mkfifo call uses a mode including at least owner-read access.
228         * src/mknod.c (main): When `-m MODE' is specified, exit nonzero if
229         the subsequent chown (or equivalent open,fchown,close) fails.
230         * tests/misc/mknod: New tests.
231         * tests/misc/Makefile.am (TESTS): Add mknod.
232
233 2005-12-17  Jim Meyering  <jim@meyering.net>
234
235         * src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang,
236         e.g., on a named pipe.
237         (OPEN_NO_FOLLOW_SYMLINK): Remove definition.  Use O_NOFOLLOW in
238         place of all uses, since it is guaranteed (system.h) to be defined.
239
240 2005-12-05  Andreas Gruenbacher  <agruen@suse.de>
241
242         Add POSIX ACL support
243         * src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall
244         is no requirement for ACL support; particularly, it does not exist
245         on systems that have POSIX ACLs.
246         * src/copy.h (cp_option_init) [umask_kill]: Remove member.
247         * src/cp.c (umask_kill): With default acls, the umask is not to be
248         applied.  Remove umask_kill, don't change the process umask, and let
249         the kernel apply the umask where appropriate.
250         * src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs.
251         * src/copy.c (get_dest_mode): Remove; it is obsolete after removing
252         umask_kill.
253         (copy_reg, copy_internal): Use copy_acl and set_acl
254         instead of fchown/chown. Fix the logic for POSIX ACLs.
255         (chown_succeded): Remove; we now always copy acls and
256         preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
257         did a chown before or not.
258         * src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member.
259         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD,
260         mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange
261         to link with it via $(LIB_ACL), for the utilities that need it.
262
263 2005-12-16  Paul Eggert  <eggert@cs.ucla.edu>
264
265         * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
266         (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
267         (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
268         value is now signified by whether cwd_errno is null.
269         (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
270         pointer-to-bool to pointer-to-errno-value.  All callers changed.
271         (rm_1): Don't bother setting a local cwd failure flag and then
272         ORing it into the caller's.  Just set the caller's.
273         (rm): Use cwd failure errno value to print a slightly-better
274         diagnostic.
275
276 2005-12-15  Jim Meyering  <jim@meyering.net>
277
278         * src/stat.c (print_it): Properly handle a backslash at the
279         end of a --printf format string.  Reported by Paul Eggert.
280         * tests/misc/stat-printf (end-bs): Add a test for the above.
281
282 2005-12-15  Paul Eggert  <eggert@cs.ucla.edu>
283
284         * tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh.
285         Don't assume /etc/passwd contains user names; use 'id' instead.
286
287 2005-12-15  Jim Meyering  <jim@meyering.net>
288
289         stat: revert behavior of --format=FMT (-c)
290         stat: add new option: --printf=FMT
291         * NEWS: Mention this.
292         * src/stat.c (isodigit, octtobin, hextobin): Define.
293         (PRINTF_OPTION): Define.
294         (interpret_backslash_escapes, trailing_delim): New globals.
295         (usage): Document them.  Alphabetize on long option names.
296         (print_esc_char): New function.
297         (print_it): Rewrite, in order to handle backslash escapes.
298         (main): Handle new option.  Set globals for --format, too.
299
300         * tests/misc/stat-printf: Test --printf and --format.
301         * tests/misc/Makefile.am (TESTS): Add stat-printf.
302
303 2005-12-14  Paul Eggert  <eggert@cs.ucla.edu>
304
305         * NEWS: sort now reports incompatible options.
306         * src/sort.c (incompatible_options, check_ordering_compatibility):
307         New functions.
308         (main): Use them.  Don't bother with a usage message for
309         "sort -c a b", for consistency with other error diagnostics.
310         * tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4):
311         New tests.
312
313         * src/cat.c (main): Undo previous change.  close_stdout already
314         does the check, so the previous change wasn't necessary.
315
316 2005-12-13  Paul Eggert  <eggert@cs.ucla.edu>
317
318         * src/cat.c (main): Check for close (STDOUT_FILENO) failure.
319
320 2005-12-12  Paul Eggert  <eggert@cs.ucla.edu>
321
322         Install a more-conservative approach for sort -R.  It's the
323         same basic idea as the existing code, except it uses the full ISAAC
324         approach (called the "more kosher" approach in the existing comments).
325         This makes "sort -R" quite a bit slower (about a factor of 2 on my
326         little tests involving 10000 lines on a 2.4 GHz P4), but I think it's
327         better to be conservative here at first, and review any performance
328         improvements carefully.
329         * .x-sc_require_config_h: Add src/rand-isaac.c.
330         * src/rand-isaac.h: Remove.  All uses now simply include rand-isaac.c.
331         * src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h.
332         (shred_SOURCES, sort_SOURCES): Remove.
333         (EXTRA_DIST): Add rand-isaac.c.
334         * src/rand-isaac.c: Revert to what used to be in shred.c, without
335         changing it to allow for varying numbers of words in the state.
336         Alter so that we include rand-isaac.c directly rather than
337         compiling it and linking to it.  Don't include config.h or
338         system.h; that's the includer's responsibility.
339         Omit functions that are specific to shred.
340         (ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
341         (isaac_step, struct irand_state):
342         Resurrect these, with the same defns that used to be in shred.c.
343         (ISAAC_SIZE, isaac_new, isaac_copy): Remove.
344         (isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
345         static again.
346         (struct isaac_state, isaac_refill, isaac_mix, isaac_init):
347         (isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
348         (irand_init, irand32, irand_mod):
349         Number of words is constant again.
350         (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c.
351         * src/shred.c: Include rand-isaac.c rather than rand-isaac.h.
352         * src/sort.c: Likewise.
353         * src/shred.c (fillrand, dopass, main): Undo previous change.
354         (struct irand_state, irand_init, irand32, irand_mod): Moved back here,
355         from rand-isaac.c.
356         * src/sort.c: Don't include md5.h; it wasn't needed.
357         (struct keyfield): Rename random_hash to random, for consistency
358         with the other member names.  All uses changed.
359         (usage): Tweak wording to mention STRING for --seed option.
360         (short_options): Rorder for consistency with other programs.
361         (rand_state): Now a struct, not a pointer to one.  All uses changed.
362         (HASH_WORDS, HASH_SIZE): Remove.
363         (get_hash): Remove comments around resbuf size, since we can assume C89.
364         Use a "more-kosher" (but slower) approach of invoking isaac_refill.
365         (keycompare): Adjust to the new get_hash.
366         Add a FIXME.
367         (badfieldspec): Omit recently-introduced comment; it isn't needed.
368         (main): Don't set need_random simply because gkey has it set; that
369         doesn't necessarily mean we'll need random numbers.
370         Redo seeding to match new get_hash approach.
371
372 2005-12-10  Jim Meyering  <jim@meyering.net>
373
374         * src/Makefile.am (noinst_HEADERS): Add rand-isaac.h.
375
376         Avoid shred segfault on 64-bit systems.
377         * src/rand-isaac.c (isaac_refill): Don't try to negate a
378         local of type uint32_t.  Make the local an `int' instead.
379
380         * NEWS: Mention sort's new options.
381
382         * src/rand-isaac.c (isaac_mix): Declare to be static.
383         Mark all other functions as `extern' so the tight-scope
384         part of `make distcheck' passes once again.
385         * src/rand-isaac.h (isaac_mix): Remove declaration.
386
387         * src/sort.c (get_hash): Change position of `*' in parameter
388         type to conform with convention.
389         (main): Split a long line so it fits in 80 columns.
390         (keycompare): Remove stray SPACE before TAB that was
391         causing `make distcheck' to fail.
392
393         * src/shred.c: Don't include gethrxtime.h.  No longer needed.
394
395         * tests/misc/sort-rand: New file: basic tests for the new options.
396         * tests/misc/Makefile.am (TESTS): Add sort-rand.
397
398 2005-12-10  Frederik Eaton  <frederik@ofb.net>
399
400         * src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME).
401         (shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
402         * src/rand-isaac.c: New file, containing ISAAC code that was in shred.c.
403         Make state size runtime-configurable.
404         (isaac_new, isaac_copy): New functions.
405         * src/rand-isaac.h: New file.
406         * src/shred.c: Include rand-isaac.h.  Move ISAAC code to rand-isaac.c.
407         (fillrand, main): Adjust to the fact that the state size is now
408         runtime-configurable.
409         * src/sort.c (short_options, long_options, WORDS, keycompare, main):
410         (usage): Add options --random-sort and --seed to implement a random
411         shuffle.
412         Include md5.h and rand-isaac.h.
413         (get_hash): New function.
414         (rand_state): New var.
415         (HASH_WORDS, HASH_SIZE): New macros.
416
417 2005-12-09  Paul Eggert  <eggert@cs.ucla.edu>
418
419         * tests/dd/misc: Add test for dd iflags=noatime.
420
421 2005-12-09  Jim Meyering  <jim@meyering.net>
422
423         * src/sort.c (usage): Mention white space vs -b and -t options.
424         From The Wanderer.
425
426 2005-12-09  Eric Blake  <ebb9@byu.net>
427
428         * src/test.c (main): Fix misleading comment.
429
430 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
431
432         * NEWS: Mention dd's new noatime flag.
433         * src/system.h (O_NOATIME): Define to 0 if not already defined.
434         * src/dd.c (flags, usage): Add support for noatime flag.
435
436 2005-12-07  Jim Meyering  <jim@meyering.net>
437
438         Distribute the cvsu script, used only by `make syntax-check'.
439         * Makefile.am (EXTRA_DIST): Add build-aux/cvsu.
440         * Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we
441         distribute a copy of this script.
442         * .x-sc_unmarked_diagnostics: Add build-aux/cvsu.
443
444         * tests/mv/acl: exit-77 before the trap, not after, if we fail
445         to create a temporary directory on another partition.
446         From Andreas Gruenbacher.
447
448 2005-12-06  Tomas Pospisek  <tpo@sourcepole.ch>  (tiny change)
449
450         * man/basename.x: Cross-reference to dirname and readlink.
451         * man/dirname.x: Cross-reference to basename and readlink.
452
453 2005-12-05  Andreas Gruenbacher
454
455         * src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1.
456         (set_owner, preserve_author): New functions, factored out of copy_reg.
457         (copy_reg): Use them.
458         (copy_internal): Use them here, too.
459
460 2005-12-04  Jim Meyering  <jim@meyering.net>
461
462         * src/sleep.c (usage): Say what happens with two or more arguments.
463         Suggested by Justin Pryzby.
464
465         * src/uptime.c (print_uptime): Move decl of `upsecs' into scope
466         where it's used.
467
468 2005-12-03  Jim Meyering  <jim@meyering.net>
469
470         * src/rm.c (long_opts): Change the name of each undocumented, for-
471         testing-only option to start with `-', so that it cannot render
472         ambiguous any prefix it happens to share with some other option name.
473         Problem reported by Eric Blake.
474         * src/head.c (long_options): Likewise.
475         * src/tail.c (long_options): Likewise.
476
477         * tests/misc/head-elide-tail: Update uses of undocumented, for-
478         testing-only --presume* options to start with `---'.
479         * tests/rm/dangling-symlink: Likewise.
480         * tests/rm/dir-no-w: Likewise.
481         * tests/rm/isatty: Likewise.
482
483 2005-11-30  Jim Meyering  <jim@meyering.net>
484
485         * Makefile.maint: Add a comment about cvsu.
486
487 2005-11-25  Paul Eggert  <eggert@cs.ucla.edu>
488
489         * NEWS: df updates for "none", "proc", inaccessible file systems.
490         * src/df.c (show_point): Ignore inaccessible file systems.
491         (usage): -a includes dummy file systems, not size-0 file systems.
492
493         * src/od.c (unsigned_long_long_int): Renamed from ulonglong_t,
494         to avoid collision with POSIX name space.  All uses changed.
495
496 2005-11-24  Jim Meyering  <jim@meyering.net>
497
498         * tests/Makefile.am (EXTRA_DIST): Add acl to the list.
499         * tests/acl: Add `$0: ' prefix to diagnostics.
500
501         * .x-sc_require_config_h: Add lib/buffer-lcm.c to the list.
502
503 2005-11-23  Paul Eggert  <eggert@cs.ucla.edu>
504
505         * src/copy.c: Improve performance a bit by optimizing away
506         unnecessary system calls and going to a block size of at least
507         8192 (on normal hosts, anyway).  This improved performance 5% on my
508         Debian stable host (2.4.27 kernel, x86, copying from root
509         ext3 file system to itself).
510         Include "buffer-lcm.h".
511         (copy_reg): Omit last argument.  All callers changed.
512         Use xmalloc to allocate rather than trusting alloca
513         (which is unwise with large block sizes).
514         Declare locals more locally, if possible.
515         Use uintptr_t words instead of int words, for a bit more speed
516         when looking for null blocks on 64-bit hosts.
517         Optimize away reads of zero bytes on regular files.
518         In the typical case, insist on 8 KiB buffers, at least.
519         Avoid unnecessary extra call to fstat when checking for sparse files.
520         Avoid now-unnecessary cast to off_t, and "0L".
521         Avoid unnecessary test of *new_dst when checking for same owner
522         and group.
523
524 2005-11-22  Paul Eggert  <eggert@cs.ucla.edu>
525
526         * src/remove.c (rm): Don't assume C99 for-loop syntax.
527
528 2005-11-22  Jim Meyering  <jim@meyering.net>
529
530         * src/remove.c (AD_push): Remove debugging cruft.
531
532         * tests/rm/unread2 (rm): Change expected diagnostic,
533         `cannot open directory' to `cannot remove', to align with
534         new version of rm.
535         * tests/rm/rm2: Ensure that rm now continues removing entries
536         even after certain types of failure.
537
538         * src/remove.c: Rewrite.  Now, this module is reentrant on systems
539         that provide openat (Solaris), and on systems like Linux+procfs
540         where our openat emulation code is reentrant.  This also fixes a
541         few low-probability leaks and eliminates some code that could,
542         in very unusual circumstances, cause rm() (via a callee) to exit.
543         * NEWS: Mention this.
544
545         * configure.ac: Put copyright dates all on one line so the
546         emacs function that updates them works properly.
547
548 2005-11-18  Paul Eggert  <eggert@cs.ucla.edu>
549
550         * configure.ac (AM_PROG_CC_C_O): Add.  Needed for CVS Automake.
551         Problem reported by Eric Blake.
552         (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
553         we get a standard-conforming compiler.  This relies on the new
554         m4/c.m4 file.  Note that it's a bit tricky, since c.m4 doesn't
555         define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
556         m4/c.m4 can go away with Autoconf 2.60 comes out.
557
558 2005-11-17  Jim Meyering  <jim@meyering.net>
559
560         * src/remove.c (AD_mark_helper): Make a `char *' parameter `const'.
561         (AD_mark_current_as_unremovable): Likewise, but for a local.
562         (rm_1): Likewise.
563
564         * tests/mv/acl: Let traps handle removing temporary directories.
565
566         Expect acl-related tests to fail, until the corresponding
567         patches are committed.
568         * tests/mv/Makefile.am (XFAIL_TESTS): Add acl.
569         * tests/cp/Makefile.am (XFAIL_TESTS): Likewise.
570
571         ACL tests, from Andreas Gruenbacher.
572         * tests/acl, tests/mv/acl, tests/cp/acl: New files.
573         * tests/mv/Makefile.am (TESTS): Add acl.
574         * tests/cp/Makefile.am (TESTS): Add acl.
575
576         * src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment.
577
578 2005-11-16  Paul Eggert  <eggert@cs.ucla.edu>
579
580         * NEWS: Improve quality of ln's diagnostics.
581         * src/ln.c (do_link, usage): Likewise.
582         (do_link): Don't use alloca on a buffer of unbounded size.
583
584 2005-11-16  Jim Meyering  <jim@meyering.net>
585
586         * tests/cp/fail-perm: Accommodate HPUX.  It appears to fail
587         with EACCES rather than EPERM.  Reported by Peter O'Gorman here:
588         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
589
590 2005-11-14  Jim Meyering  <jim@meyering.net>
591
592         * NEWS (sort): Mention consequences of today's mkstemp-safer.c fix.
593
594 2005-11-13  Jim Meyering  <jim@meyering.net>
595
596         * announce-gen: Accept new option, --gpg-key-id=ID and
597         emit a blurb telling how to use the .sig files.
598         * Makefile.cfg (gpg_key_ID): Define.
599         * Makefile.maint (announcement): Use new option and key.
600
601         Require that most .c files include <config.h>.
602         * Makefile.maint (sc_require_config_h): New rule.
603         (syntax-check-rules): Add it.
604         * .x-sc_require_config_h: New file listing exceptions to the
605         above rule.  Some are legit, others are simply grandfathered in.
606         * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too.
607
608 2005-11-12  Jim Meyering  <jim@meyering.net>
609
610         * src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files.
611
612 2005-11-11  Jim Meyering  <jim@meyering.net>
613
614         * NEWS: Mention `readlink -f' bug fix in 5.3.0 news.
615         Mention new readlink options in 5.3.0's `New features' section.
616         Spotted by Thomas Hood.
617
618 2005-11-08  Jim Meyering  <jim@meyering.net>
619
620         * NEWS: Merge in changes from b5_9x branch.
621
622 2005-11-08  Paul Eggert  <eggert@cs.ucla.edu>
623
624         * NEWS: ls now defaults to --time-style='locale', which in turn acts
625         like --time-style='posix-long-iso' if the locale settings are messed up.
626         * src/ls.c (decode_switches): Implement this.
627
628 2005-11-08  Jim Meyering  <jim@meyering.net>
629
630         * tests/du/2g: s/expensive/very expensive/ in a comment.
631         From Paul Townsend.
632
633 2005-10-17  Eric Blake  <ebb9@byu.net>
634
635         * src/ls.c (usage): Fix descriptions of --sort, --time.
636         Reported by Vitaly A. Ostanin.
637
638 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
639
640         * src/ln.c: Include filenamecat.c.
641         (FILE_BASENAME_CONCAT): Remove.
642         (do_link): Remove last arg DEST_IS_DIR.  All callers changed.
643         (main): Use file_name_concat, base_name, and strip_trailing_slashes
644         instead of FILE_BASENAME_CONCAT.  This simplifies the code, and avoids
645         the use of alloca.
646
647 2005-11-04  Jim Meyering  <jim@meyering.net>
648
649         * src/du.c (process_file): Don't overflow for files of size >= 2^31
650         on systems with stat.st_blocks of a signed 32-bit type.
651         This bug causes trouble on some AIX 5.1 systems.
652         Report and trivial patch from Paul Townsend:
653         <http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
654         * NEWS: Mention this.
655
656         * tests/du/2g: New (very-expensive) test for the above-fixed bug.
657         * tests/du/Makefile.am (TESTS): Add it here.
658         * tests/very-expensive: New file.
659         * tests/Makefile.am (EXTRA_DIST): Add it here.
660         * tests/cp/perm: Mark this test as `very-expensive', too.
661
662 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
663
664         * NEWS: Mention that rm -d and maybe ln -d are scheduled for
665         removal in 2006.
666         * src/remove.h (struct rm_options): Remove unlink_dirs.  All uses
667         removed.
668         * src/rm.c (usage): Don't mention rm -d.
669
670 2005-11-02  Jim Meyering  <jim@meyering.net>
671
672         * tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils.
673         From Andreas Schwab.
674
675         * tests/dd/unblock-sync: Redirect stderr to /dev/null so the
676         `M+N records in/out' lines don't pollute `make check' output.
677
678         * tests/dd/skip-seek (sk-seek4): New test, to exercise the bug
679         fixed on 2005-10-31.  This test uses the new, IN_PIPE specifier.
680         * tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE,
681         to indicate that the input file should be piped into the command
682         under test (via `cat FILE | $prog ...').
683
684         * src/remove.c (remove_entry): Emit a better diagnostic when rm
685         (without -r) fails to remove a directory on a non-Linux system.
686         This change affects only newer Solaris systems (with priv_*
687         functions like priv_allocset).  Reported by Keith Thompson.
688
689         * tests/rm/dir-nonrecur: New file/test for the above fix.
690         * tests/rm/Makefile.am (TESTS): Add dir-nonrecur.
691
692 2005-11-01  Paul Eggert  <eggert@cs.ucla.edu>
693
694         * NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as
695         POSIX 1002.1-2001 requires.
696         * src/tail.c (parse_obsolete_option): Implement this.
697         Problem reported by Vincent Lefevre.
698         * src/touch.c (main): Pass PDS_PRE_2000 to posixtime.
699         * tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests.
700         (test_vector): Add special cases for _POSIX2_VERSION, and
701         regularize the old ones a bit.
702         * tests/touch/obsolescent: Add y2000 test.
703
704 2005-10-31  Paul Eggert  <eggert@cs.ucla.edu>
705
706         * src/dd.c (skip): Fix off-by-one error reported by
707         Theodoros V. Kalamatianos.
708
709 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
710
711         * tests/mkdir/p-3: Require that the test be run as non-root.
712         Problem and trivial fix reported by Theodoros V. Kalamatianos.
713
714 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
715
716         * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
717         boundary between DEST and SOURCE in the result.
718
719 2005-10-26  Dmitry V. Levin  <ldv@altlinux.org>
720
721         * src/md5sum.c (main) [!O_BINARY]: Changed default read mode
722         back to text, to sync with documentation and for backwards
723         compatibility.
724
725 2005-10-25  Jim Meyering  <jim@meyering.net>
726
727         * tests/dircolors/simple (other-wr): Add an explicit test for
728         the dircolors bug (NULL-dereference) fixed yesterday.
729
730 2005-10-24  Jim Meyering  <jim@meyering.net>
731
732         * src/tac.c (tac_file): When determining whether a file is seekable,
733         also test whether it is a tty.  Using only the lseek-based test would
734         give a false positive on Solaris.  Reported by Peter Fales.
735
736 2005-10-24  Dmitry V. Levin  <ldv@altlinux.org>
737
738         * tests/install/d-slashdot: New test, for "install -d" failure.
739         * tests/install/Makefile.am (TESTS): Add d-slashdot.
740         * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
741         * tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
742
743 2005-10-24  Jim Meyering  <jim@meyering.net>
744
745         * src/dircolors.c (ls_codes): Add missing comma.
746         Anonymous report and patch from
747         http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
748
749         * src/dircolors.c: Add compile-time assertion that the slack_codes
750         and ls_codes arrays have the same number of elements.  This would
751         have prevented the above-fixed bug.
752
753         * src/expand.c (parse_tab_stops): Add a comment to make this function
754         identical to the one in unexpand.c.
755         * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
756         identical to the one in expand.c.
757
758         * src/expand.c (next_file): Don't assume fopen cannot return stdin.
759
760 2005-10-23  Jim Meyering  <jim@meyering.net>
761
762         * src/md5sum.c (digest_check, main): Use ptr_align rather than
763         a dangerous pointer-value-to-`unsigned' cast.
764         * NEWS: mention the new sha* programs.
765         * AUTHORS: Add new sha* programs.
766
767 2005-08-28  David Madore  <david.madore@ens.fr>
768
769         Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
770         * README: Add their names to the list.
771         * src/md5sum.c: Provide framework for computing sha-2 hashes.
772         * src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum):
773         Rules for compiling sha-2 utilities
774         (noinst_HEADERS): Remove checksum.h.
775         * man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x:
776         New files.
777         * man/Makefile.am (dist_man_MANS): Add the corresponding .1 names.
778         (sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
779         * tests/misc/sha224sum, tests/misc/sha256sum: New files.
780         * tests/misc/sha384sum, tests/misc/sha512sum: New files.
781         * tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum,
782         sha384sum, sha512sum test scripts here rather that each in its
783         own directory.
784
785 2005-08-28  David Madore  <david.madore@ens.fr>
786
787         * tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one
788         of the FIPS test vectors).
789
790 2005-10-23  Jim Meyering  <jim@meyering.net>
791
792         * configure.ac: Use 6.0-cvs as the version string.
793         * NEWS: Adjust accordingly.