FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 11-23-2011, 09:15 AM
"Fabio M. Di Nitto"
 
Default cman: add check to guarantee we found our own node name

Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
:100644 100644 16ef65f... f23f386... M cman/daemon/cmanconfig.c
cman/daemon/cmanconfig.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/cman/daemon/cmanconfig.c b/cman/daemon/cmanconfig.c
index 16ef65f..f23f386 100644
--- a/cman/daemon/cmanconfig.c
+++ b/cman/daemon/cmanconfig.c
@@ -71,7 +71,15 @@ int read_cman_nodes(struct corosync_api_v1 *corosync, unsigned int *config_versi
objdb_get_int(corosync, object_handle, "expected_votes", &expected, 0);
objdb_get_int(corosync, object_handle, "two_node", (unsigned int *)&two_node, 0);
objdb_get_int(corosync, object_handle, "cluster_id", &cluster_id, 0);
- objdb_get_string(corosync, object_handle, "nodename", &our_nodename);
+ if (objdb_get_string(corosync, object_handle, "nodename", &our_nodename) != 0) {
+ char message[132];
+ snprintf(message, sizeof(message),
+ "cman was unable to determine our node name!
");
+ log_printf(LOG_ERR, "%s", message);
+ write_cman_pipe(message);
+ error = -EINVAL;
+ goto out_err;
+ }
objdb_get_int(corosync, object_handle, "max_queued", &max_outstanding_messages, DEFAULT_MAX_QUEUED);
}
corosync->object_find_destroy(find_handle);
--
1.7.4.4
 

Thread Tools




All times are GMT. The time now is 03:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org