All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH 1/2] cman: Print an error if cluster name is too long
@ 2011-08-05  8:08 Fabio M. Di Nitto
  2011-08-05  8:08 ` [Cluster-devel] [PATCH 2/2] cman: fix printing of error if clustername " Fabio M. Di Nitto
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio M. Di Nitto @ 2011-08-05  8:08 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Christine Caulfield <ccaulfie@redhat.com>

Print an error and exit cman-preconfig if the cluster name
exceeeds 15 characters.

Resolvs: rhbz#728230

Signed-off-by: Christine Caulfield <ccaulfie@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");
-- 
1.7.4.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Cluster-devel] [PATCH 2/2] cman: fix printing of error if clustername is too long
  2011-08-05  8:08 [Cluster-devel] [PATCH 1/2] cman: Print an error if cluster name is too long Fabio M. Di Nitto
@ 2011-08-05  8:08 ` Fabio M. Di Nitto
  2011-08-05  8:30   ` Christine Caulfield
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio M. Di Nitto @ 2011-08-05  8:08 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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@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;
 	}
 
-- 
1.7.4.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Cluster-devel] [PATCH 2/2] cman: fix printing of error if clustername is too long
  2011-08-05  8:08 ` [Cluster-devel] [PATCH 2/2] cman: fix printing of error if clustername " Fabio M. Di Nitto
@ 2011-08-05  8:30   ` Christine Caulfield
  0 siblings, 0 replies; 3+ messages in thread
From: Christine Caulfield @ 2011-08-05  8:30 UTC (permalink / raw)
  To: cluster-devel.redhat.com

ACK to both

Chrissie

On 05/08/11 09:08, Fabio M. Di Nitto wrote:
> 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@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;
>   	}
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-05  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-05  8:08 [Cluster-devel] [PATCH 1/2] cman: Print an error if cluster name is too long Fabio M. Di Nitto
2011-08-05  8:08 ` [Cluster-devel] [PATCH 2/2] cman: fix printing of error if clustername " Fabio M. Di Nitto
2011-08-05  8:30   ` Christine Caulfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.