|
|
04a57c |
From 79b778debfee5b4ab2d099b2bfc7385f45597f70 Mon Sep 17 00:00:00 2001
|
|
|
04a57c |
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
|
|
04a57c |
Date: Tue, 26 Mar 2019 11:17:45 +0100
|
|
|
04a57c |
Subject: [PATCH] Fix: sbd-pacemaker: bail out of status earlier
|
|
|
04a57c |
|
|
|
04a57c |
Prevents possible subsequent null-pointer access and avoids
|
|
|
04a57c |
unnecessary search for node.
|
|
|
04a57c |
---
|
|
|
04a57c |
src/sbd-pacemaker.c | 10 +++++++---
|
|
|
04a57c |
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
04a57c |
|
|
|
04a57c |
diff --git a/src/sbd-pacemaker.c b/src/sbd-pacemaker.c
|
|
|
04a57c |
index c69fc55..9a8b95f 100644
|
|
|
04a57c |
--- a/src/sbd-pacemaker.c
|
|
|
04a57c |
+++ b/src/sbd-pacemaker.c
|
|
|
04a57c |
@@ -276,7 +276,7 @@ compute_status(pe_working_set_t * data_set)
|
|
|
04a57c |
static int updates = 0;
|
|
|
04a57c |
static int ever_had_quorum = FALSE;
|
|
|
04a57c |
|
|
|
04a57c |
- node_t *node = pe_find_node(data_set->nodes, local_uname);
|
|
|
04a57c |
+ node_t *node = NULL;
|
|
|
04a57c |
|
|
|
04a57c |
updates++;
|
|
|
04a57c |
|
|
|
04a57c |
@@ -286,11 +286,15 @@ compute_status(pe_working_set_t * data_set)
|
|
|
04a57c |
return;
|
|
|
04a57c |
}
|
|
|
04a57c |
|
|
|
04a57c |
+ node = pe_find_node(data_set->nodes, local_uname);
|
|
|
04a57c |
|
|
|
04a57c |
- if (node == NULL) {
|
|
|
04a57c |
+ if ((node == NULL) || (node->details == NULL)) {
|
|
|
04a57c |
set_servant_health(pcmk_health_unknown, LOG_WARNING, "Node state: %s is UNKNOWN", local_uname);
|
|
|
04a57c |
+ notify_parent();
|
|
|
04a57c |
+ return;
|
|
|
04a57c |
+ }
|
|
|
04a57c |
|
|
|
04a57c |
- } else if (node->details->online == FALSE) {
|
|
|
04a57c |
+ if (node->details->online == FALSE) {
|
|
|
04a57c |
set_servant_health(pcmk_health_unknown, LOG_WARNING, "Node state: OFFLINE");
|
|
|
04a57c |
|
|
|
04a57c |
} else if (node->details->unclean) {
|
|
|
04a57c |
--
|
|
|
04a57c |
1.8.3.1
|
|
|
04a57c |
|