aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-04-10 23:01:53 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2022-04-10 23:01:53 +0200
commitd810539a73ec6b976007b8aa075cb9046507afba (patch)
tree95dd0f5af3bdb70495e552f451e9cd9a0f05d174
parentUse *at family of functions (diff)
downloadseedrng-d810539a73ec6b976007b8aa075cb9046507afba.tar.xz
seedrng-d810539a73ec6b976007b8aa075cb9046507afba.zip
An ioctl does not require write access
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--seedrng.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/seedrng.c b/seedrng.c
index 5978c97..0eb1ac5 100644
--- a/seedrng.c
+++ b/seedrng.c
@@ -292,7 +292,7 @@ static int seed_rng(uint8_t *seed, size_t len, bool credit)
}
memcpy(req.buffer, seed, len);
- random_fd = open("/dev/random", O_RDWR);
+ random_fd = open("/dev/random", O_RDONLY);
if (random_fd < 0)
return -1;
ret = ioctl(random_fd, RNDADDENTROPY, &req);