From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christine Caulfield Date: Fri, 05 Aug 2011 09:30:06 +0100 Subject: [Cluster-devel] [PATCH 2/2] cman: fix printing of error if clustername is too long In-Reply-To: <1312531737-27061-2-git-send-email-fdinitto@redhat.com> References: <1312531737-27061-1-git-send-email-fdinitto@redhat.com> <1312531737-27061-2-git-send-email-fdinitto@redhat.com> Message-ID: <4E3BAA0E.6030403@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 > --- > 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; > } >