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

[Cluster-devel] cluster/cman/daemon cmanccs.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL50
Changes by:	pcaulfield sourceware org	2006-12-15 15:17:13

Modified files:
	cman/daemon    : cmanccs.c 

Log message:
	Don't truncate the node name when we check for it unqualified.
	bz#217724

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.21&r2=1.21.4.1

--- cluster/cman/daemon/cmanccs.c	2006/10/02 08:50:02	1.21
+++ cluster/cman/daemon/cmanccs.c	2006/12/15 15:17:13	1.21.4.1
@@ -283,6 +283,7 @@
 	/* If nodename (from uname) is domain-less, try to match against
 	   cluster.conf names which may have domainname specified */
 	for (i = 1; ; i++) {
+		int len;
 		str = NULL;
 		memset(path, 0, 256);
 		sprintf(path, "/cluster/clusternodes/clusternode[%d]/@name", i);
@@ -294,10 +295,12 @@
 		strcpy(nodename3, str);
 		dot = strstr(nodename3, ".");
 		if (dot)
-			*dot = '\0';
+			len = dot-nodename3;
+		else
+			len = strlen(nodename3);
 
-		if (strlen(nodename2) == strlen(nodename3) &&
-		    !strncmp(nodename2, nodename3, strlen(nodename3))) {
+		if (strlen(nodename2) == len &&
+		    !strncmp(nodename2, nodename3, len)) {
 			free(str);
 			strcpy(nodename, nodename3);
 			return 0;


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