diff options
author | Amitay Isaacs <amitay@gmail.com> | 2017-08-25 15:00:59 +1000 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2017-09-13 14:57:26 +0200 |
commit | e9896f6cf57c59608f2f3b3d79150c1a34452fac (patch) | |
tree | 76a7777e0a70e9243d3d09e73d1edcafa68a2766 /ctdb | |
parent | dc476002db8792732b80c26bb22f74363a4061e3 (diff) | |
download | samba-e9896f6cf57c59608f2f3b3d79150c1a34452fac.tar.gz |
ctdb-daemon: Fix implementation of process_exists control
Only check processes that are CTDB clients.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13012
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit d0a20baf43834c7290dfd8f256d9521724202f0c)
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/server/ctdb_daemon.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index d0d86a0c703..122d884a0c9 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -1800,12 +1800,16 @@ int32_t ctdb_control_process_exists(struct ctdb_context *ctdb, pid_t pid) { struct ctdb_client *client; - if (ctdb->nodes[ctdb->pnn]->flags & (NODE_FLAGS_BANNED|NODE_FLAGS_STOPPED)) { - client = ctdb_find_client_by_pid(ctdb, pid); - if (client != NULL) { - DEBUG(DEBUG_NOTICE,(__location__ " Killing client with pid:%d on banned/stopped node\n", (int)pid)); - talloc_free(client); - } + client = ctdb_find_client_by_pid(ctdb, pid); + if (client == NULL) { + return -1; + } + + if (ctdb->nodes[ctdb->pnn]->flags & NODE_FLAGS_INACTIVE) { + DEBUG(DEBUG_NOTICE, + ("Killing client with pid:%d on banned/stopped node\n", + (int)pid)); + talloc_free(client); return -1; } |