Skip to contentSkip to conversation

Fix user_friendly_names for WWIDs with spaces

PATCH In review Benjamin Marzinski 1 participant 1 message Dec 11, 2008 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 6/6 Fix user_friendly_names for WWIDs with spaces

The user_friendly_names code didn't handle WWIDs with spaces correctly. This fixes it by taking everything from the start of the WWID to the end of the line as the WWID. The only downside is that if someone hand edits their bindings file, they may leave stray whitespace at the end of the line, and cause it to not match. This could ne solved by quoting the WWIDs and escaping any quotes that they might have, but I don't think that people hand edit their bindings files enough to make it a problem.

---
 libmultipath/alias.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/alias.c +1 -1
Index: multipath-tools-081203/libmultipath/alias.c
===================================================================
@@ -243,7 +243,7 @@ lookup_binding(FILE *f, char *map_wwid, 
 		curr_id = scan_devname(alias);
 		if (curr_id >= id)
 			id = curr_id + 1;
-		wwid = strtok(NULL, " \t");
+		wwid = strtok(NULL, "");
 		if (!wwid){
 			condlog(3,
 				"Ignoring malformed line %u in bindings file",