Age | Commit message (Collapse) | Author |
|
Don't include rand-isaac.c; include randint.h and randread.h instead.
(RANDOM_SOURCE_OPTION): New enum.
(long_opts, usage, main): New option --random-source.
(struct irand_state, irand_init, irand32, irand_mod): Remove.
All callers changed to use randint interface.
(fillrand): Remove. All callers changed to use randread interface.
(dopass): Remove dependency on ISAAC buffer size.
(genpattern): Don't wipe the random state here.
(randint_source): New static var.
(clear_random_data): New function.
(main): Allocate random source, and arrange to wipe it on exit.
|
|
what must be a typo. Strengthen it to its intended value.
(dopass): Don't use alloca; it's not worth the aggravation here,
since it's used only to get a page-aligned buffer, and page
alignment doesn't buy us much here. I'm suspicious that alloca
causes problems on some hosts, due to a recent bug report by Adam
Waltman.
|
|
|
|
Don't bother trying to open dir for writing, since POSIX prohibits it.
|
|
from rand-isaac.c.
|
|
(fillrand, dopass, main): Undo previous change.
|
|
|
|
(fillrand, main): Adjust to the fact that the state size is now
runtime-configurable.
|
|
gnulib.
|
|
never worked right on DOS!
|
|
(wipename, wipe_file): Don't use fd_safer; no longer needed
now that we include fcntl--.h.
|
|
|
|
system as long as it's not in data=journal mode.
Tiny change by Mark Melahn.
|
|
|
|
|
|
(wipename): Use fd_safer on directory file descriptor.
(wipefile): Remove special case for /dev/fd/* on older hosts.
It didn't work in general, and wasn't documented.
Use fd_safer.
|
|
/dev/random and don't need this gorp.
Do not include signal.h.
(env, sigill_handler, isaac_seed_machdep): Remove. All uses removed.
|
|
|
|
(isaac_seed): Use gethrxtime rather than a mishmash.
|
|
because just calling gethrtime evokes an `illegal instruction'
failure when compiled with Sun's c89 on Solaris 8 and 9.
|
|
twice with the same value of `t'.
Replace nested #if-#else blocks with #if-#elif-#elif chain.
|
|
|
|
|
|
and not readable. Prefer write access, since this should work
better with fdatasync.
|
|
(isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts.
|
|
(word32): Remove. All uses changed to uint32_t.
(isaac_seed_data): Remove unnecessary cast.
|
|
|
|
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
|
|
|
|
Prompted by a suggestion from Kalle Olavi Niemitalo
in http://bugs.debian.org/207035.
(direct_mode): New function.
(do_wipefd): Turn on direct-mode I/O.
(dopass): If a file's first write fails with EINVAL,
turn off direct-mode I/O and retry the write.
|
|
a write error. Problem reported by Jon Peatfield in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html
|
|
fdatasync reports EBADF when syncing (unwritable) directories.
Problem reported by Albert Chin-A-Young in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00165.html
|
|
change "%s: remove" to _("%s: failed to remove") and
change "%s: close" to _("%s: failed to close").
|
|
".". But continue to omit +, =, %, @, #, as they're either
shell metacharacters (for some shells) or are not in some
character sets, or (in the case of '%') must be a
metacharacter somewhere.
|
|
|
|
fdatasync fails with errno==EINVAL, it means this implementation
does not support synchronized I/O for this file. Do not report
this as an error, as (for example) AIX 5.2 fdatasync reports it
for raw disk devices. Problem reported by Albert Chin in
<http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00028.html>.
Check for write errors, though: the old code ignored them.
Improve error checking in a few other cases, too (e.g., close of a
directory).
Also, change several 'int' values to 'bool', so that the error
checking is a bit clearer. Similarly, change unsigned values
to size_t where appropriate.
* src/shred.c: Include "dirname.h".
(datasync) [!HAVE_FDATASYNC]: Remove.
(dosync): New function.
(dopass): Use it. Return 1 on write error, -1 on other error.
All callers changed. Report write error if dosync does.
(do_wipefd, wipefd, wipename, wipefile): Return bool (true/false),
not int (0/-1). All callers changed. Return false if there's a
write error.
(incname): Return bool (true/false), not int (0/1). Accept
size_t length, not unsigned. All callers changed. Do not
bother checking for non-digits; it can't happen. Replace
recursion with iteration.
(wipename): Use dir_name, base_name, etc. instead of assuming
Unix file names. Use size_t for length, not unsigned.
Report error if unlink or close fails.
(wipename, main): Use bool for booleans.
(names): Use only digits and uppercase letters, for greater
portability.
|
|
|
|
|
|
Initialize a buffer to avoid warnings from tools like valgrind.
|
|
(dopass): Align I/O buffers to page boundaries.
|
|
|
|
(main): Don't assume EXIT_FAILURE == 1, as POSIX doesn't require it.
|
|
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
Don't include closeout.h.
|
|
|
|
or be careful to choose a size that would not be rounded up and
exceed the maximum value; that could result in a failure of
the final write.
(do_wipefd): --exact is now the default for non-regular
files. Suggestion from Ben Elliston.
(usage): Say it.
|
|
Patch by Michael Stone.
|
|
It's already included via system.h.
|
|
Instead, include "xalloc.h".
|