summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-25 17:53:18 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-25 11:43:40 +0200
commitb8055132b1c62dd19981fea2822ab9e1829a8ded (patch)
tree582519dd1afa5220badf790c390738b9def40996 /source4/lib
parente346bba1fc369cc13438cf3882961ef7b11ccc3a (diff)
downloadsamba-b8055132b1c62dd19981fea2822ab9e1829a8ded.tar.gz
samba-b8055132b1c62dd19981fea2822ab9e1829a8ded.tar.bz2
samba-b8055132b1c62dd19981fea2822ab9e1829a8ded.zip
s4-messaging: Use generate_random() to get a unique ID for messaging clients
The call to random() resulted in duplicate values for s3fs configurations which, due to the forked child, all started with the same random seed. A future improvement would be to move to a proven unique value. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Apr 25 11:43:40 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/messaging/messaging.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index 9c337f65a5..80812c2885 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -663,7 +663,8 @@ struct imessaging_context *imessaging_client_init(TALLOC_CTX *mem_ctx,
{
struct server_id id;
ZERO_STRUCT(id);
- id.pid = random() % 0x10000000;
+ id.pid = generate_random() % 0x10000000;
+
return imessaging_init(mem_ctx, lp_ctx, id, ev, true);
}
/*