cluster: RHEL6 - cman: fix handling of transport="xxx" in cman/totem preconfig
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 234c0749b15ca95277e6ac4ebf9e68234e9b161f
Parent: 31c734fe4fe5d95fac8fc7a5519c175b748ab8ec
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Aug 8 11:33:02 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Aug 8 12:24:19 2011 +0200
cman: fix handling of transport="xxx" in cman/totem preconfig
and address a memory corruption when broadcast="" is set.
Resolves: rhbz#695795
Reviewed-by: Jan Friesse <jfriesse(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index d91dce2..c85331b 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -296,6 +296,7 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr,
hdb_handle_t interface_object_handle;
struct sockaddr_storage if_addr, localhost, mcast_addr;
char tmp[132];
+ char *transportstr;
int ret = 0;
const char *tx_mech_to_str[] = {
[TX_MECH_UDP] = "udp",
@@ -322,11 +323,17 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr,
if (objdb->object_find_next(find_handle, &totem_object_handle)) {
objdb->object_create(OBJECT_PARENT_HANDLE, &totem_object_handle,
"totem", strlen("totem"));
- objdb->object_key_create_typed(totem_object_handle, "transport",
- tx_mech_to_str[transport], strlen(tx_mech_to_str[transport]) + 1, OBJDB_VALUETYPE_STRING);
}
objdb->object_find_destroy(find_handle);
+ if (objdb_get_string(objdb, totem_object_handle, "transport", &transportstr)) {
+ objdb->object_key_create_typed(totem_object_handle, "transport",
+ tx_mech_to_str[transport], strlen(tx_mech_to_str[transport]) + 1, OBJDB_VALUETYPE_STRING);
+ } else {
+ sprintf(error_reason, "Transport should not be specified within <totem .../>, use <cman transport=\"...\" /> instead");
+ return -1;
+ }
+
if (objdb->object_create(totem_object_handle, &interface_object_handle,
"interface", strlen("interface")) == 0) {
struct sockaddr_in *in = (struct sockaddr_in *)&if_addr;
@@ -724,7 +731,6 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
return -1;
transport = TX_MECH_UDPB;
}
- free(str);
}
/* Check for transport */
12 years, 9 months
cluster: STABLE31 - cman: fix handling of transport="xxx" in cman/totem preconfig
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: da36fb6bc9e7a8908011e41ef78235f6c0160ca6
Parent: ac195524d4a520b7f5bbd25e01715f4e0aa1ab19
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Aug 8 11:33:02 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Aug 8 11:33:02 2011 +0200
cman: fix handling of transport="xxx" in cman/totem preconfig
and address a memory corruption when broadcast="" is set.
Resolves: rhbz#695795
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 070761e..0f5f937 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -283,6 +283,7 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr,
hdb_handle_t interface_object_handle;
struct sockaddr_storage if_addr, localhost, mcast_addr;
char tmp[132];
+ char *transportstr;
int ret = 0;
const char *tx_mech_to_str[] = {
[TX_MECH_UDP] = "udp",
@@ -309,11 +310,17 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr,
if (objdb->object_find_next(find_handle, &totem_object_handle)) {
objdb->object_create(OBJECT_PARENT_HANDLE, &totem_object_handle,
"totem", strlen("totem"));
- objdb->object_key_create_typed(totem_object_handle, "transport",
- tx_mech_to_str[transport], strlen(tx_mech_to_str[transport]) + 1, OBJDB_VALUETYPE_STRING);
}
objdb->object_find_destroy(find_handle);
+ if (objdb_get_string(objdb, totem_object_handle, "transport", &transportstr)) {
+ objdb->object_key_create_typed(totem_object_handle, "transport",
+ tx_mech_to_str[transport], strlen(tx_mech_to_str[transport]) + 1, OBJDB_VALUETYPE_STRING);
+ } else {
+ sprintf(error_reason, "Transport should not be specified within <totem .../>, use <cman transport=\"...\" /> instead");
+ return -1;
+ }
+
if (objdb->object_create(totem_object_handle, &interface_object_handle,
"interface", strlen("interface")) == 0) {
struct sockaddr_in *in = (struct sockaddr_in *)&if_addr;
@@ -709,7 +716,6 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
return -1;
transport = TX_MECH_UDPB;
}
- free(str);
}
/* Check for transport */
12 years, 9 months
cluster: RHEL61 - config: update schema to include fence_cisco_ucs suborg
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 63c82dd8e3977c9073e3e74967647b80bf777138
Parent: 07e8af1525aea996d879524715d46f2942b29410
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Aug 5 13:39:50 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Aug 5 13:39:50 2011 +0200
config: update schema to include fence_cisco_ucs suborg
Resolves: rhbz#728247
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
config/tools/xml/cluster.rng.in | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/config/tools/xml/cluster.rng.in b/config/tools/xml/cluster.rng.in
index ae85bd4..28dbcb1 100644
--- a/config/tools/xml/cluster.rng.in
+++ b/config/tools/xml/cluster.rng.in
@@ -3398,6 +3398,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="port" rha:description="Physical plug number or name of virtual machine" />
</optional>
<optional>
+ <attribute name="suborg" rha:description="Additional path needed to access suborganization" />
+ </optional>
+ <optional>
<attribute name="verbose" rha:description="Verbose mode" />
</optional>
<optional>
12 years, 9 months
cluster: RHEL6 - config: fix escaping of xml special characters
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 31c734fe4fe5d95fac8fc7a5519c175b748ab8ec
Parent: eecdcabac84dd93abf026fbfdb6f1c850c98fa5b
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Aug 4 12:19:44 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Aug 5 11:28:14 2011 +0200
config: fix escaping of xml special characters
when transforming config data from objdb to xml, we need to parse CDATA sections
for &<>"' chars and make sure the are correctly transformed into escaped versions
or xml parser will refuse to load.
Resolves: rhbz#726065
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
config/libs/libccsconfdb/fullxpath.c | 34 +++++++++++++++++++++++++++++++++-
config/tools/xml/ccs_config_dump.c | 28 +++++++++++++++++++++++++++-
2 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/config/libs/libccsconfdb/fullxpath.c b/config/libs/libccsconfdb/fullxpath.c
index 994c8d8..577c74a 100644
--- a/config/libs/libccsconfdb/fullxpath.c
+++ b/config/libs/libccsconfdb/fullxpath.c
@@ -73,10 +73,42 @@ static int dump_objdb_buff(confdb_handle_t dump_handle, hdb_handle_t cluster_han
confdb_key_iter(dump_handle, parent_object_handle, key_name,
&key_name_len, key_value,
&key_value_len)) == CS_OK) {
+ int char_pos = 0;
key_name[key_name_len] = '\0';
key_value[key_value_len] = '\0';
- snprintf(temp, PATH_MAX - 1, " %s=\"%s\"", key_name, key_value);
+ snprintf(temp, PATH_MAX - 1, " %s=\"", key_name);
+ if (add_to_buffer(temp, buffer, bufsize))
+ return -1;
+
+ for (char_pos = 0; char_pos < key_value_len-1; char_pos++) {
+ switch (key_value[char_pos]) {
+
+ case '&':
+ snprintf(temp, PATH_MAX - 1, "&");
+ break;
+ case '<':
+ snprintf(temp, PATH_MAX - 1, "<");
+ break;
+ case '>':
+ snprintf(temp, PATH_MAX - 1, ">");
+ break;
+ case '"':
+ snprintf(temp, PATH_MAX - 1, """);
+ break;
+ case '\'':
+ snprintf(temp, PATH_MAX - 1, "'");
+ break;
+ default:
+ temp[0] = key_value[char_pos];
+ temp[1] = '\0';
+ break;
+ }
+ if (add_to_buffer(temp, buffer, bufsize))
+ return -1;
+ }
+
+ snprintf(temp, PATH_MAX - 1, "\"");
if (add_to_buffer(temp, buffer, bufsize))
return -1;
}
diff --git a/config/tools/xml/ccs_config_dump.c b/config/tools/xml/ccs_config_dump.c
index b6fe742..74c33c2 100644
--- a/config/tools/xml/ccs_config_dump.c
+++ b/config/tools/xml/ccs_config_dump.c
@@ -25,9 +25,35 @@ static int dump_objdb_buff(confdb_handle_t dump_handle, hdb_handle_t cluster_han
while (confdb_key_iter(dump_handle, parent_object_handle, key_name,
&key_name_len, key_value,
&key_value_len) == CS_OK) {
+ int char_pos = 0;
+
key_name[key_name_len] = '\0';
key_value[key_value_len] = '\0';
- printf(" %s=\"%s\"", key_name, key_value);
+ printf(" %s=\"", key_name);
+ for (char_pos = 0; char_pos < key_value_len-1; char_pos++) {
+ switch (key_value[char_pos]) {
+
+ case '&':
+ printf("&");
+ break;
+ case '<':
+ printf("<");
+ break;
+ case '>':
+ printf(">");
+ break;
+ case '"':
+ printf(""");
+ break;
+ case '\'':
+ printf("'");
+ break;
+ default:
+ putchar(key_value[char_pos]);
+ break;
+ }
+ }
+ printf("\"");
}
if (confdb_object_iter_start(dump_handle, parent_object_handle) != CS_OK)
12 years, 9 months
cluster: RHEL6 - cman: fix printing of error if clustername is too long
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
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;
}
12 years, 9 months
cluster: RHEL6 - cman: Print an error if cluster name is too long
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 79aafcef1dafff42afcc085d55188f495ee3cc54
Parent: 1f345b45a5eeaedfcf5c48ac328c32d32d30ac26
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Thu Aug 4 15:21:18 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Aug 5 11:01:14 2011 +0200
cman: Print an error if cluster name is too long
Print an error and exit cman-preconfig if the cluster name
exceeeds 15 characters.
Resolvs: 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 | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 4eb6250..0abc4cd 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -1290,6 +1290,10 @@ 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");
+ return -1;
+ }
if (!cluster_name) {
sprintf(error_reason, "Unable to determine cluster name.\n");
12 years, 9 months
cluster: RHEL6 - cman preconfig: fix segfault if we cannot determine cluster name
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
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) {
12 years, 9 months
cluster: STABLE31 - cman: fix printing of error if clustername is too long
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
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;
}
12 years, 9 months
cluster: RHEL58 - fsck.gfs can not check file system with 500, 000 files
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 1c9c96f17d03c51fd875eea94f14f517f2c2c446
Parent: 9be62ccbea876e67b8ad4bb3c1b4203feb4fc1f7
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Aug 4 14:40:32 2011 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Aug 4 14:40:32 2011 -0500
fsck.gfs can not check file system with 500,000 files
This patch allows fsck.gfs2 to properly process "continuation
leaf blocks" in directories. This enables gfs_fsck to process
directories properly when they get very big.
rhbz#704328
---
gfs/gfs_fsck/metawalk.c | 73 ++++++++++++++++++++++++-----------------------
1 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/gfs/gfs_fsck/metawalk.c b/gfs/gfs_fsck/metawalk.c
index e28a1cc..e14d4dc 100644
--- a/gfs/gfs_fsck/metawalk.c
+++ b/gfs/gfs_fsck/metawalk.c
@@ -251,35 +251,39 @@ static int check_leaf_blks(struct fsck_inode *ip, int *update,
ref_count++;
continue;
}
- if(check_range(sbp, old_leaf) == 0 && ref_count != exp_count){
- log_err("Dir #%"PRIu64" has an incorrect number "
- "of pointers to leaf #%"PRIu64"\n"
- "\tFound: %u, Expected: %u\n",
- ip->i_num.no_addr, old_leaf, ref_count,
- exp_count);
- errors_found++;
- if (query(ip->i_sbd, "Attempt to fix it? (y/n) ")) {
- int factor = 0, divisor = ref_count;
-
- errors_corrected++;
- get_and_read_buf(sbp, old_leaf, &lbh);
- while (divisor > 1) {
- factor++;
- divisor /= 2;
+ do {
+ if(check_range(sbp, old_leaf) == 0 &&
+ ref_count != exp_count){
+ log_err("Dir #%"PRIu64" has an incorrect "
+ "number of pointers to leaf #%"PRIu64
+ "\n\tFound: %u, Expected: %u\n",
+ ip->i_num.no_addr, old_leaf, ref_count,
+ exp_count);
+ errors_found++;
+ if (query(ip->i_sbd, "Attempt to fix it? "
+ "(y/n) ")) {
+ int factor = 0, divisor = ref_count;
+
+ errors_corrected++;
+ get_and_read_buf(sbp, old_leaf, &lbh);
+ while (divisor > 1) {
+ factor++;
+ divisor /= 2;
+ }
+ gfs_leaf_in(&oldleaf, BH_DATA(lbh));
+ oldleaf.lf_depth = ip->i_di.di_depth -
+ factor;
+ gfs_leaf_out(&oldleaf, BH_DATA(lbh));
+ write_buf(sbp, lbh, 0);
+ relse_buf(sbp, lbh);
}
- gfs_leaf_in(&oldleaf, BH_DATA(lbh));
- oldleaf.lf_depth = ip->i_di.di_depth - factor;
- gfs_leaf_out(&oldleaf, BH_DATA(lbh));
- write_buf(sbp, lbh, 0);
- relse_buf(sbp, lbh);
+ else
+ return 1;
}
- else
- return 1;
- }
- ref_count = 1;
+ ref_count = 1;
+
+ count = 0;
- count = 0;
- do {
if (fsck_abort)
break;
/* Make sure the block number is in range. */
@@ -376,19 +380,16 @@ static int check_leaf_blks(struct fsck_inode *ip, int *update,
}
relse_buf(sbp, lbh);
}
- /* FIXME: Need to get entry count and
- * compare it against leaf->lf_entries */
- break; /* not a chain; go back to outer loop */
- } else {
+ } else
relse_buf(sbp, lbh);
- if(!leaf.lf_next)
- break;
- leaf_no = leaf.lf_next;
- log_debug("Leaf chain detected.\n");
- }
+ old_leaf = leaf_no;
+ memcpy(&oldleaf, &leaf, sizeof(oldleaf));
+ if (!leaf.lf_next)
+ break;
+ leaf_no = leaf.lf_next;
+ log_debug("Leaf chain 0x%llx detected.\n",
+ (unsigned long long)leaf_no);
} while(1); /* while we have chained leaf blocks */
- old_leaf = leaf_no;
- memcpy(&oldleaf, &leaf, sizeof(oldleaf));
} /* for every leaf block */
return 0;
}
12 years, 9 months
cluster: STABLE31 - cman: Print an error if cluster name is too long
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 03e9af7db105bcfbb7a013974084d2ed171fb258
Parent: ccfe7c7037d784cd4b004a4ff808f93517738247
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Thu Aug 4 15:21:18 2011 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Thu Aug 4 15:21:18 2011 +0100
cman: Print an error if cluster name is too long
Print an error and exit cman-preconfig if the cluster name
exceeeds 15 characters.
Resolvs: rhbz#728230
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index aeedf8b..e435484 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -1274,6 +1274,10 @@ 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");
+ return -1;
+ }
if (!cluster_name) {
sprintf(error_reason, "Unable to determine cluster name.\n");
12 years, 9 months