diff options
author | Karel Zak | 2018-03-20 14:17:24 +0100 |
---|---|---|
committer | Karel Zak | 2018-03-20 14:17:24 +0100 |
commit | edc1c90cb972fdca1f66be5a8e2b0706bd2a4949 (patch) | |
tree | e523d85686a7a0f59e22428685f5eae5df07980c /libsmartcols | |
parent | tests: add /proc/swaps libmount parser test (diff) | |
download | kernel-qcow2-util-linux-edc1c90cb972fdca1f66be5a8e2b0706bd2a4949.tar.gz kernel-qcow2-util-linux-edc1c90cb972fdca1f66be5a8e2b0706bd2a4949.tar.xz kernel-qcow2-util-linux-edc1c90cb972fdca1f66be5a8e2b0706bd2a4949.zip |
lib/randutils: don't break on EAGAIN, use usleep()
The current code uses lose_counter to make more attempts to read
random numbers. It seems better to wait a moment between attempts to
avoid busy loop (we do the same in all-io.h).
The worst case is 1 second delay for all random_get_bytes() on systems
with uninitialized entropy pool -- for example you call sfdisk (MBR Id
or GPT UUIDs) on very first boot, etc. In this case it will use libc
rand() as a fallback solution.
Note that we do not use random numbers for security sensitive things
like keys or so. It's used for random based UUIDs etc.
Addresses: https://github.com/karelzak/util-linux/pull/603
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols')
0 files changed, 0 insertions, 0 deletions