Skip to contentSkip to conversation

multipath-tools/libmultipath discovery.c structs.h

PATCH [email protected] 1 participant 1 message May 28, 2010 Device mapper

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL4_FC5
Changes by: [email protected] 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

libmultipath/discovery.c +3 -2
@@ -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;
libmultipath/structs.h +1 -1
@@ -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