[dm-devel] multipath-tools/libmultipath discovery.c structs.h

bmarzins at sourceware.org bmarzins at sourceware.org
Fri May 28 04:53:26 UTC 2010


CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL4_FC5
Changes by:	bmarzins at sourceware.org	2010-05-28 04:53:26

Modified files:
	libmultipath   : discovery.c structs.h 

Log message:
	Fix for 512065. Increase the tgt_node_name size to be able to handle IQNs,
	which can be up to 223 bytes long.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1.28.2.8&r2=1.28.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1.17.2.9&r2=1.17.2.10

--- multipath-tools/libmultipath/discovery.c	2010/05/25 23:23:07	1.28.2.8
+++ multipath-tools/libmultipath/discovery.c	2010/05/28 04:53:25	1.28.2.9
@@ -552,7 +552,7 @@
 	}
 	if (0 <= readattr(attr_path, attr_buff) && strlen(attr_buff) > 0)
 		strncpy(curpath->tgt_node_name, attr_buff,
-			strlen(attr_buff) - 1);
+			NODE_NAME_SIZE - 1);
 	else {
 		if(safe_sprintf(attr_path,
 			"%s/class/iscsi_transport/target%i:%i:%i/target_name",
@@ -566,8 +566,9 @@
 		if (0 <= readattr(attr_path, attr_buff) &&
 		    strlen(attr_buff) > 0)
 			strncpy(curpath->tgt_node_name, attr_buff,
-				strlen(attr_buff) - 1);
+				NODE_NAME_SIZE - 1);
 	}
+	curpath->tgt_node_name[NODE_NAME_SIZE - 1] = '\0';
 	condlog(3, "tgt_node_name = %s", curpath->tgt_node_name);
 
 	return 0;
--- multipath-tools/libmultipath/structs.h	2009/01/17 00:46:51	1.17.2.9
+++ multipath-tools/libmultipath/structs.h	2010/05/28 04:53:25	1.17.2.10
@@ -5,7 +5,7 @@
 
 #define WWID_SIZE		128
 #define SERIAL_SIZE		64
-#define NODE_NAME_SIZE		19
+#define NODE_NAME_SIZE		224
 #define PATH_STR_SIZE  		16
 #define PARAMS_SIZE		1024
 #define FILE_NAME_SIZE		256




More information about the dm-devel mailing list