diff options
author | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2015-07-09 15:28:05 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-07-10 06:33:07 +0200 |
commit | 936a799d32c28dc8857b97a5fe90f0150a280fa4 (patch) | |
tree | 48cdb396208df8d806837f07c3b3a5a58f2455e5 /dfs_server | |
parent | 57e2c0dfa6a66b5ad27748f3d7e675a74675e14f (diff) | |
download | samba-936a799d32c28dc8857b97a5fe90f0150a280fa4.tar.gz |
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>
Diffstat (limited to 'dfs_server')
-rw-r--r-- | dfs_server/dfs_server_ad.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/dfs_server/dfs_server_ad.c b/dfs_server/dfs_server_ad.c index 3d93e19c989..61466329eaf 100644 --- a/dfs_server/dfs_server_ad.c +++ b/dfs_server/dfs_server_ad.c @@ -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]; |