summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-11-10 17:17:20 +0100
committerVolker Lendecke <vlendec@samba.org>2011-11-10 18:57:01 +0100
commit145f53e82413d7307643079f4a34aaeed0da80ab (patch)
tree1188ceb3a264e9475555d34005a553e03b2fe815 /source3
parent5e0258fc932c280428173bb397ef5a18352e63db (diff)
downloadsamba-145f53e82413d7307643079f4a34aaeed0da80ab.tar.gz
samba-145f53e82413d7307643079f4a34aaeed0da80ab.tar.bz2
samba-145f53e82413d7307643079f4a34aaeed0da80ab.zip
s3: server_id.pid has turned 64 (bits, that is)
Fix ctdb_processes_exist protocol. The socket expects pid_t which is 32 bits on 32 bit machines. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Nov 10 18:57:01 CET 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/ctdbd_conn.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 5c3b7c1f4f..e0bdbd05a5 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -938,18 +938,25 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
for (i=0; i<num_pids; i++) {
struct ctdb_req_control req;
+ pid_t pid;
results[i] = false;
reqids[i] = ctdbd_next_reqid(conn);
ZERO_STRUCT(req);
+ /*
+ * pids[i].pid is uint64_t, scale down to pid_t which
+ * is the wire protocol towards ctdb.
+ */
+ pid = pids[i].pid;
+
DEBUG(10, ("Requesting PID %d/%d, reqid=%d\n",
- (int)pids[i].vnn, (int)pids[i].pid,
+ (int)pids[i].vnn, (int)pid,
(int)reqids[i]));
req.hdr.length = offsetof(struct ctdb_req_control, data);
- req.hdr.length += sizeof(pid_t);
+ req.hdr.length += sizeof(pid);
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_VERSION;
req.hdr.operation = CTDB_REQ_CONTROL;
@@ -957,7 +964,7 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
req.hdr.destnode = pids[i].vnn;
req.opcode = CTDB_CONTROL_PROCESS_EXISTS;
req.srvid = 0;
- req.datalen = sizeof(pids[i].pid);
+ req.datalen = sizeof(pid);
req.flags = 0;
DEBUG(10, ("ctdbd_control: Sending ctdb packet\n"));
@@ -967,7 +974,7 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
conn->pkt, 2,
data_blob_const(
&req, offsetof(struct ctdb_req_control, data)),
- data_blob_const(&pids[i].pid, sizeof(pids[i].pid)));
+ data_blob_const(&pid, sizeof(pid)));
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("ctdb_packet_send failed: %s\n",
nt_errstr(status)));