[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH] Fix cman node name override in stable2 branch




Hi Chrissie,

the patch is fairly simple.. we fail to set the nodename when overriding and we display wrong information in case of error.

Thanks
Fabio

--
I'm going to make him an offer he can't refuse.
diff --git a/cman/daemon/cmanccs.c b/cman/daemon/cmanccs.c
index 2bfc299..78a237b 100644
--- a/cman/daemon/cmanccs.c
+++ b/cman/daemon/cmanccs.c
@@ -564,9 +564,9 @@ static int get_ccs_join_info(void)
 	/* our nodename */
 	if (nodename_env) {
 		int ret;
-		ret = snprintf(path, sizeof(path), NODE_NAME_PATH_BYNAME, nodename);
+		ret = snprintf(path, sizeof(path), NODE_NAME_PATH_BYNAME, nodename_env);
 		if (ret < 0 || (size_t) ret >= sizeof(path)) {
-			log_printf(LOG_ERR, "Overridden node name %s is too long", nodename);
+			log_printf(LOG_ERR, "Overridden node name %s is too long", nodename_env);
 			write_cman_pipe("Overridden node name is too long");
 			error = -E2BIG;
 			goto out;
@@ -576,11 +576,12 @@ static int get_ccs_join_info(void)
 		if (!error) {
 			free(str);
 		} else {
-			log_printf(LOG_ERR, "Overridden node name %s is not in CCS", nodename);
+			log_printf(LOG_ERR, "Overridden node name %s is not in CCS", nodename_env);
 			write_cman_pipe("Overridden node name is not in CCS");
 			error = -ENOENT;
 			goto out;
 		}
+		strcpy(nodename, nodename_env);
 	} else {
 		struct utsname utsname;
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]