Jim Meyering [Sat, 3 Apr 1999 03:27:27 +0000 (03:27 +0000)]
Add new options -bcCklL and fix some porting problems.
Remove options -dp. Do not read output files.
(long_opts, usage, main, wipefile): Adjust to new options.
("human.h", "quotearg.h"): New includes.
(struct Options): New members contents, links, n_iterations.
Remove allow_devices, remove_file. Change n_iterations to size_t.
All uses changed.
(output_block_size): New var.
(usage): Declare __noreturn__ attribute.
(fdatasync): Define to -1 if not present, since we need to invoke both
fdatasync and fsync if both are present. All invokers of fdatasync
now try fdatasync, then fsync.
(MIXIN): New macro.
(isaac_seed): Use it to mix in values. Add uid, gid to mix.
Don't use gettimeofday, as it has too many porting problems.
(isaac_seedfd): Remove, since we no longer read the output files.
(sizefd): Remove; we now determine size by writing sequentially.
(dopass, wipename, wipefile, main): Clean up error messages.
(dopass): Keep track of offset relative to start of file, not
end, since we may not know how large the file is. If size is
negative, write until we fall off the end of the file.
(wipefd): Do not read output file.
Return 0 if successful, -1 if not; do not make a special case for
non-regular files, since our callers have that info now.
(wipename): Now static. Return errno if error.
(main): "-" now stands for standard output.
Do not shred append-only standard output.
(wipefile): Do not grant read permission to file when wiping it.
Use symbolic permission (S_IWUSR), not octal.
From Paul Eggert.
Jim Meyering [Fri, 2 Apr 1999 05:38:15 +0000 (05:38 +0000)]
[HAVE_SYS_ACL_H]: Include sys/acl.h.
(struct fileinfo): New member `have_acl'.
(gobble_file): Initialize it.
(print_long_format): Use it.
Mostly from Alen Muzinic.
Jim Meyering [Fri, 2 Apr 1999 02:55:10 +0000 (02:55 +0000)]
(open_maybe_create): New function.
(touch): Rewrite not to use `creat' and to eliminate a race
condition that could make touch truncate a nonempty file.
Report and suggestions from Andrew Tridgell.
Jim Meyering [Wed, 31 Mar 1999 05:52:46 +0000 (05:52 +0000)]
No longer include long-options.h.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Tue, 30 Mar 1999 04:51:08 +0000 (04:51 +0000)]
(make_node_op_equals): New function.
(mode_append_entry): Likewise.
(mode_compile): When none of [ugoa] is specified in an `=OP' change
mode request, insert a `=0' entry into the linked list so that all
bits are cleared first. Use the new functions.
Jim Meyering [Sun, 28 Mar 1999 20:58:51 +0000 (20:58 +0000)]
(get_date): Reuse tm_isdst of first localtime
call; this is an improvement on a bug fix suggested by
martin@dresden.nacamar.de. Do not assume that localtime and
gmtime return non-null.
From Paul Eggert.
Jim Meyering [Fri, 26 Mar 1999 14:26:18 +0000 (14:26 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Fri, 26 Mar 1999 14:25:30 +0000 (14:25 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Fri, 26 Mar 1999 14:23:59 +0000 (14:23 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Fri, 26 Mar 1999 14:22:51 +0000 (14:22 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Fri, 26 Mar 1999 14:19:02 +0000 (14:19 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Fri, 26 Mar 1999 14:18:29 +0000 (14:18 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Fri, 26 Mar 1999 14:05:40 +0000 (14:05 +0000)]
(PROGRAM_NAME, AUTHORS): Define
(long_options): Remove unused struct.
(scanargs): Remove useless loop.
(main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
Jim Meyering [Fri, 26 Mar 1999 04:23:55 +0000 (04:23 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Fri, 26 Mar 1999 04:11:15 +0000 (04:11 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Fri, 26 Mar 1999 04:10:55 +0000 (04:10 +0000)]
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Jim Meyering [Thu, 25 Mar 1999 14:29:13 +0000 (14:29 +0000)]
(recheck): Factor out a block of duplicated code.
Set f->size to 0 upon encountering a new file so we read it from
the beginning rather than from then end of the first line or
block. Otherwise, after a log rotation, tail would omit the first
line or block of the new file. Reported by Ed Avis.