Whamcloud - gitweb
libuuid: try to use getrandom() or getentropy() if available
authorTheodore Ts'o <tytso@mit.edu>
Tue, 21 Dec 2021 19:28:51 +0000 (14:28 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 21 Dec 2021 19:28:51 +0000 (14:28 -0500)
commit39ace91b8e930d3167bacf7f5395eb1eb43f371d
treec30fa792db887226226a6f169c2ff00b87c6d4eb
parent755e1da8398c0414c3ce4a399f5661f255e61529
libuuid: try to use getrandom() or getentropy() if available

If getrandom() or getentropy() is available, use these interfaces in
favor of opening /dev/[u]random.  This avoids a potential TSAN problem
that could potentially cause a fd leak when trying to open
/dev/urandom.  (Which is not a disaster, but these interfaces are more
foolproof and avoids needing to open a file descriptor in a library,
which is a good thing.)

Addresses-Google-Bug: #198050608
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
configure
configure.ac
lib/config.h.in
lib/uuid/gen_uuid.c