diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2012-09-05 19:49:09 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2012-09-05 19:49:09 +0000 |
commit | 1e6d2a26b0a1c3e8d1ce5d6923e471cc14f5f487 (patch) | |
tree | c182370e6b5739368d5c0f8f665ceec6d6e596d7 /bin/rm | |
parent | a3edc83d75d84d7da7bee354bd2de161597c9389 (diff) |
overwrite with random stream; a repeating chunk of random data isn't
random at all
ok tedu@
Diffstat (limited to 'bin/rm')
-rw-r--r-- | bin/rm/rm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c index 41b574edca1..a653bb54f17 100644 --- a/bin/rm/rm.c +++ b/bin/rm/rm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rm.c,v 1.26 2012/09/04 22:22:50 tedu Exp $ */ +/* $OpenBSD: rm.c,v 1.27 2012/09/05 19:49:08 naddy Exp $ */ /* $NetBSD: rm.c,v 1.19 1995/09/07 06:48:50 jtc Exp $ */ /*- @@ -329,9 +329,9 @@ pass(int fd, off_t len, char *buf, size_t bsize) { size_t wlen; - arc4random_buf(buf, bsize); for (; len > 0; len -= wlen) { wlen = len < bsize ? len : bsize; + arc4random_buf(buf, wlen); if (write(fd, buf, wlen) != wlen) return (0); } |