]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-daemon: Fix implementation of process_exists control
authorAmitay Isaacs <amitay@gmail.com>
Fri, 25 Aug 2017 05:00:59 +0000 (15:00 +1000)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Sep 2017 12:57:26 +0000 (14:57 +0200)
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)

ctdb/server/ctdb_daemon.c

index d0d86a0c70368afb8019d298ac8aa358a3797504..122d884a0c9d62dba6c77a74273cec0cd69ba836 100644 (file)
@@ -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;
        }