cluster: RHEL511 - rgmanager: Fix for clustat crash when using an invalid config

Ryan McCabe rmccabe at fedoraproject.org
Thu Mar 13 18:25:55 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=fde6e0e3a1fc1dac3b95d7cd96315bb2231ccfd5
Commit:        fde6e0e3a1fc1dac3b95d7cd96315bb2231ccfd5
Parent:        a2140f35bd8cd7b01cbf8c94f9fd7e12b6b59302
Author:        Ryan McCabe <rmccabe at redhat.com>
AuthorDate:    Thu Mar 13 14:24:50 2014 -0400
Committer:     Ryan McCabe <rmccabe at redhat.com>
CommitterDate: Thu Mar 13 14:24:50 2014 -0400

rgmanager: Fix for clustat crash when using an invalid config

Fix for a crash in clustat when executed with an invalid cluster
configuration file.

Resolves: rhbz#853083

Signed-off-by: Ryan McCabe <rmccabe at redhat.com>
---
 rgmanager/src/utils/clustat.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/rgmanager/src/utils/clustat.c b/rgmanager/src/utils/clustat.c
index e9fc4ef..d0ccbf8 100644
--- a/rgmanager/src/utils/clustat.c
+++ b/rgmanager/src/utils/clustat.c
@@ -980,6 +980,10 @@ build_member_list(cman_handle_t ch, int *lid)
 
 		/* See if our config has anyone missed.  If so, flag
 		   them as missing from the config file */
+		if (!all->cml_members) {
+			all->cml_count = 0;
+			fprintf(stderr, "Error: ccs returned no members. Output may be unreliable.\n");
+		}
 		all = add_missing(all, part);
 
 		/* Flag online nodes */


More information about the cluster-commits mailing list