1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-daemon: Check all connections from a process in CHECK_PID_SRVID control

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Amitay Isaacs 2017-09-22 13:52:09 +10:00 committed by Volker Lendecke
parent 3a360f552d
commit e342f1f078

View File

@ -1774,7 +1774,7 @@ int32_t ctdb_control_process_exists(struct ctdb_context *ctdb, pid_t pid)
int32_t ctdb_control_check_pid_srvid(struct ctdb_context *ctdb,
TDB_DATA indata)
{
struct ctdb_client *client;
struct ctdb_client_pid_list *client_pid;
pid_t pid;
uint64_t srvid;
int ret;
@ -1782,17 +1782,19 @@ int32_t ctdb_control_check_pid_srvid(struct ctdb_context *ctdb,
pid = *(pid_t *)indata.dptr;
srvid = *(uint64_t *)(indata.dptr + sizeof(pid_t));
client = ctdb_find_client_by_pid(ctdb, pid);
if (client == NULL) {
return -1;
for (client_pid = ctdb->client_pids;
client_pid != NULL;
client_pid = client_pid->next) {
if (client_pid->pid == pid) {
ret = srvid_exists(ctdb->srv, srvid,
client_pid->client);
if (ret == 0) {
return 0;
}
}
}
ret = srvid_exists(ctdb->srv, srvid, client);
if (ret != 0) {
return -1;
}
return 0;
return -1;
}
int ctdb_control_getnodesfile(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA indata, TDB_DATA *outdata)