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
const int NONCLUSTER_VNN = 0xFFFFFFFF;
+ /** Don't verify this unique id */
+ const int SERVERID_UNIQUE_ID_NOT_TO_VERIFY = 0xFFFFFFFFFFFFFFFFULL;
+
/* used to look like the following, note that unique_id was not
* marshalled at all...
#include "includes.h"
-/** Don't verify this unique id */
-#define SERVERID_UNIQUE_ID_NOT_TO_VERIFY 0xFFFFFFFFFFFFFFFFULL
-
/*
* Register a server with its unique id
*/
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;
}
{
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);
}