diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-04-30 15:44:01 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-04-30 17:55:11 +1000 |
commit | f10c63810077a6759a9df4e9c653066f9f355d96 (patch) | |
tree | 6256f411577eb2aaeaf41b610bdc8c09bced3c96 /source4 | |
parent | 645e4bb436c9b194477e4a66d98577a76b0b6ad7 (diff) | |
download | samba-f10c63810077a6759a9df4e9c653066f9f355d96.tar.gz samba-f10c63810077a6759a9df4e9c653066f9f355d96.tar.bz2 samba-f10c63810077a6759a9df4e9c653066f9f355d96.zip |
s4-messaging: Fill in the whole server_id in all use cases
This started per https://bugzilla.samba.org/show_bug.cgi?id=8872#c4
and avoids any possible collision with a different process.
We also need to ensure that across a Samba installation on a single
node that id.vnn is the same. Samba4 previously used 0, while Samba3
used NONCLUSTER_VNN. When a message is sent between these 'different'
nodes, the error NT_STATUS_INVALID_DEVICE_REQUEST is raised.
Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r-- | source4/cluster/local.c | 3 | ||||
-rw-r--r-- | source4/lib/messaging/messaging.c | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/source4/cluster/local.c b/source4/cluster/local.c index 24cbe81c48..df67bcfa79 100644 --- a/source4/cluster/local.c +++ b/source4/cluster/local.c @@ -37,6 +37,9 @@ static struct server_id local_id(struct cluster_ops *ops, uint64_t pid, uint32_t ZERO_STRUCT(server_id); server_id.pid = pid; server_id.task_id = task_id; + server_id.vnn = NONCLUSTER_VNN; + /* This is because we are not in the s3 serverid database */ + server_id.unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY; return server_id; } diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 80812c2885..4d69b9424b 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -663,7 +663,12 @@ struct imessaging_context *imessaging_client_init(TALLOC_CTX *mem_ctx, { struct server_id id; ZERO_STRUCT(id); - id.pid = generate_random() % 0x10000000; + id.pid = getpid(); + id.task_id = generate_random(); + id.vnn = NONCLUSTER_VNN; + + /* This is because we are not in the s3 serverid database */ + id.unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY; return imessaging_init(mem_ctx, lp_ctx, id, ev, true); } |