From 408e3420d1633d87d6d29985b06c7822f194e2b5 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sun, 21 Mar 2010 16:06:34 -0700 Subject: [PATCH] try hard to unset HOME and randfile --- lib/hcrypto/test_crypto.in | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/hcrypto/test_crypto.in b/lib/hcrypto/test_crypto.in index e9817eaed..5b639c761 100644 --- a/lib/hcrypto/test_crypto.in +++ b/lib/hcrypto/test_crypto.in @@ -83,16 +83,24 @@ done # RAND_file_name() when the enviroment is lacking those. # -HOME= -RANDFILE= +if [ -e /dev/random -o -e /dev/urandom -o -e /dev/srandom -o -e /dev/arandom ] ; then + + # try hard to unset HOME and RANDFILE + HOME= + RANDFILE= + + unset HOME + unset RANDFILE + + ${rand} --method=unix --file=unix 2>error + res=$? + if test "X$res" != X0 ; then + grep "random not ready yet" error || \ + { echo "random unix ready failing" ; cat error; exit 1; } + echo "random method unix out for lunch" + continue + fi -${rand} --method=unix --file=unix 2>error -res=$? -if test "X$res" != X0 ; then - grep "random not ready yet" error || \ - { echo "random unix ready failing" ; cat error; exit 1; } - echo "random method unix out for lunch" - continue fi exit 0