Link Here
|
|
|
1 |
11.x does not have getrandom(2) (or getentropy(3)) |
2 |
|
3 |
--- work/epiphany-3.38.0/lib/ephy-sync-utils.c.1 2020-10-04 16:15:55.103981000 -0600 |
4 |
+++ work/epiphany-3.38.0/lib/ephy-sync-utils.c 2020-10-04 16:16:40.982162000 -0600 |
5 |
@@ -24,6 +24,7 @@ |
6 |
#include "ephy-settings.h" |
7 |
|
8 |
#include <errno.h> |
9 |
+#include <fcntl.h> |
10 |
#include <glib/gi18n.h> |
11 |
#include <inttypes.h> |
12 |
#include <json-glib/json-glib.h> |
13 |
@@ -189,7 +190,11 @@ ephy_sync_utils_generate_random_bytes (v |
14 |
} |
15 |
#else |
16 |
do { |
17 |
- ret = getrandom (out, num_bytes, 0); |
18 |
+ int fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC); |
19 |
+ if (fd != -1) { |
20 |
+ ret = read(fd, out, num_bytes); |
21 |
+ (void)close(fd); |
22 |
+ } |
23 |
} while (ret < (gssize)num_bytes && errno == EINTR); |
24 |
|
25 |
if (ret != (gssize)num_bytes) |