[Buildroot] [PATCH] package/urandom-scripts: do not seed if initial seed doesn't exist

Peter Korsgaard peter at korsgaard.com
Sun May 22 10:11:31 UTC 2022


>>>>> "Jason" == Jason A Donenfeld <Jason at zx2c4.com> writes:

 > By returning a failure in the event that the initial seed doesn't exist,
 > we'd then skip creating a new seed, which means we'd never in fact have
 > an initial seed, and this script is therefore useless. Fix this by
 > checking for the existence of the seed file first, and just returning 0
 > if it's not there.

 > Reported-by: Nicolas Cavallari <Nicolas.Cavallari at green-communications.fr>
 > Reported-by: Eugen Hristev <Eugen.Hristev at microchip.com>
 > Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>

Committed to 2022.02.x, thanks.

> ---
 >  package/urandom-scripts/S20urandom | 1 +
 >  1 file changed, 1 insertion(+)

 > diff --git a/package/urandom-scripts/S20urandom b/package/urandom-scripts/S20urandom
 > index c6b2ebd48f..6c6aea9eee 100644
 > --- a/package/urandom-scripts/S20urandom
 > +++ b/package/urandom-scripts/S20urandom
 > @@ -18,6 +18,7 @@ else
 >  fi
 
 >  init_rng() {
 > +	[ -f "$URANDOM_SEED" ] || return 0
 >  	printf 'Initializing random number generator: '
 >  	dd if="$URANDOM_SEED" bs="$pool_size" of=/dev/urandom count=1 2> /dev/null
 >  	status=$?
 > -- 

 > 2.35.1


-- 
Bye, Peter Korsgaard



More information about the buildroot mailing list