blob: 5d024d6ef9b4f516d9fe16404a75f501169ce5c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
diff -ru cvs-1.12.13.orig/src/main.c cvs-1.12.13/src/main.c
--- cvs-1.12.13.orig/src/main.c 2022-10-20 15:44:42.306215161 +0200
+++ cvs-1.12.13/src/main.c 2022-10-20 15:50:55.838352069 +0200
@@ -24,10 +24,6 @@
#include "strftime.h"
#include "xgethostname.h"
-#ifdef USE_LIBBSD
-uint32_t arc4random(void);
-#endif
-
const char *program_name;
const char *program_path;
const char *cvs_cmd_name;
@@ -749,10 +745,13 @@
/* Calculate the cvs global session ID */
+ int random;
+ getentropy(&random, sizeof(int));
+
global_session_id = Xasprintf("1%010llX%04X%04X",
(unsigned long long)time(NULL),
(unsigned int)(getpid() & 0xFFFF),
- (unsigned int)(arc4random() & 0xFFFF));
+ (unsigned int)random & 0xFFFF);
TRACE (TRACE_FUNCTION, "main: Session ID is %s", global_session_id);
|