Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ee…
Commit: eecdcabac84dd93abf026fbfdb6f1c850c98fa5b
Parent: 79aafcef1dafff42afcc085d55188f495ee3cc54
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Aug 5 09:56:26 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Aug 5 11:01:23 2011 +0200
cman: fix printing of error if clustername is too long
Patch 03e9af7db105 did mask an error and was not propagating the
error string in the cman pipe, making it impossible to see the error
at startup when it is more important, since clustername cannot be changed
at runtime.
Resolves: rhbz#728230
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 0abc4cd..d91dce2 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -1290,13 +1290,15 @@ static int get_cman_globals(struct objdb_iface_ver0 *objdb)
char *use_hash;
objdb_get_string(objdb, cluster_parent_handle, "name", &cluster_name);
- if (!cluster_name || strlen(cluster_name) > 15) {
- sprintf(error_reason, "%s\n", "Invalid cluster name. It must be 15 characters or fewer\n");
+ if (!cluster_name) {
+ sprintf(error_reason, "Unable to determine cluster name.\n");
+ write_cman_pipe("Unable to determine cluster name.\n");
return -1;
}
- if (!cluster_name) {
- sprintf(error_reason, "Unable to determine cluster name.\n");
+ if (strlen(cluster_name) > 15) {
+ sprintf(error_reason, "%s\n", "Invalid cluster name. It must be 15 characters or fewer\n");
+ write_cman_pipe("Invalid cluster name. It must be 15 characters or fewer\n");
return -1;
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1f…
Commit: 1f345b45a5eeaedfcf5c48ac328c32d32d30ac26
Parent: 53d23b0172773b2a17bb2a019d4bbc2118d9e307
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Mar 28 16:12:05 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Aug 5 10:59:16 2011 +0200
cman preconfig: fix segfault if we cannot determine cluster name
This takes a lot of effort to reproduce, but it can still happen.
Resolves: rhbz#728230
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index cde130b..4eb6250 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -1291,6 +1291,11 @@ static int get_cman_globals(struct objdb_iface_ver0 *objdb)
objdb_get_string(objdb, cluster_parent_handle, "name", &cluster_name);
+ if (!cluster_name) {
+ sprintf(error_reason, "Unable to determine cluster name.\n");
+ return -1;
+ }
+
/* Get the <cman> bits that override <totem> bits */
objdb->object_find_create(cluster_parent_handle, "cman", strlen("cman"), &find_handle);
if (objdb->object_find_next(find_handle, &object_handle) == 0) {
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ac…
Commit: ac195524d4a520b7f5bbd25e01715f4e0aa1ab19
Parent: 03e9af7db105bcfbb7a013974084d2ed171fb258
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Aug 5 09:56:26 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Aug 5 09:56:26 2011 +0200
cman: fix printing of error if clustername is too long
Patch 03e9af7db105 did mask an error and was not propagating the
error string in the cman pipe, making it impossible to see the error
at startup when it is more important, since clustername cannot be changed
at runtime.
Resolves: rhbz#728230
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index e435484..070761e 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -1274,13 +1274,15 @@ static int get_cman_globals(struct objdb_iface_ver0 *objdb)
char *use_hash;
objdb_get_string(objdb, cluster_parent_handle, "name", &cluster_name);
- if (!cluster_name || strlen(cluster_name) > 15) {
- sprintf(error_reason, "%s\n", "Invalid cluster name. It must be 15 characters or fewer\n");
+ if (!cluster_name) {
+ sprintf(error_reason, "Unable to determine cluster name.\n");
+ write_cman_pipe("Unable to determine cluster name.\n");
return -1;
}
- if (!cluster_name) {
- sprintf(error_reason, "Unable to determine cluster name.\n");
+ if (strlen(cluster_name) > 15) {
+ sprintf(error_reason, "%s\n", "Invalid cluster name. It must be 15 characters or fewer\n");
+ write_cman_pipe("Invalid cluster name. It must be 15 characters or fewer\n");
return -1;
}