seedrng: use posix positional params to avoid space splitting
The value of ${seed_dir} may have spaces in it, making the current argument string building method unsafe. Instead, use positional parameters to pass these arguments safely.
This commit is contained in:
parent
b5f713124b
commit
f81bb7e2c4
@ -19,18 +19,18 @@ depend()
|
|||||||
provide urandom
|
provide urandom
|
||||||
}
|
}
|
||||||
|
|
||||||
seedrng_options()
|
seedrng_with_options()
|
||||||
{
|
{
|
||||||
[ -n "${seed_dir}" ] &&
|
set --
|
||||||
echo "--seed-dir \"${seed_dir}\""
|
[ -n "${seed_dir}" ] && set -- "$@" --seed-dir "${seed_dir}"
|
||||||
yesno "${skip_credit}" &&
|
yesno "${skip_credit}" && set -- "$@" --skip-credit
|
||||||
echo "--skip-credit"
|
seedrng "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
ebegin "Seeding random number generator"
|
ebegin "Seeding random number generator"
|
||||||
seedrng $(seedrng_options)
|
seedrng_with_options
|
||||||
eend $? "Error seeding random number generator"
|
eend $? "Error seeding random number generator"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -38,7 +38,7 @@ start()
|
|||||||
stop()
|
stop()
|
||||||
{
|
{
|
||||||
ebegin "Saving random number generator seed"
|
ebegin "Saving random number generator seed"
|
||||||
seedrng $(seedrng_options)
|
seedrng_with_options
|
||||||
eend $? "Error saving random number generator seed"
|
eend $? "Error saving random number generator seed"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user