From 79c33d4ddc2cc1cf5bc5ebab066c5e345778769c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 3 Aug 2016 18:17:57 +1200 Subject: Correct order of random search devices --- bin/rnds | 2 +- man/man1/rnds.1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/rnds b/bin/rnds index 650f15bf..98851208 100755 --- a/bin/rnds +++ b/bin/rnds @@ -1,7 +1,7 @@ #!/bin/sh # Try to get a low-quality random seed from a random device if possible [ "$#" -le 1 ] || exit 2 -for dev in /dev/arandom /dev/urandom /dev/random '' ; do +for dev in /dev/urandom /dev/arandom /dev/random '' ; do [ -e "$dev" ] && break done [ -n "$dev" ] || exit 1 diff --git a/man/man1/rnds.1 b/man/man1/rnds.1 index 1e76d9a1..67a3f9a7 100644 --- a/man/man1/rnds.1 +++ b/man/man1/rnds.1 @@ -13,7 +13,7 @@ the first field of a cksum(1) based on it as a low-quality random numeric seed. The only optional argument allows specifying the number of random bytes to read, defaulting to 32. This is intended as a low-quality seed for rndi(1). .P -/dev/arandom is tried first, then /dev/urandom, then /dev/random, before the +/dev/urandom is tried first, then /dev/arandom, then /dev/random, before the script gives up and emits nothing. .SH SEE ALSO rndi(1), rnda(1), rndf(1), rndl(1), rndn(6) -- cgit v1.2.3