1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

Replace random() and related calls with generate_random_buffer()

Result: better seeded random numbers that are cryptographically secure
(not that it matters in this case)

Please let it be right this time...

Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Robin McCorkell
2015-07-09 15:28:05 +01:00
committed by Jeremy Allison
parent 57e2c0dfa6
commit 936a799d32
2 changed files with 4 additions and 7 deletions

View File

@ -42,13 +42,11 @@ static void shuffle_dc_set(struct dc_set *list)
{
uint32_t i;
srandom(time(NULL));
for (i = list->count; i > 1; i--) {
uint32_t r;
const char *tmp;
r = random() % i;
r = generate_random() % i;
tmp = list->names[i - 1];
list->names[i - 1] = list->names[r];