From 49cac232d8e3cc6147a530d4f7971832f6b869b5 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 28 Mar 2026 08:09:14 +0000 Subject: libreboot-utils: much stricter open() handling abort on error, and do EINTR looping Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/rand.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'util/libreboot-utils/lib/rand.c') diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c index 99da713c..030ca5ec 100644 --- a/util/libreboot-utils/lib/rand.c +++ b/util/libreboot-utils/lib/rand.c @@ -142,9 +142,7 @@ rset(void *buf, size_t n) #if defined(USE_URANDOM) && \ ((USE_URANDOM) > 0) int fd = -1; - - if ((fd = open("/dev/urandom", O_RDONLY)) < 0) - goto err; + open_on_eintr("/dev/urandom", &fd, O_RDONLY, 0400); retry_rand: if ((rc = read(fd, (unsigned char *)buf + off, n - off)) < 0) { #elif defined(__linux__) -- cgit v1.2.1