Commit Graph

6755 Commits

Author SHA1 Message Date
Jim Meyering
25abb410d4 define/use AUTHORS 1999-04-04 14:44:45 +00:00
Jim Meyering
baa8cd4493 *** empty log message *** 1999-04-04 14:43:27 +00:00
Jim Meyering
d008b48e3b (print_long_format): Add a space between %s and %3u. This
assures that even when modebuf has the trailing `+' and there are more
than 99 hard links to a file, the permissions string and the link count
will be separated.
1999-04-04 14:41:43 +00:00
Jim Meyering
5b86bf7cde import latest 1999-04-04 14:33:18 +00:00
Jim Meyering
54ec5153c5 (S_IWUSR): Define if not already defined. 1999-04-04 14:32:58 +00:00
Jim Meyering
6369a887ba . 1999-04-04 14:30:44 +00:00
Jim Meyering
42edc330ed fix comments
add FIXME
1999-04-04 14:30:30 +00:00
Jim Meyering
e0e1dc0bf8 (dopass): add curly braces to avoid warning about ambiguous `else'.
(wipefd): Add parentheses suggested by gcc.
(do_wipefd): Remove declaration of unused local.
1999-04-04 04:54:34 +00:00
Jim Meyering
f381610dd5 [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
to allow standalone compilation.

(wipefile): Added support for emulating /dev/fd/# files even if
the OS doesn't support them.  From Paul Eggert.

(main, usage): Changed --device short option to -D.

(wipefd, do_wipefd): Renamed function to do_wipefd and added
separate wipefd that performs sanity checks on externally-opened file
descriptors, such as not append-only.  From Paul Eggert.

(do_wipefd, isaac_seedfd): Do not read file for any reason.
if the file is low-entropy, it's a security hole.
(wipefile) Changed to open O_WRONLY and chmod to write-only when
forcing.
(isaac_seedfd) Function deleted as unnecessary.
From Paul Eggert.

(dopass): Dynamically fall back to fsync() if fdatasync() fails,
since POSIX, in their infinitesimal wisdom, encourage implementations
that return constant -1, making compile-time testing useless.
From Paul Eggert.

(dopass): Changed to support a size of -1 to mean "unknown".
This entailed changing to a counting-up offset rather than couting-down
cursize for the central state variable.  Also changed size argument to
be call-by-reference so that it can be passed back once known.
(sizer) Function deleted as unnecessary.
(wipefd): Changed to match.  From Paul Eggert

(dopass): Try to skip over bad blocks in destination files.
Also added ftruncate() for more complete destruction of metadata.

(main, usage): Changed "-" to stand for standard output.
(wipefd): Added error message to detect conflict with -v.

(dopass): Added periodic fsync() calls to keep the pass progress
display in sync with reality.  Hopefully they're sufficiently far spaced
that throughput isn't affected.  It might be a good thing to do even in
non-verbose mode, to avoid filling up the kernel caches with dirty data.
Also added ftruncate() for more complete destruction of metadata.

(quotearg_colon): New function to print
pathological filenames properly.
[!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
that does most of the work.
(wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
(wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
Error messages are also in a more uniform format.
From Paul Eggert.

(struct Options, main, do_wipefd): Added -s/--size=N flag.
(xstrtoul): Added support for valid_suffixes to help this.
(usage) Documented it.

(error): Changed some arguments from N_() to _(), since error()
does not translate its argument.  I think this is a bug.

(struct Options do_wipefd, wipefd, wipefile, main): moved passes
argument into the Options structure as n_iterations, which is now a
size_t.  From Paul Eggert.

(isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
to manage seeding of RNG with arbitrary-sized data.
(isaac_init): commented out as dead code.
(isaac_seed): changed to use new functions to prevent any possibility of
a buffer overflow.

(isaac_seed): Added support for Solaris' gethrtime()
configure.in: Corresponding feature test.  From Paul Eggert.

(wipename): Change remove() to unlink() for speed & portability.
Use lstat() instead of access() to see if a filename is taken.  This
works even on dangling symlinks and avoids the suid problems of
access(2).  From Paul Eggert.

(isaac_seed_machdep): New function for reading cycle counters
1999-04-04 04:37:39 +00:00
Jim Meyering
034df8db20 *** empty log message *** 1999-04-04 04:34:16 +00:00
Jim Meyering
8fe009ed7c back out Paul's changes 1999-04-04 02:34:49 +00:00
Jim Meyering
c21cecaea8 Use AUTHORS in place of string in parse_long_options call. 1999-04-03 05:26:48 +00:00
Jim Meyering
1d47220ab2 Insert AUTHORS definition. 1999-04-03 05:22:05 +00:00
Jim Meyering
cf691ec714 Use PROGRAM_NAME in place of string in parse_long_options call. 1999-04-03 05:20:06 +00:00
Jim Meyering
7c2d5de6c7 define PROGRAM_NAME 1999-04-03 05:01:48 +00:00
Jim Meyering
db6ce0481b *** empty log message *** 1999-04-03 03:29:41 +00:00
Jim Meyering
98327bba60 (S_IWUSR): Define if not already defined. 1999-04-03 03:29:17 +00:00
Jim Meyering
a29afcb470 (isaac_seed): Don't overrun the s->mm buffer.
Use gethrtime if available.  Don't assume that clock_gettime succeeds.
Put most random sources first.
1999-04-03 03:27:57 +00:00
Jim Meyering
bf504d2a46 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.
1999-04-03 03:27:27 +00:00
Jim Meyering
ce9c687d5a [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.
1999-04-02 05:38:15 +00:00
Jim Meyering
eaaff3246a *** empty log message *** 1999-04-02 04:24:48 +00:00
Jim Meyering
7ba3c38741 *** empty log message *** 1999-04-02 04:20:17 +00:00
Jim Meyering
c69d22ae26 *** empty log message *** 1999-04-02 04:15:14 +00:00
Jim Meyering
35aee6bf13 (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.
1999-04-02 02:55:10 +00:00
Jim Meyering
ac03113efe *** empty log message *** 1999-04-02 02:47:58 +00:00
Jim Meyering
bbea0501a9 *** empty log message *** 1999-04-01 05:16:46 +00:00
Jim Meyering
a7b641acd5 (main): Qualify a char* with the `const' keyword. 1999-04-01 05:15:37 +00:00
Jim Meyering
c4cf0531ff (main): Qualify a char* with the `const' keyword. 1999-04-01 05:10:41 +00:00
Jim Meyering
a7d0351c20 (install_file_in_dir): Qualify a char* with the `const' keyword. 1999-04-01 05:09:59 +00:00
Jim Meyering
beb464c0ea (main): Qualify a char* with the `const' keyword. 1999-04-01 05:08:22 +00:00
Jim Meyering
d8a18c33e8 (main): Qualify a char* with the `const' keyword. 1999-04-01 05:07:51 +00:00
Jim Meyering
abdc079cd5 Remove prototypes and tsort function definitions. 1999-04-01 05:05:17 +00:00
Jim Meyering
d0b9ad729c (main): Qualify a char* with the `const' keyword. 1999-04-01 04:58:29 +00:00
Jim Meyering
24df6275fb (main): Move the declaration of `e' into the scope
where it's used and make it `const'.
1999-04-01 04:56:28 +00:00
Jim Meyering
2500fe4079 (main): Qualify a char* with the `const' keyword. 1999-04-01 04:53:13 +00:00
Jim Meyering
3a3189e6c3 (touch): Qualify a char* with the `const' keyword. 1999-04-01 04:47:55 +00:00
Jim Meyering
db3c0ffb44 . 1999-03-31 15:21:00 +00:00
Jim Meyering
8935f38d4e *** empty log message *** 1999-03-31 06:02:07 +00:00
Jim Meyering
667799f7e2 Don't include closeout.h or version-etc.h explicitly. Now, they're included via sys2.h. 1999-03-31 05:59:13 +00:00
Jim Meyering
d30f9691c1 *** empty log message *** 1999-03-31 05:54:11 +00:00
Jim Meyering
fdd07e3d2b 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.
1999-03-31 05:52:46 +00:00
Jim Meyering
419aa42181 Include "closeout.h" and "version-etc.h" 1999-03-31 05:52:46 +00:00
Jim Meyering
516b48e7a2 (AUTHORS): Actually define and use. 1999-03-31 05:06:42 +00:00
Jim Meyering
03c1b8518c (PROGRAM_NAME, AUTHORS): Define and use. 1999-03-31 04:16:08 +00:00
Jim Meyering
39090114f0 (PROGRAM_NAME, AUTHORS): Define and use. 1999-03-31 04:11:35 +00:00
Jim Meyering
b2513fc340 import latest 1999-03-30 15:11:20 +00:00
Jim Meyering
b989ccb248 . 1999-03-30 05:40:40 +00:00
Jim Meyering
2067a9fe97 . 1999-03-30 04:52:57 +00:00
Jim Meyering
a717cdf2d6 (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.
1999-03-30 04:51:08 +00:00
Jim Meyering
bb0631e825 *** empty log message *** 1999-03-30 04:48:57 +00:00